Skip to content

Commit 6fed7c4

Browse files
committed
Merge branch 'fix-#16'
2 parents 490926a + fc8c3dd commit 6fed7c4

3 files changed

Lines changed: 22 additions & 19 deletions

File tree

README.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ filebrowser and the following functions, similar to the one in filedialog:
2121
* ``askopendirnames`` that allow the selection of multiple folders
2222

2323
* ``asksaveasfilename`` that returns a single filename and give a warning if the file already exists
24-
24+
2525

2626
The documentation is also available here: https://tkfilebrowser.readthedocs.io
2727

@@ -32,7 +32,7 @@ Requirements
3232
------------
3333

3434
- Linux or Windows
35-
- Python 2.7 or 3.x
35+
- Python 2.7 or 3.x
3636

3737
And the python packages:
3838

@@ -125,19 +125,22 @@ Documentation
125125
is asked to confirm its replacement.
126126

127127
Additional option:
128-
128+
129129
- defaultext: extension added to filename if none is given (default is none)
130130

131131

132132
Changelog
133133
---------
134134

135+
- tkfilebrowser 2.3.2
136+
* Show networked drives on Windows
137+
135138
- tkfilebrowser 2.3.1
136139
* Fix path bar navigation in Linux
137-
140+
138141
- tkfilebrowser 2.3.0
139142
* Make package compatible with Windows
140-
* Set initial focus on entry in save mode
143+
* Set initial focus on entry in save mode
141144

142145
- tkfilebrowser 2.2.6
143146
* No longer reset path bar when clicking on a path button
@@ -146,9 +149,9 @@ Changelog
146149
- tkfilebrowser 2.2.5
147150
* Add compatibility with Tk < 8.6.0 (requires PIL.ImageTk)
148151
* Add desktop icon in shortcuts
149-
* Fix handling of spaces in bookmarks
152+
* Fix handling of spaces in bookmarks
150153
* Fix bug due to spaces in recent file names
151-
154+
152155
- tkfilebrowser 2.2.4
153156
* Fix bug in desktop folder identification
154157

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
setup(name='tkfilebrowser',
17-
version='2.3.1',
17+
version='2.3.2',
1818
description='File browser for Tkinter, alternative to tkinter.filedialog in linux with GTK bookmarks support.',
1919
long_description=long_description,
2020
url='https://github.com/j4321/tkFileBrowser',

tkfilebrowser/filebrowser.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def __init__(self, parent, initialdir="", initialfile="", mode="openfile",
327327
wrapper.add_tooltip("recent", _("Recently used"))
328328

329329
# -------- devices
330-
devices = psutil.disk_partitions()
330+
devices = psutil.disk_partitions(all=True if OSNAME == "nt" else False)
331331

332332
for d in devices:
333333
m = d.mountpoint
@@ -368,10 +368,10 @@ def __init__(self, parent, initialdir="", initialfile="", mode="openfile",
368368
bm = []
369369
for folder in [shellcon.CSIDL_PERSONAL, shellcon.CSIDL_MYPICTURES,
370370
shellcon.CSIDL_MYMUSIC, shellcon.CSIDL_MYVIDEO]:
371-
try:
372-
bm.append([shell.SHGetFolderPath(0, folder, None, 0)])
373-
except Exception:
374-
pass
371+
try:
372+
bm.append([shell.SHGetFolderPath(0, folder, None, 0)])
373+
except Exception:
374+
pass
375375
else:
376376
path_bm = join(home, ".config", "gtk-3.0", "bookmarks")
377377
path_bm2 = join(home, ".gtk-bookmarks") # old location
@@ -890,7 +890,7 @@ def _completion(self, action, modif, pos, prev_txt):
890890
elif isabs(txt) or self.path_bar.winfo_ismapped():
891891
txt = txt[:int(pos)] + modif + txt[int(pos):]
892892
d, f = split(txt)
893-
if f and not (f[0] is "." and self.hide):
893+
if f and not (f[0] == "." and self.hide):
894894
if not isabs(txt):
895895
d2 = join(self.history[self._hist_index], d)
896896
else:
@@ -900,7 +900,7 @@ def _completion(self, action, modif, pos, prev_txt):
900900
root, dirs, files = walk(d2).send(None)
901901
dirs.sort(key=lambda n: n.lower())
902902
l2 = []
903-
if self.mode is not "opendir":
903+
if self.mode != "opendir":
904904
files.sort(key=lambda n: n.lower())
905905
extension = self.filetypes[self.filetype.get()]
906906
if extension == r".*$":
@@ -1448,7 +1448,7 @@ def _validate_from_entry(self):
14481448
name = join(self.history[self._hist_index], name)
14491449
if not exists(name):
14501450
self.entry.delete(0, "end")
1451-
elif self.mode is "openfile":
1451+
elif self.mode == "openfile":
14521452
if isfile(name):
14531453
if self.multiple_selection:
14541454
self.result = (realpath(name),)
@@ -1472,7 +1472,7 @@ def _validate_from_entry(self):
14721472
def _validate_multiple_sel(self):
14731473
"""Validate selection in open mode with multiple selection."""
14741474
sel = self.right_tree.selection()
1475-
if self.mode is "opendir":
1475+
if self.mode == "opendir":
14761476
if sel:
14771477
self.result = tuple(realpath(s) for s in sel)
14781478
else:
@@ -1499,7 +1499,7 @@ def _validate_multiple_sel(self):
14991499
def _validate_single_sel(self):
15001500
"""Validate selection in open mode without multiple selection."""
15011501
sel = self.right_tree.selection()
1502-
if self.mode is "openfile":
1502+
if self.mode == "openfile":
15031503
if len(sel) == 1:
15041504
sel = sel[0]
15051505
tags = self.right_tree.item(sel, "tags")
@@ -1517,7 +1517,7 @@ def _validate_single_sel(self):
15171517

15181518
def validate(self, event=None):
15191519
"""Validate selection and store it in self.results if valid."""
1520-
if self.mode is "save":
1520+
if self.mode == "save":
15211521
self._validate_save()
15221522
else:
15231523
validation = self._validate_from_entry()

0 commit comments

Comments
 (0)