Skip to content

Commit e20089c

Browse files
committed
Improve PEP8 compliance
1 parent 9e56e5d commit e20089c

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

tkfilebrowser/filebrowser.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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)