-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpywebostv.diff
75 lines (64 loc) · 2.29 KB
/
pywebostv.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
diff -Naur connection.py connection.py
--- connection.py 1900-01-00 00:00:00 +0000
+++ connection.py 1900-01-00 00:00:00 +0000
@@ -137,7 +137,7 @@
REGISTERED = 2
def __init__(self, host):
- ws_url = "ws://{}:3000/".format(host)
+ ws_url = "ws://{0}:3000/".format(host)
super(WebOSClient, self).__init__(ws_url)
self.waiters = {}
self.waiter_lock = RLock()
diff -Naur controls.py controls.py
--- controls.py 1900-01-00 00:00:00 +0000
+++ controls.py 1900-01-00 00:00:00 +0000
@@ -5,7 +5,7 @@
# after try for python >= 3.10
from typing import Callable
-from queue import Empty
+from Queue import Empty
from uuid import uuid4
from pywebostv.connection import WebOSWebSocketClient
@@ -39,7 +39,10 @@
if isinstance(obj, list):
return [process_payload(item, *args, **kwargs) for item in obj]
elif isinstance(obj, dict):
- return {k: process_payload(v, *args, **kwargs) for k, v in obj.items()}
+ _ = {}
+ for k, v in obj.items():
+ _[k] = process_payload(v, *args, **kwargs)
+ return _
elif isinstance(obj, Callable):
return obj(*args, **kwargs)
else:
diff -Naur discovery.py discovery.py
--- discovery.py 1900-01-00 00:00:00 +0000
+++ discovery.py 1900-01-00 00:00:00 +0000
@@ -64,6 +64,6 @@
break
if hosts:
- return {urlparse(x).hostname for x in locations}
+ return set(urlparse(x).hostname for x in locations)
else:
- return {x for x in locations}
+ return set(x for x in locations)
diff -Naur model.py model.py
--- model.py 1900-01-00 00:00:00 +0000
+++ model.py 1900-01-00 00:00:00 +0000
@@ -7,7 +7,7 @@
return self.data[val]
def __repr__(self):
- return "<Application '{}'>".format(self["title"])
+ return "<Application '{0}'>".format(self["title"])
class InputSource(object):
@@ -19,7 +19,7 @@
return self.data[val]
def __repr__(self):
- return "<InputSource '{}'>".format(self["label"])
+ return "<InputSource '{0}'>".format(self["label"])
class AudioOutputSource(object):
@@ -27,4 +27,4 @@
self.data = data
def __repr__(self):
- return "<AudioOutputSource '{}'>".format(self.data)
+ return "<AudioOutputSource '{0}'>".format(self.data)