unisi 0.1.0__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/__init__.py +7 -0
- unisi/autotest.py +210 -0
- unisi/common.py +28 -0
- unisi/containers.py +97 -0
- unisi/guielements.py +160 -0
- unisi/proxy.py +159 -0
- unisi/reloader.py +150 -0
- unisi/server.py +118 -0
- unisi/tables.py +116 -0
- unisi/users.py +271 -0
- unisi/utils.py +108 -0
- unisi/web/css/169.3abcdd94.css +1 -0
- unisi/web/css/app.31d6cfe0.css +0 -0
- unisi/web/css/vendor.9ed7638d.css +6 -0
- unisi/web/favicon.ico +0 -0
- unisi/web/fonts/KFOkCnqEu92Fr1MmgVxIIzQ.68bb21d0.woff +0 -0
- unisi/web/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.48af7707.woff +0 -0
- unisi/web/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.c2f7ab22.woff +0 -0
- unisi/web/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.77ecb942.woff +0 -0
- unisi/web/fonts/KFOlCnqEu92Fr1MmYUtfBBc-.f5677eb2.woff +0 -0
- unisi/web/fonts/KFOmCnqEu92Fr1Mu4mxM.f1e2a767.woff +0 -0
- unisi/web/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.4d73cb90.woff +0 -0
- unisi/web/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.c5371cfb.woff2 +0 -0
- unisi/web/icons/favicon-128x128.png +0 -0
- unisi/web/icons/favicon-16x16.png +0 -0
- unisi/web/icons/favicon-32x32.png +0 -0
- unisi/web/icons/favicon-96x96.png +0 -0
- unisi/web/index.html +1 -0
- unisi/web/js/169.f952e294.js +1 -0
- unisi/web/js/193.283445be.js +1 -0
- unisi/web/js/430.591e9a73.js +1 -0
- unisi/web/js/app.ba94719f.js +1 -0
- unisi/web/js/vendor.d6797c01.js +45 -0
- unisi-0.1.0.dist-info/METADATA +422 -0
- unisi-0.1.0.dist-info/RECORD +37 -0
- unisi-0.1.0.dist-info/WHEEL +4 -0
- unisi-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,422 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: unisi
|
3
|
+
Version: 0.1.0
|
4
|
+
Summary: UNified System Interface, GUI and proxy
|
5
|
+
Author-Email: UNISI Tech <g.dernovoy@gmail.com>
|
6
|
+
License: Apache-2.0
|
7
|
+
Project-URL: Homepage, https://github.com/unisi-tech/unisi
|
8
|
+
Requires-Python: >=3.10
|
9
|
+
Requires-Dist: aiohttp
|
10
|
+
Requires-Dist: jsoncomparison
|
11
|
+
Requires-Dist: jsonpickle
|
12
|
+
Requires-Dist: pandas
|
13
|
+
Requires-Dist: requests
|
14
|
+
Requires-Dist: watchdog
|
15
|
+
Requires-Dist: websockets
|
16
|
+
Description-Content-Type: text/markdown
|
17
|
+
|
18
|
+
# UNISI #
|
19
|
+
UNified System Interface and GUI
|
20
|
+
|
21
|
+
### Purpose ###
|
22
|
+
UNISI technology provides a unified system interface and advanced program functionality, eliminating the need for front-end and most back-end programming. It automates common tasks, as well as unique ones, significantly reducing the necessity for manual programming and effort.
|
23
|
+
|
24
|
+
### Provided functionality without programming ###
|
25
|
+
-Automatic WEB interface
|
26
|
+
-Unified interaction protocol support
|
27
|
+
-Automatic configuring
|
28
|
+
-Multi-user support
|
29
|
+
-Hot reloading and updating
|
30
|
+
-Integral autotesting
|
31
|
+
-Protocol schema auto validation
|
32
|
+
-Voice interaction (not released yet)
|
33
|
+
-Developing data pipelines (not released yet)
|
34
|
+
|
35
|
+
### Installing ###
|
36
|
+
```
|
37
|
+
pip install unisi
|
38
|
+
```
|
39
|
+
|
40
|
+
### How it works inside ###
|
41
|
+
The server sends protocol data to the front-end UNISI which has built-in tools (autodesigner) and automatically builds a standart Google Material Design GUI for the user data. No markup, drawing instructions and the other dull job are required. From the constructed Unisi screen the server receives a JSON message flow which fully describes what the user did. The message format is {screen, block, element, event, value}, "value" is the JSON value of the action/event that has happened. The server can either accept the change or roll it back by sending an info window about an inconsistency. The server can open a dialog box, send popup Warning, Error,.. or an entirely new screen. Unisi instantly and automatically displays actual server state.
|
42
|
+
|
43
|
+
### Programming ###
|
44
|
+
This repo explains how to work with Unisi using Python and the tiny but optimal framework for that. Unisi web version is included in this library. Supports Python 3.10 and up.
|
45
|
+
|
46
|
+
|
47
|
+
### High level - Screen ###
|
48
|
+
The program directory has to contain a screens folder which contains all screens which Unisi has to show.
|
49
|
+
|
50
|
+
Screen example tests/screens/main.py
|
51
|
+
```
|
52
|
+
name = "Main"
|
53
|
+
blocks = [block]
|
54
|
+
```
|
55
|
+
The block example with a table and a selector
|
56
|
+
```
|
57
|
+
table = Table('Videos', 0, headers = ['Video', 'Duration', 'Links', 'Mine'],rows = [
|
58
|
+
['opt_sync1_3_0.mp4', '30 seconds', '@Refer to signal1', True],
|
59
|
+
['opt_sync1_3_0.mp4', '37 seconds', '@Refer to signal8', False]
|
60
|
+
])
|
61
|
+
#widgets are groped in a block (complex widget)
|
62
|
+
block = Block('X Block',
|
63
|
+
[
|
64
|
+
Button('Clean table', icon = 'swipe'),
|
65
|
+
Select('Select', value='All', options=['All','Based','Group'])
|
66
|
+
], table, icon = 'api')
|
67
|
+
```
|
68
|
+
|
69
|
+
| Screen global variables | Status | Type | Description |
|
70
|
+
| :---: | :---: | :---: | :---: |
|
71
|
+
| name | Has to be defined | str | Unique screen name |
|
72
|
+
| blocks | Has to be defined | list |which blocks to show on the screen |
|
73
|
+
| user | Always defined, read-only | User+ | Access to User(inherited) class which associated with a current user |
|
74
|
+
| header | Optional | str | show it instead of app name |
|
75
|
+
| toolbar | Optional | list | Gui elements to show in the screen toolbar |
|
76
|
+
| order | Optional | int | order in the program menu |
|
77
|
+
| icon | Optional | str | MD icon of screen to show in the screen menu |
|
78
|
+
| prepare | Optional | def prepare() | Syncronizes GUI elements one to another and with the program/system data. If defined then is called before screen appearing. |
|
79
|
+
|
80
|
+
|
81
|
+
### Server start ###
|
82
|
+
tests/template/run.py
|
83
|
+
```
|
84
|
+
import unisi
|
85
|
+
unisi.start('Test app')
|
86
|
+
```
|
87
|
+
Unisi builds the interactive app for the code above.
|
88
|
+
Connect a browser to localhast:8000 which are by default and will see:
|
89
|
+
|
90
|
+

|
91
|
+
|
92
|
+
### Handling events ###
|
93
|
+
All handlers are functions which have a signature
|
94
|
+
```
|
95
|
+
def handler_x(gui_object, value_x)
|
96
|
+
```
|
97
|
+
where gui_object is a Python object the user interacted with and value for the event.
|
98
|
+
|
99
|
+
All Gui objects except Button have a field ‘value’.
|
100
|
+
For an edit field the value is a string or number, for a switch or check button the value is boolean, for table is row id or index, e.t.c.
|
101
|
+
When a user changes the value of the Gui object or presses Button, the server calls the ‘changed’ function handler.
|
102
|
+
|
103
|
+
```
|
104
|
+
def clean_table(_, value):
|
105
|
+
table.rows = []
|
106
|
+
return table
|
107
|
+
clean_button = Button('Clean the table’, clean_table)
|
108
|
+
```
|
109
|
+
|
110
|
+
| Handler returns | Description |
|
111
|
+
| :---: | :---: |
|
112
|
+
| Gui object | Object to update |
|
113
|
+
| Gui object array or tuple | Objects to update |
|
114
|
+
| None | Nothing to update, Ok |
|
115
|
+
| Error(...), Warning(...), Info(...) | Show to user info about a problem. |
|
116
|
+
| UpdateScreen, True | Redraw whole screen |
|
117
|
+
| Dialog(..) | Open a dialog with parameters |
|
118
|
+
| user.set_screen(screen_name) | switch to another screen |
|
119
|
+
|
120
|
+
|
121
|
+
Unisi synchronizes GUI state on frontend-end automatically after calling a handler.
|
122
|
+
|
123
|
+
If a Gui object doesn't have 'changed' handler the object accepts incoming value automatically to the 'value' variable of gui object.
|
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.
|
126
|
+
|
127
|
+
```
|
128
|
+
def changed_range(_, value):
|
129
|
+
if value < 0.5 and value > 1.0:
|
130
|
+
#or Error(message, _) if we want to return the previous visible value to the field, return gui object _ also.
|
131
|
+
return Error(f‘The value of {_.name} has to be > 0.5 and < 1.0!', _)
|
132
|
+
#accept value othewise
|
133
|
+
_.value = value
|
134
|
+
|
135
|
+
edit = Edit('Range of involving', 0.6, changed_range, type = 'number')
|
136
|
+
```
|
137
|
+
|
138
|
+
### Block details ###
|
139
|
+
The width and height of blocks is calculated automatically depending on their children. It is possible to set the block width, or make it scrollable , for example for images list. Possible to add MD icon to the header, if required. width, scroll, height, icon are optional.
|
140
|
+
```
|
141
|
+
#Block(name, *children, **options)
|
142
|
+
block = Block(‘Pictures’,add_button, images, width = 500, scroll = True,icon = 'api')
|
143
|
+
```
|
144
|
+
|
145
|
+
The first Block child is a widget(s) which are drawn in the block header just after its name.
|
146
|
+
Blocks can be shared between the user screens with its states. Such a block has to be located in the 'blocks' folder .
|
147
|
+
Examples of such block tests/blocks/tblock.py:
|
148
|
+
```
|
149
|
+
from unisi import *
|
150
|
+
..
|
151
|
+
concept_block = Block('Concept block',
|
152
|
+
[ #some gui elements
|
153
|
+
Button('Run',run_proccess),
|
154
|
+
Edit('Working folder','run_folder')
|
155
|
+
], result_table)
|
156
|
+
```
|
157
|
+
If some elements are enumerated inside an array, Unisi will display them on a line one after another, otherwise everyone will be displayed on a new own line(s).
|
158
|
+
|
159
|
+
Using a shared block in some screen:
|
160
|
+
```
|
161
|
+
from blocks.tblock import concept_block
|
162
|
+
...
|
163
|
+
blocks = [.., concept_block]
|
164
|
+
```
|
165
|
+
|
166
|
+
#### Events interception of shared elements ####
|
167
|
+
Interception handlers have the same in/out format as usual handlers.
|
168
|
+
#### They are called before the inner element handler call. They cancel the call of inner element handler but you can call it as shown below.
|
169
|
+
For example above interception of select_mode changed event will be:
|
170
|
+
```
|
171
|
+
@handle(select_mode, 'changed')
|
172
|
+
def do_not_select_mode_x(selector, value):
|
173
|
+
if value == 'Mode X':
|
174
|
+
return Error('Do not select Mode X in this context', selector) # send old value for update select_mode to the previous state
|
175
|
+
return _.accept(value) #otherwise accept the value
|
176
|
+
```
|
177
|
+
|
178
|
+
#### Layout of blocks. ####
|
179
|
+
If the blocks are simply listed Unisi draws them from left to right or from top to bottom depending on the orientation setting. If a different layout is needed, it can be set according to the following rule: if the vertical area must contain more than one block, then the enumeration in the array will arrange the elements vertically one after another. If such an element enumeration is an array of blocks, then they will be drawn horizontally in the corresponding area.
|
180
|
+
|
181
|
+
#### Example ####
|
182
|
+
blocks = [ [b1,b2], [b3, [b4, b5]]]
|
183
|
+
#[b1,b2] - the first vertical area, [b3, [b4, b5]] - the second one.
|
184
|
+
|
185
|
+

|
186
|
+
|
187
|
+
### Basic gui elements ###
|
188
|
+
Normally they have type property which says unisi what data it contains and optionally how to draw the element.
|
189
|
+
#### If the element name starts from _ , unisi will hide its name on the screen. ####
|
190
|
+
if we need to paint an icon in an element, add 'icon': 'any MD icon name' to the element constructor.
|
191
|
+
|
192
|
+
#### Most constructor parameters are optional for Gui elements except the first one which is the element name. ####
|
193
|
+
|
194
|
+
Common form for element constructors:
|
195
|
+
```
|
196
|
+
Gui('Name', value = some_value, changed = changed_handler)
|
197
|
+
#It is possible to use short form, that is equal:
|
198
|
+
Gui('Name', some_value, changed_handler)
|
199
|
+
```
|
200
|
+
calling the method
|
201
|
+
def accept(self, value)
|
202
|
+
causes a call changed handler if it defined, otherwise just save value to self.value
|
203
|
+
|
204
|
+
### Button ###
|
205
|
+
Normal button.
|
206
|
+
```
|
207
|
+
Button('Push me', changed = push_callback)
|
208
|
+
```
|
209
|
+
Short form
|
210
|
+
```
|
211
|
+
Button('Push me', push_callback)
|
212
|
+
```
|
213
|
+
Icon button
|
214
|
+
```
|
215
|
+
Button('_Check', push_callback, icon = 'check')
|
216
|
+
```
|
217
|
+
|
218
|
+
### Load to server Button ###
|
219
|
+
Special button provides file loading from user device or computer to the Unisi server.
|
220
|
+
```
|
221
|
+
UploadButton('Load', handler_when_loading_finish, icon='photo_library')
|
222
|
+
```
|
223
|
+
handler_when_loading_finish(button_, the_loaded_file_filename) where the_loaded_file_filename is a file name in upload server folder. This folder name is defined in config.py .
|
224
|
+
|
225
|
+
### Edit and Text field. ###
|
226
|
+
```
|
227
|
+
Edit('Some field', '') #for string value
|
228
|
+
Edit('Number field', 0.9, type = 'number') #changed handler will get a number
|
229
|
+
```
|
230
|
+
If set edit = false it will be readonly field.
|
231
|
+
```
|
232
|
+
Edit('Some field', '', edit = false)
|
233
|
+
#text
|
234
|
+
Text('Some text')
|
235
|
+
```
|
236
|
+
complete handler is optional function which accepts the current edit value and returns a string list for autocomplete.
|
237
|
+
|
238
|
+
```
|
239
|
+
def get_complete_list(gui_element, current_value):
|
240
|
+
return [s for s in vocab if current_value in s]
|
241
|
+
|
242
|
+
Edit('Edit me', 'value', complete = get_complete_list) #value has to be string or number
|
243
|
+
```
|
244
|
+
|
245
|
+
Optional 'update' handler is called when the user press Enter in the field.
|
246
|
+
It can return None if OK or objects for updating as usual 'changed' handler.
|
247
|
+
|
248
|
+
Optional selection property with parameters (start, end) is called when selection is happened.
|
249
|
+
Optional autogrow property uses for serving multiline fileds.
|
250
|
+
|
251
|
+
|
252
|
+
### Radio button ###
|
253
|
+
```
|
254
|
+
Switch(name, value, changed, type = ...)
|
255
|
+
value is boolean, changed is an optional handler.
|
256
|
+
Optional type can be 'check' for a status button or 'switch' for a switcher .
|
257
|
+
```
|
258
|
+
|
259
|
+
### Select group. Contains options field. ###
|
260
|
+
```
|
261
|
+
Select('Select something', "choice1", selection_is_changed, options = ["choice1","choice2", "choice3"])
|
262
|
+
```
|
263
|
+
Optional type parameter can be 'toggles','list','dropdown'. Unisi automatically chooses between toogles and dropdown, if type is omitted,
|
264
|
+
if type = 'list' then Unisi build it as vertical select list.
|
265
|
+
|
266
|
+
|
267
|
+
### Image. ###
|
268
|
+
width,changed,height,header are optional, changed is called if the user select or touch the image.
|
269
|
+
When the user click the image, a check mark is appearing on the image, showning select status of the image.
|
270
|
+
It is usefull for image list, gallery, e.t.c
|
271
|
+
```
|
272
|
+
Image(image_name, selecting_changed, header = 'description',url = ..., width = .., height = ..)
|
273
|
+
```
|
274
|
+
|
275
|
+
### Video. ###
|
276
|
+
width and height are optional.
|
277
|
+
```
|
278
|
+
Video(video_url, width = .., height = ..)
|
279
|
+
```
|
280
|
+
|
281
|
+
### Tree. The element for tree-like data. ###
|
282
|
+
```
|
283
|
+
Tree(name, selected_item_name, changed_handler, options = {name1: parent1, name2 : None, .})
|
284
|
+
```
|
285
|
+
options is a tree structure, a dictionary {item_name:parent_name}.
|
286
|
+
parent_name is None for root items. changed_handler gets item key (name) as value.
|
287
|
+
|
288
|
+
### Table. ###
|
289
|
+
Tables is common structure for presenting 2D data and charts.
|
290
|
+
Optional append, delete, update handlers are called for adding, deleting and updating rows.
|
291
|
+
|
292
|
+
|
293
|
+
Assigning a handler for such action causes Unii to draw and activate an appropriate action icon button in the table header automatically.
|
294
|
+
```
|
295
|
+
table = Table('Videos', [0], row_changed, headers = ['Video', 'Duration', 'Owner', 'Status'],
|
296
|
+
rows = [
|
297
|
+
['opt_sync1_3_0.mp4', '30 seconds', 'Admin', 'Processed'],
|
298
|
+
['opt_sync1_3_0.mp4', '37 seconds', 'Admin', 'Processed']
|
299
|
+
],
|
300
|
+
multimode = false, update = update)
|
301
|
+
```
|
302
|
+
Unisi counts rows id as an index in a rows array. If table does not contain append, delete arguments, then it will be drawn without add and remove icons.
|
303
|
+
value = [0] means 0 row is selected in multiselect mode (in array). multimode is False so switch icon for single select mode will be not drawn and switching to single select mode is not allowed.
|
304
|
+
|
305
|
+
| Table option parameter | Description |
|
306
|
+
| :---: | :---: |
|
307
|
+
| changed | table handler accept the selected row number |
|
308
|
+
| complete | Autocomplete handler as with value type (string value, (row index, column index)) that returns a string list of possible complitions |
|
309
|
+
| append | A handler gets new row index and return filled row with proposed values, has system append_table_row by default |
|
310
|
+
| delete | A handler gets list or index of selected rows and remove them. system delete_table_row by default |
|
311
|
+
| update | called when the user presses the Enter in a table cell |
|
312
|
+
| modify | default = accept_rowvalue(table, value). called when the cell value is changed by the user |
|
313
|
+
| edit | default True. if true user can edit table, using standart or overloaded table methods |
|
314
|
+
| tools | default True, then Table has toolbar with search field and icon action buttons. |
|
315
|
+
| show | default False, the table scrolls to (the first) selected row, if True and it is not visible |
|
316
|
+
| multimode | default True, allows to select single or multi selection mode |
|
317
|
+
|
318
|
+
|
319
|
+
### Table handlers. ###
|
320
|
+
complete, modify and update have the same format as the others handlers, but value is consisted from the cell value and its position in the table.
|
321
|
+
|
322
|
+
|
323
|
+
```
|
324
|
+
def table_updated(table_, tabval):
|
325
|
+
value, position = tabval
|
326
|
+
#check value
|
327
|
+
...
|
328
|
+
if error_found:
|
329
|
+
return Error('Can not accept the value!')
|
330
|
+
accept_rowvalue(table_, tabval)
|
331
|
+
```
|
332
|
+
|
333
|
+
### Chart ###
|
334
|
+
Chart is a table with additional Table constructor parameter 'view' which explaines unisi how to draw a chart. The format is '{x index}-{y index1},{y index2}[,..]'. '0-1,2,3' means that x axis values will be taken from 0 column, and y values from 1,2,3 columns of row data.
|
335
|
+
'i-3,5' means that x axis values will be equal the row indexes in rows, and y values from 3,5 columns of rows data. If a table constructor got view = '..' parameter then unisi displays a chart icon at the table header, pushing it switches table mode to the chart mode. If a table constructor got type = 'chart' in addition to view parameter the table will be displayed as a chart on start. In the chart mode pushing the icon button on the top right switches back to table view mode.
|
336
|
+
|
337
|
+
### Graph ###
|
338
|
+
Graph supports an interactive graph.
|
339
|
+
```
|
340
|
+
graph = Graph('X graph', graph_value, graph_selection,
|
341
|
+
nodes = [
|
342
|
+
{ 'id' : 'node1', 'label': "Node 1" },
|
343
|
+
{ 'id' : 'node2', 'label': "Node 2" },
|
344
|
+
{ 'id' : 'node3', 'label': "Node 3" }
|
345
|
+
], edges = [
|
346
|
+
{ 'id' : 'edge1', 'source': "node1", 'target': "node2", 'label' : 'extending' },
|
347
|
+
{ 'id' :'edge2' , 'source': "node2", 'target': "node3" , 'label' : 'extending'}
|
348
|
+
])
|
349
|
+
```
|
350
|
+
where graph_value is a dictionary like {'nodes' : ["node1"], 'edges' : ['edge3']}, where enumerations are selected nodes and edges.
|
351
|
+
Constant graph_default_value == {'nodes' : [], 'edges' : []} i.e. nothing to select.
|
352
|
+
|
353
|
+
'changed' method graph_selector called when user (de)selected nodes or edges:
|
354
|
+
```
|
355
|
+
def graph_selection(_, val):
|
356
|
+
_.value = val
|
357
|
+
if 'nodes' in val:
|
358
|
+
return Info(f'Nodes {val["nodes"]}')
|
359
|
+
if 'edges' in val:
|
360
|
+
return Info(f"Edges {val['edges']}")
|
361
|
+
```
|
362
|
+
With pressed 'Shift' multi select works for nodes and edges.
|
363
|
+
|
364
|
+
id nodes and edges are optinal, if node ids are ommited then edge 'source' and 'target' have to point node index in nodes array.
|
365
|
+
|
366
|
+
### Dialog ###
|
367
|
+
```
|
368
|
+
Dialog(text, dialog_callback, commands = ['Ok', 'Cancel'], *content)
|
369
|
+
```
|
370
|
+
where buttons is a list of the dialog button names,
|
371
|
+
Dialog callback has the signature as other with a pushed button name value
|
372
|
+
```
|
373
|
+
def dialog_callback(current_dialog, pushed_button_name):
|
374
|
+
if pushed_button_name == 'Yes':
|
375
|
+
do_this()
|
376
|
+
elif ..
|
377
|
+
```
|
378
|
+
content can be filled with Gui elements for additional dialog functionality.
|
379
|
+
|
380
|
+
|
381
|
+
### Popup windows ###
|
382
|
+
They are intended for non-blocking displaying of error messages and informing about some events, for example, incorrect user input and the completion of a long process on the server.
|
383
|
+
```
|
384
|
+
Info(info_message, *someGUIforUpdades)
|
385
|
+
Warning(warning_message, *someGUIforUpdades)
|
386
|
+
Error(error_message, *someGUIforUpdades)
|
387
|
+
```
|
388
|
+
They are returned by handlers and cause appearing on the top screen colored rectangles window for 3 second. someGUIforUpdades is optional GUI enumeration for updating.
|
389
|
+
|
390
|
+
For long time processes it is possible to create Progress window. It is just call user.progress in any place.
|
391
|
+
Open window
|
392
|
+
```
|
393
|
+
user.progress("Analyze .. Wait..")
|
394
|
+
```
|
395
|
+
Update window message
|
396
|
+
```
|
397
|
+
user.progress(" 1% is done..")
|
398
|
+
```
|
399
|
+
Close window user.progress(None) or automatically when the handler returns something.
|
400
|
+
|
401
|
+
### Milti-user support. ###
|
402
|
+
Unisi automatically creates and serves an environment for every user.
|
403
|
+
The management class is User contains all required methods for processing and handling the user activity. A programmer can redefine methods in the inherited class, point it as system user class and that is all. Such methods suit for history navigation, undo/redo and initial operations. The screen folder contains screens which are recreated for every user. The same about blocks. The code and modules outside that folders are common for all users as usual. By default Unisi uses the system User class and you do not need to point it.
|
404
|
+
```
|
405
|
+
class Hello_user(unisi.User):
|
406
|
+
def __init__(self):
|
407
|
+
super().__init__()
|
408
|
+
print('New Hello user connected and created!')
|
409
|
+
|
410
|
+
unisi.start('Hello app', user_type = Hello_user)
|
411
|
+
```
|
412
|
+
In screens and blocks sources we can access the user by 'user' variable
|
413
|
+
```
|
414
|
+
print(isinstance(user, Hello_user))
|
415
|
+
```
|
416
|
+
|
417
|
+
More info about User class methods you can find in user.py in the souce dir.
|
418
|
+
|
419
|
+
Examples are in tests folder.
|
420
|
+
|
421
|
+
Demo project and UNISI part https://github.com/Claus1/cvtools
|
422
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
unisi-0.1.0.dist-info/METADATA,sha256=l4lJ2RKJ-UwfdQjKLHt7sbgF_3akw14vG8ZWZTQdCF0,18595
|
2
|
+
unisi-0.1.0.dist-info/WHEEL,sha256=N2J68yzZqJh3mI_Wg92rwhw0rtJDFpZj9bwQIMJgaVg,90
|
3
|
+
unisi-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
4
|
+
unisi/__init__.py,sha256=bQ7yTDcgybkbIGTjxkajTbBJXtgyryrCvt3nXg8QxlQ,175
|
5
|
+
unisi/autotest.py,sha256=mqf6FPPewadwQenG_rgZhhLZEhvZ0H_kLGH1570aLho,8053
|
6
|
+
unisi/common.py,sha256=oQJdUHVIf3QEMlnRSY_FW-ce4oDb7xcmzOhHByKGC7w,753
|
7
|
+
unisi/containers.py,sha256=_oB1KknoHAslpmVHY_dpX4uOcKtP5Pelqdv9fMjotHo,3403
|
8
|
+
unisi/guielements.py,sha256=79-DTtUpKH4mBYbnKKzLQVgagBxk3bwKRGvfwNbl71A,5399
|
9
|
+
unisi/proxy.py,sha256=YENWammF8xSAgHKUSQJqLVFXhnwdZOGA_sAPSqqEfa8,5728
|
10
|
+
unisi/reloader.py,sha256=X4bxZn0P6Ey7mj4SAs8rz4RjEtpXd8vny1aGbyYnnik,6424
|
11
|
+
unisi/server.py,sha256=SKN38DjuxZ0U_FjBJDuwnpDP2YfZorpIJrjrADhqf5w,4521
|
12
|
+
unisi/tables.py,sha256=YJPylz28aTYJ44xF2JJ4P8yiSbgCtsyFEUI99rB-j50,4241
|
13
|
+
unisi/users.py,sha256=X0jUP8vTbsPX0r4rYEacOVoqFU1IQxYveTdhdGtLsJI,9886
|
14
|
+
unisi/utils.py,sha256=KnyjouXGnN8ubuwogMa1tu2HJSkmDqhuFf7RpU3n9bY,2971
|
15
|
+
unisi/web/css/169.3abcdd94.css,sha256=5r_UnC_UWorIOB_Wxta6uEkma5feD5MP-63UsVKV4JE,2723
|
16
|
+
unisi/web/css/app.31d6cfe0.css,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
+
unisi/web/css/vendor.9ed7638d.css,sha256=p_6HvcTaHu2zmOmfGxEGiGu5TIFZ75_XKHJZWA0eGCE,220597
|
18
|
+
unisi/web/favicon.ico,sha256=2ZcJaY_4le4w5NSBzWjaj3yk1faLAX0XqioI-Tjscbs,64483
|
19
|
+
unisi/web/fonts/KFOkCnqEu92Fr1MmgVxIIzQ.68bb21d0.woff,sha256=NOlYLBNxo7OiA4Amba6ZTtxureGS3_GkBh3WURNSwQI,20436
|
20
|
+
unisi/web/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.48af7707.woff,sha256=nOfzrEe5F0OJOi0p_lEafr7HrvUrLqmF-hJ0SNHyJ8E,20544
|
21
|
+
unisi/web/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.c2f7ab22.woff,sha256=vxTH13NLj5yGO5gqTnsw1DYa-Oh0fyyoZyuljnA-lqM,20416
|
22
|
+
unisi/web/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.77ecb942.woff,sha256=4P1XwNlTfZyYhLaorYwYI4ANlNz7aizJiHgP5lpZL-Y,20408
|
23
|
+
unisi/web/fonts/KFOlCnqEu92Fr1MmYUtfBBc-.f5677eb2.woff,sha256=9lN-MiY-bEm_Wb1uSVK2vwbI8JFSxbAWNl_vcONYVs8,20424
|
24
|
+
unisi/web/fonts/KFOmCnqEu92Fr1Mu4mxM.f1e2a767.woff,sha256=8qv3-6vimOWCPSV-SPXcITjG1eDCEAZvdrAGfo7aGU8,20344
|
25
|
+
unisi/web/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.4d73cb90.woff,sha256=_YT4i0lwQNT31ejJ-GNa740-cGwPpS4rb6zxTu6H5SI,164912
|
26
|
+
unisi/web/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.c5371cfb.woff2,sha256=Sk28YvozXkEblKUyvgkcWMDAxPpzEznxFyJXfTz2RDs,128616
|
27
|
+
unisi/web/icons/favicon-128x128.png,sha256=zmGg0n6RZ5OM4gg-E5HeHuUUtA2KD1w2AqegT0SfZ3k,12324
|
28
|
+
unisi/web/icons/favicon-16x16.png,sha256=3ynBFHJjwaUFKcZVC2rBs27b82r64dmcvfFzEo52-sU,859
|
29
|
+
unisi/web/icons/favicon-32x32.png,sha256=lhGXZOqIhjcKDymmbKyo4mrVmKY055LMD5GO9eW2Qjk,2039
|
30
|
+
unisi/web/icons/favicon-96x96.png,sha256=0PbP5YF01VHbwwP8z7z8jjltQ0q343C1wpjxWjj47rY,9643
|
31
|
+
unisi/web/index.html,sha256=hDsDzmlBU6AO_dpCYbtLuS-sFZsYHWLloD1edJF7DKo,907
|
32
|
+
unisi/web/js/169.f952e294.js,sha256=Vz929BAarhcMBvsblKOfhk9o4fIcux84AMBUiLEtr_k,55870
|
33
|
+
unisi/web/js/193.283445be.js,sha256=FID-PRjvjbe_OHxm7L2NC92Cj_5V7AtDQ2WvKxLZ0lw,763
|
34
|
+
unisi/web/js/430.591e9a73.js,sha256=7S1CJTwGdE2EKXzeFRcaYuTrn0QteoVI03Hykz8qh3s,6560
|
35
|
+
unisi/web/js/app.ba94719f.js,sha256=Ye-ucwQNP-YLEUhE_wsS_3b6rIHvrPm8IUAPf5AH46A,5923
|
36
|
+
unisi/web/js/vendor.d6797c01.js,sha256=2aKM3Lfxc0pHSirrcUReL1LcvDYWnfeBj2c67XsSELk,1279477
|
37
|
+
unisi-0.1.0.dist-info/RECORD,,
|
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|