[Sugar-devel] [PATCH] prevent view source display of .pyo, .pyc, .so files (#2854)

Walter Bender walter at sugarlabs.org
Mon Jun 6 14:26:09 EDT 2011


From: Walter Bender <walter.bender at gmail.com>

---
 src/jarabe/view/viewsource.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/view/viewsource.py b/src/jarabe/view/viewsource.py
index a1c0be3..c7e6247 100644
--- a/src/jarabe/view/viewsource.py
+++ b/src/jarabe/view/viewsource.py
@@ -388,8 +388,7 @@ 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):
-            if not f.endswith('.pyc'):
+            if not f.endswith(('.pyc', '.pyo', '.so', '~')):
                 full_path = os.path.join(dir_path, f)
                 if os.path.isdir(full_path):
                     new_iter = model.append(parent, [f, full_path])
-- 
1.7.4.4



More information about the Sugar-devel mailing list