p3lib 1.1.118__py2.py3-none-any.whl → 1.1.120__py2.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/ngt.py
CHANGED
@@ -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
|
-
|
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
|
-
|
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])
|
@@ -13,12 +13,12 @@ p3lib/login.html,sha256=DADTJGuvWQ-LTO4X6SaFdqK7JMW03DAa3lRieGD0d6g,2748
|
|
13
13
|
p3lib/mqtt_rpc.py,sha256=6LmFA1kR4HSJs9eWbOJORRHNY01L_lHWjvtE2fmY8P8,10511
|
14
14
|
p3lib/netif.py,sha256=3QV5OGdHhELIf4MBj6mx5MNCtVeZ7JXoNEkeu4KzCaE,9796
|
15
15
|
p3lib/netplotly.py,sha256=PMDx-w1jtRVW6Od5u_kuKbBxNpTS_Y88mMF60puMxLM,9363
|
16
|
-
p3lib/ngt.py,sha256=
|
16
|
+
p3lib/ngt.py,sha256=N8y0C9q4cMlzTPiHiaInGBu03dKYhfKR6KotVDJOTm0,43340
|
17
17
|
p3lib/pconfig.py,sha256=wGC6UJAIBksRjwKTfaw3Y6vAMkgey0QC2nhkCtqj1MQ,37738
|
18
18
|
p3lib/ssh.py,sha256=OyoAQ_h1L2RfkjTAChDrvLFfl4Fe_gBNdX5rvK-wKiw,42125
|
19
19
|
p3lib/table_plot.py,sha256=RPncwVlGUkkx5Fw0dHQedXo0TSPlTi__VrJBDzaMsuI,32116
|
20
20
|
p3lib/uio.py,sha256=Aaxc99XiE3d2f9vLjaN-bZsckoNxay5t0ujdK6PXGrw,23265
|
21
|
-
p3lib-1.1.
|
22
|
-
p3lib-1.1.
|
23
|
-
p3lib-1.1.
|
24
|
-
p3lib-1.1.
|
21
|
+
p3lib-1.1.120.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
|
22
|
+
p3lib-1.1.120.dist-info/METADATA,sha256=bPzcexms-odMwfMwbEP9YYbcISjbBZKBa-L-cICEZgc,1382
|
23
|
+
p3lib-1.1.120.dist-info/WHEEL,sha256=5druYqcII7zHXzX7qmN0TH895Jg3yuTtfjMgJIVBrKE,92
|
24
|
+
p3lib-1.1.120.dist-info/RECORD,,
|
File without changes
|
File without changes
|