p3lib 1.1.121__tar.gz → 1.1.123__tar.gz
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-1.1.121 → p3lib-1.1.123}/PKG-INFO +1 -1
- {p3lib-1.1.121 → p3lib-1.1.123}/pyproject.toml +1 -1
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/ngt.py +60 -40
- {p3lib-1.1.121 → p3lib-1.1.123}/LICENSE +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/README.md +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/__init__.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/ate.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/bokeh_auth.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/bokeh_gui.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/boot_manager.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/conduit.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/database_if.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/file_io.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/gnome_desktop_app.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/helper.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/json_networking.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/login.html +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/mqtt_rpc.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/netif.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/netplotly.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/pconfig.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/ssh.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/table_plot.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/uio.py +0 -0
- {p3lib-1.1.121 → p3lib-1.1.123}/src/p3lib/windows_app.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "p3lib"
|
3
|
-
version = "1.1.
|
3
|
+
version = "1.1.123"
|
4
4
|
description = "A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output."
|
5
5
|
authors = ["Paul Austen <pjaos@gmail.com>"]
|
6
6
|
license = "MIT License"
|
@@ -314,6 +314,14 @@ class TabbedNiceGui(object):
|
|
314
314
|
self._logMessageCount += 1
|
315
315
|
# We've received a log message so update progress bar if required.
|
316
316
|
self._updateProgressBar(msg)
|
317
|
+
# Wait a moment for DOM to update, then scroll to the end of the log
|
318
|
+
# so that the message just added is visible.
|
319
|
+
ui.timer(0.05, lambda: ui.run_javascript("""
|
320
|
+
const el = document.querySelector('.my-log');
|
321
|
+
if (el) {
|
322
|
+
el.scrollTop = el.scrollHeight;
|
323
|
+
}
|
324
|
+
"""), once=True)
|
317
325
|
|
318
326
|
def _infoGT(self, msg):
|
319
327
|
"""@brief Update an info level message. This must be called from the GUI thread.
|
@@ -371,7 +379,13 @@ class TabbedNiceGui(object):
|
|
371
379
|
if isinstance(rxMessage, dict):
|
372
380
|
self._processRXDict(rxMessage)
|
373
381
|
|
374
|
-
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"):
|
375
389
|
"""@brief Init the tabbed GUI.
|
376
390
|
@param tabNameList A list of the names of each tab to be created.
|
377
391
|
@param tabMethodInitList A list of the methods to be called to init each of the above tabs.
|
@@ -379,47 +393,53 @@ class TabbedNiceGui(object):
|
|
379
393
|
@param reload If reload is set False then changes to python files will not cause the server to be restarted.
|
380
394
|
@param address The address to bind the server to.
|
381
395
|
@param The TCP port to bind the server to.
|
382
|
-
@param pageTitle The page title that appears in the browser.
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
guiLogLevel = "
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
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)
|
411
431
|
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
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)
|
416
436
|
|
417
|
-
|
418
|
-
|
437
|
+
with ui.row():
|
438
|
+
ui.label(f"Software Version: {self._programVersion}")
|
419
439
|
|
420
|
-
|
421
|
-
|
422
|
-
|
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)
|
423
443
|
|
424
444
|
def progressTimerCallback(self):
|
425
445
|
"""@brief Time to update the progress bar. We run the timer all the time because there appears to be a
|
@@ -939,4 +959,4 @@ class local_file_picker(ui.dialog):
|
|
939
959
|
selected=selected[1:]
|
940
960
|
selected = self.drives_toggle.value + selected
|
941
961
|
|
942
|
-
self.submit([selected])
|
962
|
+
self.submit([selected])
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|