unisi 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unisi/jsoncomparison/compare.py +23 -18
- unisi/proxy.py +2 -2
- unisi/users.py +1 -1
- {unisi-0.1.2.dist-info → unisi-0.1.3.dist-info}/METADATA +9 -9
- {unisi-0.1.2.dist-info → unisi-0.1.3.dist-info}/RECORD +7 -7
- {unisi-0.1.2.dist-info → unisi-0.1.3.dist-info}/WHEEL +0 -0
- {unisi-0.1.2.dist-info → unisi-0.1.3.dist-info}/licenses/LICENSE +0 -0
unisi/jsoncomparison/compare.py
CHANGED
@@ -117,19 +117,21 @@ class Compare:
|
|
117
117
|
return self._config.get(path)
|
118
118
|
|
119
119
|
def _dict_diff(self, e, a):
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
120
|
+
if not isinstance(a, dict):
|
121
|
+
d = {'type' : {'_message': 'Incompatible types'}}
|
122
|
+
else:
|
123
|
+
d = {}
|
124
|
+
for k in e:
|
125
|
+
if k not in a:
|
126
|
+
d[k] = KeyNotExist(k, None).explain()
|
127
|
+
else:
|
128
|
+
d[k] = self._diff(e[k], a[k])
|
129
|
+
|
130
|
+
for k in a:
|
131
|
+
if k not in e:
|
132
|
+
d[k] = UnexpectedKey(None, k).explain()
|
133
|
+
else:
|
134
|
+
d[k] = self._diff(e[k], a[k])
|
133
135
|
|
134
136
|
diffs = self._without_empties(d)
|
135
137
|
if diffs:
|
@@ -139,11 +141,14 @@ class Compare:
|
|
139
141
|
return diffs
|
140
142
|
|
141
143
|
def _list_diff(self, e, a):
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
144
|
+
if not isinstance(a, list):
|
145
|
+
d = {'type' : {'_message': 'Incompatible types'}}
|
146
|
+
else:
|
147
|
+
d = {}
|
148
|
+
if self._need_compare_length():
|
149
|
+
d['_length'] = self._list_len_diff(e, a)
|
150
|
+
d['_content'] = self._list_content_diff(e, a)
|
151
|
+
return self._without_empties(d)
|
147
152
|
|
148
153
|
def _need_compare_length(self):
|
149
154
|
path = 'types.list.check_length'
|
unisi/proxy.py
CHANGED
@@ -40,7 +40,7 @@ class Proxy:
|
|
40
40
|
|
41
41
|
def close(self):
|
42
42
|
self.conn.close()
|
43
|
-
|
43
|
+
|
44
44
|
@property
|
45
45
|
def screen_menu(self):
|
46
46
|
return [name_icon[0] for name_icon in self.screen['menu']] if self.screen else []
|
@@ -66,7 +66,7 @@ class Proxy:
|
|
66
66
|
if el == element:
|
67
67
|
return block
|
68
68
|
|
69
|
-
def message(self, element, value, event = 'changed'):
|
69
|
+
def message(self, element, value = None, event = 'changed'):
|
70
70
|
if event != 'changed' and event not in element:
|
71
71
|
return None
|
72
72
|
return ArgObject(block = self.block_of(element), element = element['name'],
|
unisi/users.py
CHANGED
@@ -175,7 +175,7 @@ class User:
|
|
175
175
|
|
176
176
|
def process(self, message):
|
177
177
|
self.last_message = message
|
178
|
-
screen_change_message = message
|
178
|
+
screen_change_message = getattr(message, 'screen',None) and self.screen.name != message.screen
|
179
179
|
if is_screen_switch(message) or screen_change_message:
|
180
180
|
for s in self.screens:
|
181
181
|
if s.name == message.value:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unisi
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.3
|
4
4
|
Summary: UNified System Interface, GUI and proxy
|
5
5
|
Author-Email: UNISI Tech <g.dernovoy@gmail.com>
|
6
6
|
License: Apache-2.0
|
@@ -28,8 +28,9 @@ UNISI technology provides a unified system interface and advanced program functi
|
|
28
28
|
- Hot reloading and updating
|
29
29
|
- Integral autotesting
|
30
30
|
- Protocol schema auto validation
|
31
|
+
- Shared sessions
|
31
32
|
- Voice interaction (not released yet)
|
32
|
-
- Remote interaction and
|
33
|
+
- Remote GUI interaction and pipelining (not released yet)
|
33
34
|
|
34
35
|
### Installing ###
|
35
36
|
```
|
@@ -86,7 +87,7 @@ unisi.start('Test app')
|
|
86
87
|
Unisi builds the interactive app for the code above.
|
87
88
|
Connect a browser to localhast:8000 which are by default and will see:
|
88
89
|
|
89
|
-

|
90
91
|
|
91
92
|
### Handling events ###
|
92
93
|
All handlers are functions which have a signature
|
@@ -111,7 +112,7 @@ clean_button = Button('Clean the table’, clean_table)
|
|
111
112
|
| Gui object | Object to update |
|
112
113
|
| Gui object array or tuple | Objects to update |
|
113
114
|
| None | Nothing to update, Ok |
|
114
|
-
| Error(...), Warning(...), Info(...) | Show to user info about a
|
115
|
+
| Error(...), Warning(...), Info(...) | Show to user info about a state. |
|
115
116
|
| UpdateScreen, True | Redraw whole screen |
|
116
117
|
| Dialog(..) | Open a dialog with parameters |
|
117
118
|
| user.set_screen(screen_name) | switch to another screen |
|
@@ -124,12 +125,11 @@ If a Gui object doesn't have 'changed' handler the object accepts incoming value
|
|
124
125
|
If 'value' is not acceptable instead of returning an object possible to return Error or Warning or Info. That functions can update a object list passed after the message argument.
|
125
126
|
|
126
127
|
```
|
127
|
-
def changed_range(
|
128
|
-
if value < 0.5 and value > 1.0:
|
129
|
-
|
130
|
-
return Error(f‘The value of {_.name} has to be > 0.5 and < 1.0!', _)
|
128
|
+
def changed_range(guirange, value):
|
129
|
+
if value < 0.5 and value > 1.0:
|
130
|
+
return Error(f‘The value of {guirange.name} has to be > 0.5 and < 1.0!', guirange)
|
131
131
|
#accept value othewise
|
132
|
-
|
132
|
+
guirange.value = value
|
133
133
|
|
134
134
|
edit = Edit('Range of involving', 0.6, changed_range, type = 'number')
|
135
135
|
```
|
@@ -1,21 +1,21 @@
|
|
1
|
-
unisi-0.1.
|
2
|
-
unisi-0.1.
|
3
|
-
unisi-0.1.
|
1
|
+
unisi-0.1.3.dist-info/METADATA,sha256=pYm__IDa4WqrhosAznrglBGaXw1Ryd-zIF821ajKGrc,18539
|
2
|
+
unisi-0.1.3.dist-info/WHEEL,sha256=N2J68yzZqJh3mI_Wg92rwhw0rtJDFpZj9bwQIMJgaVg,90
|
3
|
+
unisi-0.1.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
4
4
|
unisi/__init__.py,sha256=bQ7yTDcgybkbIGTjxkajTbBJXtgyryrCvt3nXg8QxlQ,175
|
5
5
|
unisi/autotest.py,sha256=K_ev2UcUdMwt6YwK-ueOPavX6ikHylldIF81v05e95o,9397
|
6
6
|
unisi/common.py,sha256=oQJdUHVIf3QEMlnRSY_FW-ce4oDb7xcmzOhHByKGC7w,753
|
7
7
|
unisi/containers.py,sha256=_oB1KknoHAslpmVHY_dpX4uOcKtP5Pelqdv9fMjotHo,3403
|
8
8
|
unisi/guielements.py,sha256=SVfAU9zrGMdzuU3Ip0dAnaPyJSmwoOaozn3LLNW0tkQ,5384
|
9
9
|
unisi/jsoncomparison/__init__.py,sha256=lsWkYEuL6v3Qol-lwSUvB6y63tm6AKcCMUd4DZDx3Cg,350
|
10
|
-
unisi/jsoncomparison/compare.py,sha256=
|
10
|
+
unisi/jsoncomparison/compare.py,sha256=XlJqeNaj_zmiD-x_Rz_9R2RYkDd7JCOzojoFtIsrBVU,6158
|
11
11
|
unisi/jsoncomparison/config.py,sha256=LbdLJE1KIebFq_tX7zcERhPvopKhnzcTqMCnS3jN124,381
|
12
12
|
unisi/jsoncomparison/errors.py,sha256=wqphE1Xn7K6n16uvUhDC45m2BxbsMUhIF2olPbhqf4o,1192
|
13
13
|
unisi/jsoncomparison/ignore.py,sha256=xfF0a_BBEyGdZBoq-ovpCpawgcX8SRwwp7IrGnu1c2w,2634
|
14
|
-
unisi/proxy.py,sha256=
|
14
|
+
unisi/proxy.py,sha256=bbuuOitToR-hmy5wQ6sqnJChze0ZuqKr1eHWyhGWXIY,5739
|
15
15
|
unisi/reloader.py,sha256=MkmN6mDclrdzuO5I4Hu_GGjOyl-icnJ-IdwyNW8xEYs,6424
|
16
16
|
unisi/server.py,sha256=SKN38DjuxZ0U_FjBJDuwnpDP2YfZorpIJrjrADhqf5w,4521
|
17
17
|
unisi/tables.py,sha256=v7Fio5iIN7u1t7cE4Yvl4ewn7jTmmNPyWigoKW1Mj8U,4239
|
18
|
-
unisi/users.py,sha256=
|
18
|
+
unisi/users.py,sha256=B3Ouj-Ygx9BYU64JtE_HM4yApIZ7ikVeH2v86Lr1rSA,9819
|
19
19
|
unisi/utils.py,sha256=KnyjouXGnN8ubuwogMa1tu2HJSkmDqhuFf7RpU3n9bY,2971
|
20
20
|
unisi/web/css/815.30ec41a2.css,sha256=b8La7chOFF3VPd-kqAbwP-Cx8jMzkgZCbYsMXR2mhKI,2723
|
21
21
|
unisi/web/css/app.31d6cfe0.css,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -39,4 +39,4 @@ unisi/web/js/430.591e9a73.js,sha256=7S1CJTwGdE2EKXzeFRcaYuTrn0QteoVI03Hykz8qh3s,
|
|
39
39
|
unisi/web/js/815.e46226ff.js,sha256=xpfhA0GvPjvracUep66rqrKLCho-Muiw1N8nr9QzDNc,55923
|
40
40
|
unisi/web/js/app.29d640d6.js,sha256=v_u_Q9vvmrgTj7-4CdpB8yQOl19a-FC6YVCXnSyTfec,5923
|
41
41
|
unisi/web/js/vendor.d6797c01.js,sha256=2aKM3Lfxc0pHSirrcUReL1LcvDYWnfeBj2c67XsSELk,1279477
|
42
|
-
unisi-0.1.
|
42
|
+
unisi-0.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|