install script removed
This commit is contained in:
parent
e5a585dfa2
commit
1cf5094bfd
16
.vscode/launch.json
vendored
Normal file
16
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
|
||||||
|
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
|
||||||
|
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Python: Main File execution",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/ambient_info.py",
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"justMyCode": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
14
.vscode/settings.json
vendored
Normal file
14
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"python.defaultInterpreterPath": "./venv/bin/python",
|
||||||
|
"autopep8.args": ["--max-line-length=150"],
|
||||||
|
"[python]": {
|
||||||
|
"python.formatting.provider": "none",
|
||||||
|
"editor.defaultFormatter": "ms-python.autopep8",
|
||||||
|
"editor.formatOnSave": true
|
||||||
|
},
|
||||||
|
"editor.fontSize": 14,
|
||||||
|
"emmet.includeLanguages": { "django-html": "html" },
|
||||||
|
"python.testing.pytestArgs": ["-v", "--cov", "--cov-report=xml", "__test__"],
|
||||||
|
"python.testing.unittestEnabled": false,
|
||||||
|
"python.testing.pytestEnabled": true
|
||||||
|
}
|
@ -1,41 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
#
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
SERVICE_FILE = """
|
|
||||||
[Unit]
|
|
||||||
Description=Smarthome Ambient Information Service
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
[Service]
|
|
||||||
User=%(UID)d
|
|
||||||
Group=%(GID)d
|
|
||||||
ExecStart=%(MY_PATH)s/ambient_info.sh
|
|
||||||
Type=simple
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
def help():
|
|
||||||
print("Usage: prog <UID> <GID> <TARGET_PATH>")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
if len(sys.argv) == 4:
|
|
||||||
try:
|
|
||||||
uid = int(sys.argv[1])
|
|
||||||
gid = int(sys.argv[2])
|
|
||||||
except ValueError:
|
|
||||||
help()
|
|
||||||
else:
|
|
||||||
if os.path.isdir(sys.argv[3]):
|
|
||||||
with open(os.path.join(sys.argv[3], 'ambient_info.service'), "w") as fh:
|
|
||||||
fh.write(SERVICE_FILE % {
|
|
||||||
"MY_PATH": os.path.dirname(os.path.abspath(__file__)),
|
|
||||||
"UID": uid,
|
|
||||||
"GID": gid})
|
|
||||||
else:
|
|
||||||
help()
|
|
||||||
else:
|
|
||||||
help()
|
|
Loading…
x
Reference in New Issue
Block a user