From 289eebd6a03d0f3e0942dc2440f22c49aaede26e Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 22 Aug 2020 15:33:44 +0200 Subject: [PATCH] Moved definition of workdir inside the constructor, otherwise readthedocs will fail for missing configuration file --- platypush/plugins/tv/samsung/ws.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platypush/plugins/tv/samsung/ws.py b/platypush/plugins/tv/samsung/ws.py index 676c668a0..31af99f1f 100644 --- a/platypush/plugins/tv/samsung/ws.py +++ b/platypush/plugins/tv/samsung/ws.py @@ -19,10 +19,8 @@ class TvSamsungWsPlugin(Plugin): """ - workdir = os.path.join(Config.get('workdir'), 'samsungtvws') - def __init__(self, host: Optional[str] = None, port: int = 8002, timeout: Optional[int] = 5, name='platypush', - token_file: str = os.path.join(workdir, 'token.txt'), **kwargs): + token_file: Optional[str] = None, **kwargs): """ :param host: IP address or host name of the smart TV. :param port: Websocket port (default: 8002). @@ -31,6 +29,10 @@ class TvSamsungWsPlugin(Plugin): :param token_file: Path to the token file (default: ``~/.local/share/platypush/samsungtvws/token.txt``) """ super().__init__(**kwargs) + self.workdir = os.path.join(Config.get('workdir'), 'samsungtvws') + if not token_file: + token_file = os.path.join(self.workdir, 'token.txt') + self.host = host self.port = port self.timeout = timeout