p3lib 1.1.118__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,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: p3lib
3
- Version: 1.1.118
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
5
  License: MIT
6
6
  Author: Paul Austen
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "p3lib"
3
- version = "1.1.118"
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"
@@ -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
File without changes