p3lib 1.1.88__py3-none-any.whl → 1.1.89__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/pconfig.py CHANGED
@@ -762,46 +762,35 @@ class DotConfigManager(ConfigManager):
762
762
  @staticmethod
763
763
  def GetDefaultConfigFilename():
764
764
  """@brief Get the default name of the config file for this app. This will be the program name
765
- (file that started up initially) without the .py extension. On Linux systems this
766
- will reside in the ~/.config folder. If the ~/.config does not exist an attempt to
767
- create it is made. If the ~/.config folder cannot be created then the config file
768
- will be as detailed above but will be prefixed by a . character and will reside
769
- in the users home folder."""
770
- progName = sys.argv[0]
771
- if progName.endswith('.py'):
772
- progName = progName[0:-3]
773
-
774
- folder = '.config'
775
- homePath = os.path.expanduser("~")
776
- configFolder = os.path.join(homePath, folder)
777
-
778
- if not os.path.isdir(homePath):
779
- raise Exception(f"{homePath} HOME path does not exist.")
765
+ (file that started up initially) without the .py extension. A .cfg extension is added
766
+ and it will be found in the ~/.config folder."""
767
+ dotConfigFolder = '.config'
768
+ homePath = os.path.expanduser("~")
769
+ configFolder = os.path.join(homePath, dotConfigFolder)
770
+
771
+ if not os.path.isdir(homePath):
772
+ raise Exception(f"{homePath} HOME path does not exist.")
780
773
 
781
- # Create the ~/.config folder if it does not exist
782
- if not os.path.isdir(configFolder):
783
- # Create the ~/.config folder
784
- os.makedir(configFolder)
785
-
786
- # Note that we assume that addDotToFilename in the ConfigManager constructor is set True
787
- # as this will prefix the filename with the . character.
788
- if os.path.isdir(configFolder):
789
- extraFolders = os.path.dirname(progName)
790
- configFolder = os.path.join(configFolder, extraFolders)
791
- if not os.path.isdir(configFolder):
792
- os.makedirs(configFolder)
793
- if not os.path.isdir(configFolder):
794
- raise Exception(f"Failed to create the {configFolder} folder.")
795
-
796
- configFolder = "config"
797
- configFolder = os.path.join(configFolder, extraFolders)
798
- configFilename = os.path.join(configFolder, os.path.basename(progName) + '.cfg')
774
+ # Create the ~/.config folder if it does not exist
775
+ if not os.path.isdir(configFolder):
776
+ # Create the ~/.config folder
777
+ os.makedir(configFolder)
799
778
 
800
- else:
801
- configFilename = progName
779
+ progName = sys.argv[0]
780
+ if progName.endswith('.py'):
781
+ progName = progName[0:-3]
782
+ progName = os.path.basename(progName).strip()
783
+
784
+ # Note that we assume that addDotToFilename in the ConfigManager constructor is set True
785
+ # as this will prefix the filename with the . character.
786
+ if os.path.isdir(configFolder):
787
+ configFilename = os.path.join(".config", progName + ".cfg")
788
+
789
+ else:
790
+ raise Exception(f"Failed to create the {configFolder} folder.")
791
+
792
+ return configFilename
802
793
 
803
- return configFilename
804
-
805
794
  def __init__(self, defaultConfig, keyEditOrderList=None, uio=None, encrypt=False):
806
795
  """@brief Constructor
807
796
  @param defaultConfig A default config instance containing all the default key-value pairs.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p3lib
3
- Version: 1.1.88
3
+ Version: 1.1.89
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
@@ -11,12 +11,12 @@ 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
13
  p3lib/ngt.py,sha256=rXA-6zQkfeOupZ-3Q-k3-1DvbKYIi2TCtLKgUb0waWY,37726
14
- p3lib/pconfig.py,sha256=ODSIkP902uaSeGj98U4V3-2obZR2fuFAxv_X0j2TvPc,35929
14
+ p3lib/pconfig.py,sha256=KLKS3G6Xc2qgDoDCe1bWHqrl13RwrCXL7j80TWaIZWg,35296
15
15
  p3lib/ssh.py,sha256=klqQ9YuqU8GwPVPHrAJeEs5PI5hgoYiXflq2kIGG3as,39509
16
16
  p3lib/table_plot.py,sha256=RPncwVlGUkkx5Fw0dHQedXo0TSPlTi__VrJBDzaMsuI,32116
17
17
  p3lib/uio.py,sha256=Aaxc99XiE3d2f9vLjaN-bZsckoNxay5t0ujdK6PXGrw,23265
18
- p3lib-1.1.88.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
19
- p3lib-1.1.88.dist-info/METADATA,sha256=Kib55jvHxBRhAlPWpgc7-Y0ZY1j-zmvE2uq2-8rYvkE,918
20
- p3lib-1.1.88.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
21
- p3lib-1.1.88.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
22
- p3lib-1.1.88.dist-info/RECORD,,
18
+ p3lib-1.1.89.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
19
+ p3lib-1.1.89.dist-info/METADATA,sha256=MavcK6Pe6ORhP_GNX2WZ7mNcVMbLgKA7J3KSAFGR_N4,918
20
+ p3lib-1.1.89.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
21
+ p3lib-1.1.89.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
22
+ p3lib-1.1.89.dist-info/RECORD,,
File without changes