diff options
| author | 2019-10-17 12:39:56 +0100 | |
|---|---|---|
| committer | 2019-10-17 12:39:56 +0100 | |
| commit | 417c4f302e334d0a2bc4a33496625eae6d0d8cc9 (patch) | |
| tree | 4b1235d0e98182516a354852740893415b2dd685 /src/Control.py | |
| parent | we should be showing 'title' (not 'description') for gitlab issue events (diff) | |
| signature | ||
default to using a "data directory" for bitbot (~/.bitbot/)
Diffstat (limited to 'src/Control.py')
| -rw-r--r-- | src/Control.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Control.py b/src/Control.py index b57c9048..57f48ea4 100644 --- a/src/Control.py +++ b/src/Control.py @@ -39,11 +39,11 @@ class ControlClient(object): class Control(PollSource.PollSource): - def __init__(self, bot: IRCBot.Bot, database_location: str): + def __init__(self, bot: IRCBot.Bot, filename: str): self._bot = bot self._bot.log.hook(self._on_log) - self._socket_location = "%s.sock" % database_location + self._filename = filename self._socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self._clients = {} @@ -53,9 +53,9 @@ class Control(PollSource.PollSource): self._send_action(client, "log", line) def bind(self): - if os.path.exists(self._socket_location): - os.remove(self._socket_location) - self._socket.bind(self._socket_location) + if os.path.exists(self._filename): + os.remove(self._filename) + self._socket.bind(self._filename) self._socket.listen(1) def get_readables(self) -> typing.List[int]: |
