From 50739c687d9252ab7d5c851bf32a1fd056f6544d Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Tue, 5 Jan 2016 19:38:42 +0100 Subject: add cut-button and a cutlist-script and make both configurable --- example-scripts/control-server/generate-cut-list.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 example-scripts/control-server/generate-cut-list.py (limited to 'example-scripts') 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) -- cgit v1.2.3