Excerpts from Walter Bender's message of Mon Jul 04 12:37:00 +0200 2011:

[src/jarabe/view/viewsource.py]
> +_EXCLUDE = ('.pyc', '.pyo', '.so', '.o', '.a', '.la', '.mo', '~', '.xo',
> +            '.tar', '.bz2', '.zip', '.gz', '.deps', '.libs')

.deps and .libs are the exact names of directories. So how about
renaming _EXCLUDE above to _EXCLUDE_EXTENSIONS and adding _EXCLUDE_NAMES
= ['.deps', '.libs'] ?


> @@ -388,7 +392,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(_EXCLUDE):

Nice trick. Didn't know that endswith() takes a tuple of candidates.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Sugar-devel mailing list
[email protected]
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to