]> git.gag.com Git - fw/quantimotor/commitdiff
use smarter approach to escaping command strings for os.system
authorBdale Garbee <bdale@gag.com>
Tue, 27 May 2025 18:17:06 +0000 (12:17 -0600)
committerBdale Garbee <bdale@gag.com>
Tue, 27 May 2025 18:17:06 +0000 (12:17 -0600)
ui/app.py

index 14bdaee0e375139b1c8f8a09308682adee4bb057..81cdcf61b52d9ce153192fc19f5161a5a81fd5ac 100755 (executable)
--- a/ui/app.py
+++ b/ui/app.py
@@ -318,7 +318,7 @@ def runatest():
   global ctx
 
   # turn triggered buffering on
-  os.system("echo 1 > /sys/bus/iio/devices/iio\:device0/buffer0/enable")
+  os.system(shlex.quote("echo 1 > /sys/bus/iio/devices/iio:device0/buffer0/enable"))
 
   # create data logging thread
   loggertask = DataReader(ctx)
@@ -345,7 +345,7 @@ def endatest():
   pyrotask.join()
 
   # turn triggered buffering off so low speed iio actions work while idle
-  os.system("echo 0 > /sys/bus/iio/devices/iio\:device0/buffer0/enable")
+  os.system(shlex.quote("echo 0 > /sys/bus/iio/devices/iio:device0/buffer0/enable"))
   status = "idle"