diff --git a/obswebsocket/__init__.py b/obswebsocket/__init__.py index 7293113..1608352 100644 --- a/obswebsocket/__init__.py +++ b/obswebsocket/__init__.py @@ -11,4 +11,4 @@ __all__ = ["obsws", "events", "requests"] -VERSION = "1.0" +VERSION = "1.1beta1" diff --git a/obswebsocket/core.py b/obswebsocket/core.py index b65ee9e..561b441 100644 --- a/obswebsocket/core.py +++ b/obswebsocket/core.py @@ -81,7 +81,7 @@ def connect(self): self.ws = websocket.WebSocket() url = "ws://{}:{}".format(self.host, self.port) LOG.info("Connecting to %s..." % (url)) - self.ws.connect(url) + self.ws.connect(url, timeout=self.timeout) LOG.info("Connected!") if self.legacy: self._auth_legacy() diff --git a/setup.py b/setup.py index add31b1..8de708f 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,16 @@ #!/usr/bin/env python3 - +import os, re from distutils.core import setup -from obswebsocket import VERSION + +def read_version(): + version_file = os.path.join(os.path.dirname(__file__), "obswebsocket", "__init__.py") + with open(version_file, "r") as f: + content = f.read() + match = re.search(r'^VERSION\s*=\s*["\']([^"\']+)["\']', content, re.MULTILINE) + if match: + return match.group(1) + +VERSION=read_version() # Convert README from Markdown to reStructuredText description = "Please take a look at README.md"