mirror of
https://github.com/home-assistant/core
synced 2024-08-02 23:40:32 +02:00
indention
This commit is contained in:
parent
acb288f9e7
commit
bb172d8c98
@ -163,16 +163,16 @@ def write_pid(pid_file):
|
|||||||
def install_osx():
|
def install_osx():
|
||||||
""" Setup to run via launchd on OS X """
|
""" Setup to run via launchd on OS X """
|
||||||
with os.popen('which hass') as inp:
|
with os.popen('which hass') as inp:
|
||||||
hass_path = inp.read().strip()
|
hass_path = inp.read().strip()
|
||||||
|
|
||||||
with os.popen('whoami') as inp:
|
with os.popen('whoami') as inp:
|
||||||
user = inp.read().strip()
|
user = inp.read().strip()
|
||||||
|
|
||||||
cwd = os.path.dirname(__file__)
|
cwd = os.path.dirname(__file__)
|
||||||
template_path = os.path.join(cwd, 'startup', 'launchd.plist')
|
template_path = os.path.join(cwd, 'startup', 'launchd.plist')
|
||||||
|
|
||||||
with open(template_path, 'r', encoding='utf-8') as inp:
|
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("$HASS_PATH$", hass_path)
|
||||||
plist = plist.replace("$USER$", user)
|
plist = plist.replace("$USER$", user)
|
||||||
@ -181,7 +181,7 @@ def install_osx():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
with open(path, 'w', encoding='utf-8') as outp:
|
with open(path, 'w', encoding='utf-8') as outp:
|
||||||
outp.write(plist)
|
outp.write(plist)
|
||||||
except IOError as err:
|
except IOError as err:
|
||||||
print('Unable to write to ' + path, err)
|
print('Unable to write to ' + path, err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user