Skip to content

Commit 91022d1

Browse files
committed
fix: use symlink
1 parent 511f94e commit 91022d1

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# OpenPod Specific
2+
openpod.toml
3+
system.json
4+
15
# Byte-compiled / optimized / DLL files
26
__pycache__/
37
*.py[cod]

installer.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ REPO='https://github.com/RecursionSpace/OpenPod'
6363
PYTHON_VERSION='3.11'
6464
VENV_DIR='/opt/OpenPod/venv'
6565
PYTHON_PATH="$VENV_DIR/bin/python"
66+
6667
# ---------------------------------------------------------------------------- #
6768
# Options #
6869
# ---------------------------------------------------------------------------- #
@@ -291,14 +292,6 @@ Type = simple
291292
User = root
292293
WorkingDirectory = /opt/OpenPod
293294
294-
Environment = "OPENPOD_VERSION=$(python${PYTHON_VERSION} -c '
295-
import tomllib
296-
297-
with open("/opt/OpenPod/openpod.toml", "rb") as f:
298-
data = tomllib.load(f)
299-
print(data["openpod"]["version"])
300-
')"
301-
302295
ExecStart=/opt/OpenPod/venv/bin/python /opt/OpenPod/current/pod.py
303296
304297
Restart = always

openpod/pod.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
'''
32
Recursion.Space
43
Email: jmerrell@recursion.space
@@ -13,9 +12,13 @@
1312
import requests
1413
from pubsub import pub
1514

15+
import pod_config
1616
from modules import op_config, op_gpio, op_ssh, rec_log, rec_mqtt, rec_xbee, rec_api, rec_lan
1717
from modules.rec_log import exception_log, zip_send
1818

19+
20+
settings = pod_config.load_config()
21+
1922
# --------------------------- Visualization Threads --------------------------- #
2023
threading.Thread(target=op_gpio.led_stat_thread).start()
2124
threading.Thread(target=op_gpio.led_io_thread).start()
@@ -35,7 +38,7 @@
3538
# Not sure if the next section is required.
3639
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
3740

38-
Version = op_config.get('version', None)
41+
Version = settings['openpod']['version']
3942

4043
# Inserts path to reference then starts importing modules.
4144
sys.path.insert(0, f"./{Version}")
@@ -66,7 +69,7 @@ def incoming_xbee_data():
6669

6770
# ------------------------------- TEMP SOLUTION ------------------------------ #
6871
try:
69-
URL = f'https://{op_config.get("url")}/pod/obtaintoken/{op_config.get("serial")}/'
72+
URL = f'https://{settings["url"]}/pod/obtaintoken/{settings["uuid"]}/'
7073
response = requests.get(URL, timeout=10)
7174

7275
if response.status_code == 201:
@@ -76,7 +79,7 @@ def incoming_xbee_data():
7679
print(err)
7780
# ------------------------------- TEMP SOLUTION ------------------------------ #
7881

79-
if op_config.get('debug', False):
82+
if settings['debug']:
8083
rec_log.publog("debug", "*** DEBUG Enabled ***")
8184

8285
rec_log.publog("info", f"Version: {Version}")
File renamed without changes.

0 commit comments

Comments
 (0)