commit 190e34accf48649bb03d43c6d5e0d5eb8a9eda32
parent 65ca99be34bdd7887754faf6493854e0df82cdb0
Author: Daniel Barlow <dan@telent.net>
Date: Fri, 6 Mar 2026 19:54:36 +0000
make output path configurable
Diffstat:
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/client.conf b/client.conf
@@ -1,3 +1,4 @@
BlePrivateKeyFile=keys/client.key
BlePeerKeyFile=keys/device.pub
OtaPrivateKeyFile=privkey.bin
+OutputPath=/tmp/eculocate
diff --git a/client/eculocate.py b/client/eculocate.py
@@ -45,9 +45,11 @@ class Config():
self._ota_private_key = None
def ble_private_key(self):
+ # FIXME unimplemented
pathname = self.config.get(configparser.UNNAMED_SECTION, 'BlePrivateKeyFile')
def ble_peer_key(self):
+ # FIXME unimplemented
pathname = self.config.get(configparser.UNNAMED_SECTION, 'BlePeerKeyFile')
def ota_private_key(self):
@@ -58,11 +60,18 @@ class Config():
return self._ota_private_key
+ def output_path(self):
+ pathname = Path(self.config.get(configparser.UNNAMED_SECTION, 'OutputPath'))
+ pathname.mkdir(0o777, False, True)
+ return pathname
+
class Client():
def __init__(self, config):
self.selected_service_name = None
self.bytes_recorded = 0
self.private_key = config.ota_private_key()
+ name = f"{int(time.time())}.raw"
+ self._output_pathname = config.output_path() / name
self.started = False
self.host_addresses = {}
@@ -73,14 +82,7 @@ class Client():
return not (not (self.host_addresses.get(servicename, False)))
def output_pathname(self):
- dir = os.getenv("ECULOCATE_STORAGE")
- if dir:
- dir = Path(dir)
- else:
- dir = Path("/storage") / "emulated" / "0" / "eculocate"
- dir.mkdir(0o777, False, True)
- name = f"{int(time.time())}.raw"
- return dir / name
+ return self._output_pathname
def recording_thread_main(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)