summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ausbutler/goniec.py14
-rw-r--r--config/goniec.json5
2 files changed, 19 insertions, 0 deletions
diff --git a/ausbutler/goniec.py b/ausbutler/goniec.py
new file mode 100644
index 0000000..ed2dd3f
--- /dev/null
+++ b/ausbutler/goniec.py
@@ -0,0 +1,14 @@
+from .tour_config import Constants
+import socket
+
+class Goniec(object):
+ def __init__(self, config):
+ self.config = config
+
+ def send(self, files=[]):
+ if self.config['enabled']:
+ content_lines = [Constants.path] + files + ['bye', '']
+ goniec = socket.socket()
+ goniec.connect((self.config['host'], self.config['port']))
+ goniec.sendall('\n'.join(content_lines))
+ goniec.close()
diff --git a/config/goniec.json b/config/goniec.json
new file mode 100644
index 0000000..7672e42
--- /dev/null
+++ b/config/goniec.json
@@ -0,0 +1,5 @@
+{
+ "enabled": 1,
+ "host": "localhost",
+ "port": 8090
+}