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

Sascha Silbe sascha-ml-reply-to-2011-3 at silbe.org
Sat Jul 2 13:19:22 EDT 2011


Excerpts from Walter Bender's message of Mon Jun 06 20:26:09 +0200 2011:

[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', '~')):

We're bound to want to ignore a lot more files in the future, so we
should make this a global list of glob patterns. A few patterns that
come to my mind (after checking a few .gitignore files):

*.o
*.a
*.la
*.tar*
.libs
.deps
*.xo


Support for .gitignore would be nice, too. But we can add that later.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 500 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110702/a7ae58ea/attachment.pgp>


More information about the Sugar-devel mailing list