mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
attempts at dodging pep8 terror
This commit is contained in:
parent
9588fcc5cc
commit
e12cc2fbbf
@ -165,19 +165,22 @@ def install_osx():
|
|||||||
hass_path = os.popen('which hass').read().strip()
|
hass_path = os.popen('which hass').read().strip()
|
||||||
user = os.popen('whoami').read().strip()
|
user = os.popen('whoami').read().strip()
|
||||||
|
|
||||||
plist = codecs.open('scripts/org.home-assistant.plist', 'r', 'utf-8').read()
|
plist = codecs.open('scripts/org.home-assistant.plist', 'r', 'utf-8')
|
||||||
|
plist = plist.read()
|
||||||
|
|
||||||
plist = plist.replace("$APP_PATH$", app_path)
|
plist = plist.replace("$APP_PATH$", app_path)
|
||||||
plist = plist.replace("$HASS_PATH$", hass_path)
|
plist = plist.replace("$HASS_PATH$", hass_path)
|
||||||
plist = plist.replace("$USER$", user)
|
plist = plist.replace("$USER$", user)
|
||||||
|
|
||||||
path = os.path.expanduser("~/Library/LaunchAgents/org.home-assistant.plist")
|
path = os.path.expanduser("~/Library/LaunchAgents/org.home-assistant.plist")
|
||||||
|
os.remove(path)
|
||||||
plist_file = codecs.open(path, 'w', 'utf-8')
|
plist_file = codecs.open(path, 'w', 'utf-8')
|
||||||
plist_file.write(plist)
|
plist_file.write(plist)
|
||||||
plist_file.close()
|
plist_file.close()
|
||||||
os.popen('launchctl load -w -F ' + path)
|
os.popen('launchctl load -w -F ' + path)
|
||||||
|
|
||||||
print("Home Assistant has been installed. Open it here: http://localhost:8123")
|
print("Home Assistant has been installed. \
|
||||||
|
Open it here: http://localhost:8123")
|
||||||
|
|
||||||
|
|
||||||
def uninstall_osx():
|
def uninstall_osx():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user