From 4933caa6a92733ee29b74125d8f0657fc7328a5d Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 9 May 2016 22:17:16 +0200 Subject: [PATCH] Add url format as optional argument --- yaboli/connection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yaboli/connection.py b/yaboli/connection.py index a726e69..838cc06 100644 --- a/yaboli/connection.py +++ b/yaboli/connection.py @@ -24,12 +24,14 @@ class Connection(): - "stop" """ - def __init__(self, room): + def __init__(self, room, url_format=ROOM_FORMAT): """ room - name of the room to connect to + """ self.room = room + self._url = url_format.format(self.room) self._stopping = False @@ -54,7 +56,7 @@ class Connection(): while tries != 0: try: self._ws = websocket.create_connection( - ROOM_FORMAT.format(self.room), + self._url, enable_multithread=True )