p3lib 1.1.122__py2.py3-none-any.whl → 1.1.123__py2.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.
p3lib/ngt.py
CHANGED
@@ -379,7 +379,13 @@ class TabbedNiceGui(object):
|
|
379
379
|
if isinstance(rxMessage, dict):
|
380
380
|
self._processRXDict(rxMessage)
|
381
381
|
|
382
|
-
def initGUI(self,
|
382
|
+
def initGUI(self,
|
383
|
+
tabNameList,
|
384
|
+
tabMethodInitList,
|
385
|
+
reload=True,
|
386
|
+
address="0.0.0.0",
|
387
|
+
port=DEFAULT_SERVER_PORT,
|
388
|
+
pageTitle="NiceGUI"):
|
383
389
|
"""@brief Init the tabbed GUI.
|
384
390
|
@param tabNameList A list of the names of each tab to be created.
|
385
391
|
@param tabMethodInitList A list of the methods to be called to init each of the above tabs.
|
@@ -387,47 +393,53 @@ class TabbedNiceGui(object):
|
|
387
393
|
@param reload If reload is set False then changes to python files will not cause the server to be restarted.
|
388
394
|
@param address The address to bind the server to.
|
389
395
|
@param The TCP port to bind the server to.
|
390
|
-
@param pageTitle The page title that appears in the browser.
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
guiLogLevel = "
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
396
|
+
@param pageTitle The page title that appears in the browser.
|
397
|
+
@param maxLogLines The maximum number of lines to be displayed in the log. Be aware setting this higher will cause the browser to use more memory."""
|
398
|
+
with ui.column().classes('h-screen w-screen p4'):
|
399
|
+
# A bit of defensive programming.
|
400
|
+
if len(tabNameList) != len(tabMethodInitList):
|
401
|
+
raise Exception(f"initGUI: BUG: tabNameList ({len(tabNameList)}) and tabMethodInitList ({len(tabMethodInitList)}) are not the same length.")
|
402
|
+
tabObjList = []
|
403
|
+
with ui.row():
|
404
|
+
with ui.tabs().classes('w-full') as tabs:
|
405
|
+
for tabName in tabNameList:
|
406
|
+
tabObj = ui.tab(tabName)
|
407
|
+
tabObjList.append(tabObj)
|
408
|
+
|
409
|
+
with ui.tab_panels(tabs, value=tabObjList[0]).classes('w-full'):
|
410
|
+
for tabObj in tabObjList:
|
411
|
+
with ui.tab_panel(tabObj):
|
412
|
+
tabIndex = tabObjList.index(tabObj)
|
413
|
+
tabMethodInitList[tabIndex]()
|
414
|
+
|
415
|
+
guiLogLevel = "warning"
|
416
|
+
if self._debugEnabled:
|
417
|
+
guiLogLevel = "debug"
|
418
|
+
|
419
|
+
ui.label("Message Log")
|
420
|
+
self._progress = ui.slider(min=0,max=TabbedNiceGui.MAX_PROGRESS_VALUE,step=1)
|
421
|
+
self._progress.set_visibility(False)
|
422
|
+
self._progress.min = 0
|
423
|
+
# Don't allow user to adjust progress bar thumb
|
424
|
+
self._progress.disable()
|
425
|
+
# Setup the log area to fill the available space in the page vertically and horizontally
|
426
|
+
# The 32px is to make space for the vertical scrollbar within the page or it will be
|
427
|
+
# shifted out of sight to the right.
|
428
|
+
# Previously used self._log = ui.log(max_lines=2000) but the ui.log() does not currently limit data in the log.
|
429
|
+
self._log = ui.log().classes('my-log grow w-full max-w-[calc(100%-32px)] overflow-auto box-border')
|
430
|
+
self._log.set_visibility(True)
|
419
431
|
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
432
|
+
with ui.row():
|
433
|
+
ui.button('Clear Log', on_click=self._clearLog)
|
434
|
+
ui.button('Log Message Count', on_click=self._showLogMsgCount)
|
435
|
+
ui.button('Quit', on_click=self.close)
|
424
436
|
|
425
|
-
|
426
|
-
|
437
|
+
with ui.row():
|
438
|
+
ui.label(f"Software Version: {self._programVersion}")
|
427
439
|
|
428
|
-
|
429
|
-
|
430
|
-
|
440
|
+
ui.timer(interval=TabbedNiceGui.GUI_TIMER_SECONDS, callback=self.guiTimerCallback)
|
441
|
+
ui.timer(interval=TabbedNiceGui.PROGRESS_TIMER_SECONDS, callback=self.progressTimerCallback)
|
442
|
+
ui.run(host=address, port=port, title=pageTitle, dark=True, uvicorn_logging_level=guiLogLevel, reload=reload)
|
431
443
|
|
432
444
|
def progressTimerCallback(self):
|
433
445
|
"""@brief Time to update the progress bar. We run the timer all the time because there appears to be a
|
@@ -947,4 +959,4 @@ class local_file_picker(ui.dialog):
|
|
947
959
|
selected=selected[1:]
|
948
960
|
selected = self.drives_toggle.value + selected
|
949
961
|
|
950
|
-
self.submit([selected])
|
962
|
+
self.submit([selected])
|
@@ -13,13 +13,13 @@ p3lib/login.html,sha256=DADTJGuvWQ-LTO4X6SaFdqK7JMW03DAa3lRieGD0d6g,2748
|
|
13
13
|
p3lib/mqtt_rpc.py,sha256=6LmFA1kR4HSJs9eWbOJORRHNY01L_lHWjvtE2fmY8P8,10511
|
14
14
|
p3lib/netif.py,sha256=3QV5OGdHhELIf4MBj6mx5MNCtVeZ7JXoNEkeu4KzCaE,9796
|
15
15
|
p3lib/netplotly.py,sha256=PMDx-w1jtRVW6Od5u_kuKbBxNpTS_Y88mMF60puMxLM,9363
|
16
|
-
p3lib/ngt.py,sha256=
|
16
|
+
p3lib/ngt.py,sha256=s-6e4E1Q2WXWMtHKjzYWabXjtFD224mIf2WIMgMI1I0,44625
|
17
17
|
p3lib/pconfig.py,sha256=wGC6UJAIBksRjwKTfaw3Y6vAMkgey0QC2nhkCtqj1MQ,37738
|
18
18
|
p3lib/ssh.py,sha256=OyoAQ_h1L2RfkjTAChDrvLFfl4Fe_gBNdX5rvK-wKiw,42125
|
19
19
|
p3lib/table_plot.py,sha256=RPncwVlGUkkx5Fw0dHQedXo0TSPlTi__VrJBDzaMsuI,32116
|
20
20
|
p3lib/uio.py,sha256=Aaxc99XiE3d2f9vLjaN-bZsckoNxay5t0ujdK6PXGrw,23265
|
21
21
|
p3lib/windows_app.py,sha256=cSkGDIakamxylhOYk0BHjjUQwBBhOq7sij4a7xs9v44,3057
|
22
|
-
p3lib-1.1.
|
23
|
-
p3lib-1.1.
|
24
|
-
p3lib-1.1.
|
25
|
-
p3lib-1.1.
|
22
|
+
p3lib-1.1.123.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
|
23
|
+
p3lib-1.1.123.dist-info/METADATA,sha256=OtiYjBiAEoKURSc1KCzCHQ3we7q5nnabjvJXOeoxTug,1382
|
24
|
+
p3lib-1.1.123.dist-info/WHEEL,sha256=5druYqcII7zHXzX7qmN0TH895Jg3yuTtfjMgJIVBrKE,92
|
25
|
+
p3lib-1.1.123.dist-info/RECORD,,
|
File without changes
|
File without changes
|