summaryrefslogtreecommitdiff
path: root/ausbutler
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-01-06 01:06:17 +0100
committeremkael <emkael@tlen.pl>2017-01-06 01:06:17 +0100
commit287ea6575c67e540f61ca930a8535d982409c232 (patch)
treeef599a949a820ad29811654f0e7a9831cba70a35 /ausbutler
parent91de8dda2605b4d0f362e25c60958c10200f880b (diff)
Goniec client
Diffstat (limited to 'ausbutler')
-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()