summaryrefslogtreecommitdiff
path: root/ausbutler/goniec.py
diff options
context:
space:
mode:
Diffstat (limited to 'ausbutler/goniec.py')
-rw-r--r--ausbutler/goniec.py14
1 files changed, 14 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()