p3lib 1.1.117__tar.gz → 1.1.119__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.
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: p3lib
3
- Version: 1.1.117
3
+ Version: 1.1.119
4
4
  Summary: A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output.
5
- Home-page: https://github.com/pjaos/p3lib
6
5
  License: MIT
7
6
  Author: Paul Austen
8
7
  Author-email: pjaos@gmail.com
@@ -19,6 +18,8 @@ Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Project-URL: Homepage, https://github.com/pjaos/p3lib
22
23
  Project-URL: Repository, https://github.com/pjaos/p3lib
23
24
  Description-Content-Type: text/markdown
24
25
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "p3lib"
3
- version = "1.1.117"
3
+ version = "1.1.119"
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"
@@ -9,8 +9,5 @@ homepage = "https://github.com/pjaos/p3lib"
9
9
  repository = "https://github.com/pjaos/p3lib"
10
10
 
11
11
  [build-system]
12
- requires = [
13
- "setuptools>=42",
14
- "wheel"
15
- ]
16
- build-backend = "setuptools.build_meta"
12
+ requires = ["poetry-core>=1.0.0"]
13
+ build-backend = "poetry.core.masonry.api"
@@ -389,7 +389,8 @@ def getAbsFile(filename):
389
389
  @param filename The name of the icon file.
390
390
  @return The abs path of the file or None if not found."""
391
391
  file_found = None
392
- abs_filename = os.path.abspath(filename)
392
+ startup_path = os.getenv("PWD", os.getcwd())
393
+ abs_filename = os.path.join(startup_path, filename)
393
394
  if os.path.isfile(abs_filename):
394
395
  file_found = abs_filename
395
396
 
@@ -414,7 +415,6 @@ def getAbsFile(filename):
414
415
  if 'site-packages' in path:
415
416
  site_packages_path = path
416
417
  abs_filename = os.path.join(site_packages_path, filename)
417
- print(f"PJA: abs_filename={abs_filename}, FOUND={os.path.isfile(abs_filename)}")
418
418
  if os.path.isfile(abs_filename):
419
419
  file_found = abs_filename
420
420
 
@@ -858,6 +858,12 @@ class local_file_picker(ui.dialog):
858
858
  :param show_hidden_files: Whether to show hidden files.
859
859
  """
860
860
  super().__init__()
861
+ self._selected_drive = None
862
+ # If on a Windows platform attempt to separate the drive and the directory
863
+ if platform.system() == 'Windows' and directory and len(directory) >= 2:
864
+ if directory[0].isalpha() and directory[1] == ':':
865
+ self._selected_drive = directory[:2]
866
+ directory = directory[2:] + "\\\\"
861
867
 
862
868
  self.path = Path(directory).expanduser()
863
869
  if upper_limit is None:
@@ -884,7 +890,13 @@ class local_file_picker(ui.dialog):
884
890
  if platform.system() == 'Windows':
885
891
  import win32api
886
892
  drives = win32api.GetLogicalDriveStrings().split('\000')[:-1]
887
- self.drives_toggle = ui.toggle(drives, value=drives[0], on_change=self.update_drive)
893
+ drive = drives[0]
894
+ # If the caller passed a drive letter select this drive
895
+ if self._selected_drive:
896
+ for drive in drives:
897
+ if drive.startswith(self._selected_drive):
898
+ break
899
+ self.drives_toggle = ui.toggle(drives, value=drive, on_change=self.update_drive)
888
900
 
889
901
  def update_drive(self):
890
902
  self.path = Path(self.drives_toggle.value).expanduser()
@@ -917,4 +929,11 @@ class local_file_picker(ui.dialog):
917
929
  if self.path.is_dir() and not self._select_folder_checkbox.value:
918
930
  self.update_grid()
919
931
  else:
920
- self.submit([str(self.path)])
932
+ selected = str(self.path)
933
+ # If Windows platform add the drive letter to the path
934
+ if platform.system() == 'Windows':
935
+ if selected.startswith('\\'):
936
+ selected=selected[1:]
937
+ selected = self.drives_toggle.value + selected
938
+
939
+ 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