p3lib 1.1.75__py3-none-any.whl → 1.1.76__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 +27 -8
- {p3lib-1.1.75.dist-info → p3lib-1.1.76.dist-info}/METADATA +1 -1
- {p3lib-1.1.75.dist-info → p3lib-1.1.76.dist-info}/RECORD +6 -6
- {p3lib-1.1.75.dist-info → p3lib-1.1.76.dist-info}/LICENSE +0 -0
- {p3lib-1.1.75.dist-info → p3lib-1.1.76.dist-info}/WHEEL +0 -0
- {p3lib-1.1.75.dist-info → p3lib-1.1.76.dist-info}/top_level.txt +0 -0
p3lib/ngt.py
CHANGED
@@ -114,6 +114,7 @@ class TabbedNiceGui(object):
|
|
114
114
|
self._progressBarStartMessage = ""
|
115
115
|
self._progressBarExpectedMessageList = []
|
116
116
|
self._expectedProgressBarMessageIndex = 0
|
117
|
+
self._expectedProgressBarMsgCount = 0
|
117
118
|
self._programVersion = TabbedNiceGui.GetProgramVersion()
|
118
119
|
|
119
120
|
self._logPath = None
|
@@ -430,26 +431,39 @@ class TabbedNiceGui(object):
|
|
430
431
|
# Increment the progress bar
|
431
432
|
self._progress.set_value( self._progress.value + self._progressStepValue )
|
432
433
|
|
433
|
-
def _startProgress(self, durationSeconds=0, startMessage=None, expectedMsgList=[]):
|
434
|
+
def _startProgress(self, durationSeconds=0, startMessage=None, expectedMsgList=[], expectedMsgCount=0):
|
434
435
|
"""@brief Start a timer that will update the progress bar.
|
435
436
|
The progress bar can simply update on a timer every second with durationSeconds set to the expected length
|
436
|
-
of the task
|
437
|
+
of the task.
|
437
438
|
|
438
|
-
|
439
|
-
|
439
|
+
If startMessage is set to a text string the progress time will not start until the log message area contains
|
440
|
+
the start message.
|
440
441
|
|
441
442
|
Alternatively if expectedMsgList contains a list of strings we expect to receive then the progress bar is
|
442
|
-
updated as each message is received. The messages may be the entire line of a log message or parts of a
|
443
|
+
updated as each message is received. The messages may be the entire line of a log message or parts of a
|
444
|
+
log message line.
|
445
|
+
|
446
|
+
Alternatively if expectedMsgCount is set to a value > 0 then the progress bar is updated as each message is
|
447
|
+
added to the log and reaches 100% when the number of messages added to the log file reaches the expectedMsgCount.
|
448
|
+
|
443
449
|
@param startMessage The text of the log message we expect to receive to trigger the progress bar timer start.
|
444
|
-
@param expectedMsgList A list of the expected log file messages.
|
450
|
+
@param expectedMsgList A list of the expected log file messages.
|
451
|
+
@param expectedMsgCount A int value that defines the number of log messages we expect to receive for normal progress
|
452
|
+
completion."""
|
445
453
|
self._progressValue = 0
|
446
454
|
self._progressBarStartMessage = ""
|
447
455
|
self._progressBarExpectedMessageList = []
|
448
456
|
self._expectedProgressBarMessageIndex = 0
|
457
|
+
self._expectedProgressBarMsgCount = 0
|
449
458
|
self._updateProgressOnTimer = False
|
450
459
|
self._progress.set_value( self._progressValue )
|
460
|
+
# If the caller wants to the progress bar to update as the log file message count increases.
|
461
|
+
if expectedMsgCount > 0:
|
462
|
+
self._expectedProgressBarMsgCount = expectedMsgCount
|
463
|
+
self._progressStepValue = TabbedNiceGui.MAX_PROGRESS_VALUE/float(self._expectedProgressBarMsgCount)
|
464
|
+
|
451
465
|
# If the caller wants to update the progress bar on expected messages.
|
452
|
-
|
466
|
+
elif len(expectedMsgList):
|
453
467
|
#Use the text of log messages to increment the progress bar.
|
454
468
|
self._expectedProgressBarMessageIndex = 0
|
455
469
|
self._progressBarExpectedMessageList = expectedMsgList
|
@@ -477,8 +491,13 @@ class TabbedNiceGui(object):
|
|
477
491
|
def _updateProgressBar(self, msg):
|
478
492
|
"""@brief Update the progress bar if required when a log message is received. This is called as each message is added to the log.
|
479
493
|
@param msg The log message received."""
|
494
|
+
# If we update the progress bar as each message is received until we have a log with self._expectedProgressBarMsgCount many messages.
|
495
|
+
if self._expectedProgressBarMsgCount > 0:
|
496
|
+
self._progressValue = self._progressValue + self._progressStepValue
|
497
|
+
self._progress.set_value( self._progressValue )
|
498
|
+
|
480
499
|
# If we have a list of log messages to update the progress bar.
|
481
|
-
|
500
|
+
elif len(self._progressBarExpectedMessageList) > 0:
|
482
501
|
if self._expectedProgressBarMessageIndex < len(self._progressBarExpectedMessageList):
|
483
502
|
# Get the message we expect to receive next
|
484
503
|
expectedMsg = self._progressBarExpectedMessageList[self._expectedProgressBarMessageIndex]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: p3lib
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.76
|
4
4
|
Summary: A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output.
|
5
5
|
Home-page: https://github.com/pjaos/p3lib
|
6
6
|
Author: Paul Austen
|
@@ -10,13 +10,13 @@ p3lib/json_networking.py,sha256=6u4s1SmypjTYPnSxHP712OgQ3ZJaxOqIkgHQ1J7Qews,9738
|
|
10
10
|
p3lib/mqtt_rpc.py,sha256=6LmFA1kR4HSJs9eWbOJORRHNY01L_lHWjvtE2fmY8P8,10511
|
11
11
|
p3lib/netif.py,sha256=3QV5OGdHhELIf4MBj6mx5MNCtVeZ7JXoNEkeu4KzCaE,9796
|
12
12
|
p3lib/netplotly.py,sha256=PMDx-w1jtRVW6Od5u_kuKbBxNpTS_Y88mMF60puMxLM,9363
|
13
|
-
p3lib/ngt.py,sha256=
|
13
|
+
p3lib/ngt.py,sha256=rXA-6zQkfeOupZ-3Q-k3-1DvbKYIi2TCtLKgUb0waWY,37726
|
14
14
|
p3lib/pconfig.py,sha256=_ri9w3aauHXZp8u2YLYHBVroFR_iCqaTCwj_MRa3rHo,30153
|
15
15
|
p3lib/ssh.py,sha256=klqQ9YuqU8GwPVPHrAJeEs5PI5hgoYiXflq2kIGG3as,39509
|
16
16
|
p3lib/table_plot.py,sha256=dRPZ9rFpwE9Dpyqrvbm5t2spVaPSHrx_B7KvfWVND3g,32166
|
17
17
|
p3lib/uio.py,sha256=hMarPnYXnqVF23HUIeDfzREo7TMdBjrupXMY_ffuCbI,23133
|
18
|
-
p3lib-1.1.
|
19
|
-
p3lib-1.1.
|
20
|
-
p3lib-1.1.
|
21
|
-
p3lib-1.1.
|
22
|
-
p3lib-1.1.
|
18
|
+
p3lib-1.1.76.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
|
19
|
+
p3lib-1.1.76.dist-info/METADATA,sha256=2jUaMjRM-yydYAzGuBZ8oTGOBDhBi6--Zxw4-qe2n-g,918
|
20
|
+
p3lib-1.1.76.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
21
|
+
p3lib-1.1.76.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
|
22
|
+
p3lib-1.1.76.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|