Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2009-02-17 10:58:14 (GMT)
committer Simon Schampijer <simon@schampijer.de>2009-02-17 10:58:14 (GMT)
commit07ff22491cf53e11b4f365e1b8b5ed0746262a2b (patch)
tree0aa26a635d3551074e9e34a30ea071e7da5b20df /extensions
parented205aaadab2f6a4e89c7d46208440757a8bb28e (diff)
View Source: Hide Python Bytecode files #361
Diffstat (limited to 'extensions')
-rw-r--r--extensions/globalkey/viewsource.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/extensions/globalkey/viewsource.py b/extensions/globalkey/viewsource.py
index 86356a7..3ad5498 100644
--- a/extensions/globalkey/viewsource.py
+++ b/extensions/globalkey/viewsource.py
@@ -292,12 +292,13 @@ class FileViewer(gtk.ScrolledWindow):
def _add_dir_to_model(self, dir_path, parent=None):
model = self._tree_view.get_model()
for f in os.listdir(dir_path):
- full_path = os.path.join(dir_path, f)
- if os.path.isdir(full_path):
- new_iter = model.append(parent, [f, full_path])
- self._add_dir_to_model(full_path, new_iter)
- else:
- model.append(parent, [f, full_path])
+ if not f.endswith('.pyc'):
+ full_path = os.path.join(dir_path, f)
+ if os.path.isdir(full_path):
+ new_iter = model.append(parent, [f, full_path])
+ self._add_dir_to_model(full_path, new_iter)
+ else:
+ model.append(parent, [f, full_path])
def __selection_changed_cb(self, selection):
model, tree_iter = selection.get_selected()