Add url format as optional argument
This commit is contained in:
parent
6d24f08924
commit
4933caa6a9
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue