p3lib 1.1.105__py3-none-any.whl → 1.1.106__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/helper.py CHANGED
@@ -377,3 +377,44 @@ def appendCreateFile(uio, aFile, quiet=False):
377
377
  fd.close()
378
378
  if not quiet:
379
379
  uio.info("Created {}".format(aFile))
380
+
381
+ def getAbsFile(filename):
382
+ """@brief Check that the file exists in several places.
383
+ 1 - The startup folder
384
+ 2 - An 'assets' folder in the startup folder
385
+ 3 - An 'assets' folder in the startup parent folder
386
+ 3 - In an 'assets' folder in a python site-packages folder.
387
+ @param filename The name of the icon file.
388
+ @return The abs path of the file or None if not found."""
389
+ file_found = None
390
+ abs_filename = os.path.abspath(filename)
391
+ if os.path.isfile(abs_filename):
392
+ file_found = abs_filename
393
+
394
+ else:
395
+ startup_file = os.path.abspath(sys.argv[0])
396
+ startup_path = os.path.dirname(startup_file)
397
+ path1 = os.path.join(startup_path, 'assets')
398
+ abs_filename = os.path.join(path1, filename)
399
+ if os.path.isfile(abs_filename):
400
+ file_found = abs_filename
401
+
402
+ else:
403
+ startup_parent_path = os.path.join(startup_path, '..')
404
+ path2 = os.path.join(startup_parent_path, 'assets')
405
+ abs_filename = os.path.join(path2, filename)
406
+ if os.path.isfile(abs_filename):
407
+ file_found = abs_filename
408
+
409
+ else:
410
+ # Try all the site packages folders we know about.
411
+ for path in sys.path:
412
+ if 'site-packages' in path:
413
+ site_packages_path = path
414
+ path3 = os.path.join(site_packages_path, 'assets')
415
+ abs_filename = os.path.join(path3, filename)
416
+ if os.path.isfile(abs_filename):
417
+ file_found = abs_filename
418
+ break
419
+
420
+ return file_found
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: p3lib
3
- Version: 1.1.105
3
+ Version: 1.1.106
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
@@ -7,7 +7,7 @@ p3lib/conduit.py,sha256=jPkjdtyCx2I6SFqcEo8y2g7rgnZ-jNY7oCuYIETzT5Q,6046
7
7
  p3lib/database_if.py,sha256=XKu1w3zftGbj4Rh54wrWJnoCtqHkhCzJUPN2S70XIKg,11915
8
8
  p3lib/file_io.py,sha256=A7_GKYPlmjRjq6U1YuWhmB0OhLhNm6cWQfQX8qfgYTk,5041
9
9
  p3lib/gnome_desktop_app.py,sha256=zl9SKRBV8ipVg2faCs_gbAr8c42J1N_pntbFGG2BMiE,6694
10
- p3lib/helper.py,sha256=xTKPgpziwr4zyaoc0sjZRFr0M91fo7Tok_nSAvtiTZE,12020
10
+ p3lib/helper.py,sha256=RHA0T1ckG3wLgTXgI_1mrtbzvMBaIwd8ow7x9orXUfA,13730
11
11
  p3lib/json_networking.py,sha256=6u4s1SmypjTYPnSxHP712OgQ3ZJaxOqIkgHQ1J7Qews,9738
12
12
  p3lib/mqtt_rpc.py,sha256=6LmFA1kR4HSJs9eWbOJORRHNY01L_lHWjvtE2fmY8P8,10511
13
13
  p3lib/netif.py,sha256=3QV5OGdHhELIf4MBj6mx5MNCtVeZ7JXoNEkeu4KzCaE,9796
@@ -17,8 +17,8 @@ p3lib/pconfig.py,sha256=2yZUK5nkqpAm4Y_xcJq5H9Lxmc8dfYei1Pi0Ek2Crh0,35376
17
17
  p3lib/ssh.py,sha256=OyoAQ_h1L2RfkjTAChDrvLFfl4Fe_gBNdX5rvK-wKiw,42125
18
18
  p3lib/table_plot.py,sha256=RPncwVlGUkkx5Fw0dHQedXo0TSPlTi__VrJBDzaMsuI,32116
19
19
  p3lib/uio.py,sha256=Aaxc99XiE3d2f9vLjaN-bZsckoNxay5t0ujdK6PXGrw,23265
20
- p3lib-1.1.105.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
21
- p3lib-1.1.105.dist-info/METADATA,sha256=Uc29N8eWR5fxCJ3MDRMnytOWcXHl7ds3Uuucw32-oMs,919
22
- p3lib-1.1.105.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
23
- p3lib-1.1.105.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
24
- p3lib-1.1.105.dist-info/RECORD,,
20
+ p3lib-1.1.106.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
21
+ p3lib-1.1.106.dist-info/METADATA,sha256=9J9iWQynI0y14R_UWGiJJg8ZN2LjB2Ey7ZtmvDZBfFA,919
22
+ p3lib-1.1.106.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
23
+ p3lib-1.1.106.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
24
+ p3lib-1.1.106.dist-info/RECORD,,