p3lib 1.1.87__tar.gz → 1.1.88__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.87 → p3lib-1.1.88}/PKG-INFO +1 -1
- {p3lib-1.1.87 → p3lib-1.1.88}/setup.cfg +1 -1
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/pconfig.py +30 -1
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib.egg-info/PKG-INFO +1 -1
- {p3lib-1.1.87 → p3lib-1.1.88}/LICENSE +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/README.md +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/pyproject.toml +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/__init__.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/ate.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/bokeh_auth.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/bokeh_gui.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/boot_manager.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/conduit.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/database_if.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/helper.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/json_networking.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/mqtt_rpc.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/netif.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/netplotly.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/ngt.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/ssh.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/table_plot.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib/uio.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib.egg-info/SOURCES.txt +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib.egg-info/dependency_links.txt +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib.egg-info/requires.txt +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/src/p3lib.egg-info/top_level.txt +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/tests/test_conduit.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/tests/test_json_networking.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/tests/test_netif.py +0 -0
- {p3lib-1.1.87 → p3lib-1.1.88}/tests/test_ssh.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: p3lib
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.88
|
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
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[metadata]
|
2
2
|
name = p3lib
|
3
|
-
version = 1.1.
|
3
|
+
version = 1.1.88
|
4
4
|
author = Paul Austen
|
5
5
|
author_email = pausten.os@gmail.com
|
6
6
|
description = A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output.
|
@@ -756,6 +756,8 @@ class DotConfigManager(ConfigManager):
|
|
756
756
|
The ~/.config folder holds either a single config file of the startup python filename.
|
757
757
|
The ./config folder can contain another python module folder which contains the config
|
758
758
|
file. E.G for this example app the ~/.config/examples/pconfig_example.cfg folder is used."""
|
759
|
+
DEFAULT_CONFIG = None # This must be overridden in a subclass to define the configuration parameters and values.
|
760
|
+
KEY_EDIT_ORDER_LIST = None
|
759
761
|
|
760
762
|
@staticmethod
|
761
763
|
def GetDefaultConfigFilename():
|
@@ -800,9 +802,10 @@ class DotConfigManager(ConfigManager):
|
|
800
802
|
|
801
803
|
return configFilename
|
802
804
|
|
803
|
-
def __init__(self, defaultConfig, uio=None, encrypt=False):
|
805
|
+
def __init__(self, defaultConfig, keyEditOrderList=None, uio=None, encrypt=False):
|
804
806
|
"""@brief Constructor
|
805
807
|
@param defaultConfig A default config instance containing all the default key-value pairs.
|
808
|
+
@param keyEditOrderList A list of all the dict keys in the order that the caller wishes them to be displayed top the user.
|
806
809
|
@param uio A UIO (User Input Output) instance. May be set to None if no user messages are required.
|
807
810
|
@param encrypt If True then data will be encrypted in the saved files.
|
808
811
|
The encryption uses part of the the local SSH RSA private key.
|
@@ -811,7 +814,33 @@ class DotConfigManager(ConfigManager):
|
|
811
814
|
!!! Therefore if encrypt is set True then the an ssh key must be present !!!
|
812
815
|
||| in the ~/.ssh folder named id_rsa. !!!"""
|
813
816
|
super().__init__(uio, DotConfigManager.GetDefaultConfigFilename(), defaultConfig, encrypt=encrypt)
|
817
|
+
self._keyEditOrderList = keyEditOrderList
|
814
818
|
# Ensure the config file is present and loaded into the internal dict.
|
815
819
|
self.load()
|
816
820
|
|
821
|
+
def show(self):
|
822
|
+
"""@brief A helper method to show the dictionary config to the user.
|
823
|
+
@return A dictionary mapping the attribute ID's (keys) to dictionary keys (values)."""
|
824
|
+
maxKeyLen=10
|
825
|
+
# If the caller wants to present the parameters to the user in a partiular order
|
826
|
+
if self._keyEditOrderList:
|
827
|
+
keys = self._keyEditOrderList
|
828
|
+
defaultKeys = list(self._configDict.keys())
|
829
|
+
for defaultKey in defaultKeys:
|
830
|
+
if defaultKey not in keys:
|
831
|
+
raise Exception(f"BUG: DotConfigManager: {defaultKey} key is missing from the keyEditOrderList.")
|
832
|
+
# Present the parameters to the user in any order.
|
833
|
+
else:
|
834
|
+
keys = list(self._configDict.keys())
|
817
835
|
|
836
|
+
for key in keys:
|
837
|
+
if len(key) > maxKeyLen:
|
838
|
+
maxKeyLen = len(key)
|
839
|
+
self._info("ID PARAMETER"+" "*(maxKeyLen-8)+" VALUE")
|
840
|
+
id=1
|
841
|
+
idKeyDict = {}
|
842
|
+
for key in keys:
|
843
|
+
idKeyDict[id]=key
|
844
|
+
self._info("{:<3d} {:<{}} {}".format(id, key, maxKeyLen+1, self._configDict[key]))
|
845
|
+
id=id+1
|
846
|
+
return idKeyDict
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: p3lib
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.88
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|