From: Dmitry Selyutin Date: Wed, 13 Sep 2017 19:18:03 +0000 (+0300) Subject: filesystem: rename Git into GnulibGit X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=083d14e1932812610a8f9be06a3e9396789cb0c1;p=gnulib.git filesystem: rename Git into GnulibGit --- diff --git a/pygnulib/filesystem.py b/pygnulib/filesystem.py index 5ed9fca2a6..81f17b0381 100644 --- a/pygnulib/filesystem.py +++ b/pygnulib/filesystem.py @@ -81,7 +81,7 @@ class Directory: -class Git(Directory): +class GnulibGit(Directory): """gnulib git repository""" _EXCLUDE_ = { "." : str.startswith, @@ -108,11 +108,19 @@ class Git(Directory): raise TypeError("%r is not a gnulib repository") + def __enter__(self): + return self + + + def __exit__(self, exctype, excval, exctrace): + pass + + def module(self, name, full=True): """instantiate gnulib module by its name""" _type_assert_("name", name, str) _type_assert_("full", full, bool) - if name in Git._EXCLUDE_: + if name in GnulibGit._EXCLUDE_: raise ValueError("illegal module name") path = _os_.path.join(self["modules"], name) return _FileModule_(path, name=name) if full else _BaseModule_(name) @@ -125,7 +133,7 @@ class Git(Directory): names = [] for name in files: exclude = False - for (key, method) in Git._EXCLUDE_.items(): + for (key, method) in GnulibGit._EXCLUDE_.items(): if method(name, key): exclude = True break