summaryrefslogtreecommitdiff
path: root/example-scripts/control-server
diff options
context:
space:
mode:
Diffstat (limited to 'example-scripts/control-server')
-rwxr-xr-xexample-scripts/control-server/generate-cut-list.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/example-scripts/control-server/generate-cut-list.py b/example-scripts/control-server/generate-cut-list.py
new file mode 100755
index 0000000..305ef83
--- /dev/null
+++ b/example-scripts/control-server/generate-cut-list.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python3
+import socket
+import datetime
+
+host = 'localhost'
+port = 9999
+
+conn = socket.create_connection( (host, port) )
+fd = conn.makefile('rw')
+
+for line in fd:
+ words = line.rstrip('\n').split(' ')
+
+ signal = words[0]
+ args = words[1:]
+
+ if signal == 'message' and args[0] == 'cut':
+ ts = datetime.datetime.now().strftime("%Y-%m-%d/%H_%M_%S")
+ print(ts)