Mercurial > gnulib
changeset 38794:89b5467819dc
filesystem: simplify names (it is already clear it's filesystem)
author | Dmitry Selyutin <ghostmansd@gmail.com> |
---|---|
date | Sat, 02 Sep 2017 20:19:56 +0300 |
parents | 41a6f4b2018a |
children | bbb468eebacf |
files | pygnulib/filesystem.py |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/pygnulib/filesystem.py Sat Sep 02 20:19:12 2017 +0300 +++ b/pygnulib/filesystem.py Sat Sep 02 20:19:56 2017 +0300 @@ -11,7 +11,7 @@ -class FileSystem: +class Directory: """gnulib generic virtual file system""" _SUBST_ = { "build-aux" : "aux-dir", @@ -23,6 +23,7 @@ "po" : "po-base", } + def __init__(self, root, config): if not isinstance(root, str): raise TypeError("root must be of 'str' type") @@ -50,7 +51,7 @@ parts += [part] continue if not replaced: - for old, new in FileSystem._SUBST_.items(): + for old, new in Directory._SUBST_.items(): if part == old: part = self._config_[new] replaced = True @@ -62,7 +63,7 @@ -class GitFileSystem(FileSystem): +class Git(Directory): """gnulib Git-based virtual file system""" _EXCLUDE_ = { "." : str.startswith, @@ -88,7 +89,7 @@ def module(self, name, full=True): """instantiate gnulib module by its name""" - if name in GitFileSystem._EXCLUDE_: + if name in Git._EXCLUDE_: raise ValueError("illegal module name") path = os.path.join(self["modules"], name) return FileModule(path, name=name) if full else Module(name) @@ -101,7 +102,7 @@ names = [] for name in files: exclude = False - for key, method in GitFileSystem._EXCLUDE_.items(): + for key, method in Git._EXCLUDE_.items(): if method(name, key): exclude = True break