summaryrefslogtreecommitdiff
path: root/ausbutler/goniec.py
blob: 247c5f8c3ef0bd8c91067cc4cc5e655946ea7f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import socket

from .tour_config import Constants


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()