From 7e1947bd04fa20a1c244a06f0cc370e13a270445 Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 10 May 2016 16:54:18 +0200 Subject: [PATCH] Move room format string to connection class --- yaboli/connection.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/yaboli/connection.py b/yaboli/connection.py index 838cc06..672a048 100644 --- a/yaboli/connection.py +++ b/yaboli/connection.py @@ -6,10 +6,6 @@ from websocket import WebSocketException as WSException from . import callbacks - -ROOM_FORMAT = "wss://euphoria.io/room/{}/ws" - - class Connection(): """ Stays connected to a room in its own thread. @@ -24,13 +20,18 @@ class Connection(): - "stop" """ - def __init__(self, room, url_format=ROOM_FORMAT): + ROOM_FORMAT = "wss://euphoria.io/room/{}/ws" + + def __init__(self, room, url_format=None): """ room - name of the room to connect to """ self.room = room + + if not url_format: + url_format = self.ROOM_FORMAT self._url = url_format.format(self.room) self._stopping = False