-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make scripts available via CLI #2426
Conversation
print("Home Assistant has been uninstalled.") | ||
|
||
|
||
def run(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- D103: Missing docstring in public function
ac7c803
to
fd92c34
Compare
@@ -358,23 +309,13 @@ def main(): | |||
|
|||
args = get_arguments() | |||
|
|||
if args.script is not None: | |||
from homeassistant import scripts | |||
return scripts.run(args.script) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are two levels of 'argparse', here and in the script, wont duplicate --args be interpreted by the first argparse and never be passed to script.run?
(i.e -c or --config in the script)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's why the script arg in main uses the remain option. Try it by
passing help before and after invoking the dB migrate script
On Sat, Jul 2, 2016, 22:38 Johann Kellerman [email protected]
wrote:
In homeassistant/main.py
#2426 (comment)
:@@ -358,23 +309,13 @@ def main():
args = get_arguments()
- if args.script is not None:
from homeassistant import scripts
return scripts.run(args.script)
If there are two levels of 'argparse', here and in the script, wont
duplicate --args be interpreted by the first argparse and never be passed
to script.run?(i.e -c or --config in the script)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/pull/2426/files/fd92c34a19241ec6d9f8c3cd19b7d3511fd4fc85#r69385902,
or mute the thread
https://github.com/notifications/unsubscribe/ABYJ2iuC-a_PDkAVi_FktFK0pthL3PRSks5qR0rCgaJpZM4JDvUs
.
Description:
This makes scripts accessible from the command line. Moved the OS X scripts there as well.
This should make the SQLAlchemy migrate script easily accessible to our users.
Breaking change: moves OS X command line arguments to standalone script.
Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass