1
mirror of https://github.com/home-assistant/core synced 2024-07-09 04:58:30 +02:00

indention

This commit is contained in:
Jon Maddox 2015-09-15 02:58:13 -04:00
parent acb288f9e7
commit bb172d8c98

View File

@ -163,16 +163,16 @@ def write_pid(pid_file):
def install_osx():
""" Setup to run via launchd on OS X """
with os.popen('which hass') as inp:
hass_path = inp.read().strip()
hass_path = inp.read().strip()
with os.popen('whoami') as inp:
user = inp.read().strip()
user = inp.read().strip()
cwd = os.path.dirname(__file__)
template_path = os.path.join(cwd, 'startup', 'launchd.plist')
with open(template_path, 'r', encoding='utf-8') as inp:
plist = inp.read()
plist = inp.read()
plist = plist.replace("$HASS_PATH$", hass_path)
plist = plist.replace("$USER$", user)
@ -181,7 +181,7 @@ def install_osx():
try:
with open(path, 'w', encoding='utf-8') as outp:
outp.write(plist)
outp.write(plist)
except IOError as err:
print('Unable to write to ' + path, err)
return