Mercurial > gnulib
changeset 39034:092ea8d7ef06
vfs: rename 'kwargs' argument to 'table'
author | Dmitry Selyutin <ghostmansd@gmail.com> |
---|---|
date | Tue, 17 Oct 2017 23:44:42 +0300 |
parents | d12ca012cd9d |
children | 7697d384889d |
files | pygnulib/vfs.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/pygnulib/vfs.py Tue Oct 17 22:26:03 2017 +0300 +++ b/pygnulib/vfs.py Tue Oct 17 23:44:42 2017 +0300 @@ -20,10 +20,10 @@ class Base: """gnulib generic virtual file system""" - def __init__(self, path, **kwargs): + def __init__(self, path, **table): _type_assert_("path", path, str) self.__table = {} - for (key, value) in kwargs.items(): + for (key, value) in table.items(): _type_assert_(key, value, str) self.__table[key] = _os_.path.normpath(value) self.__path = path @@ -50,7 +50,7 @@ replaced = False path = _os_.path.normpath(name) if _os_.path.isabs(path): - raise ValueError("name must be a relative path") + raise ValueError("name cannot be an absolute path") for part in path.split(_os_.path.sep): if part == "..": parts += [part] @@ -84,13 +84,13 @@ } - def __init__(self, name, **kwargs): + def __init__(self, name, **table): path = _os_.path.realpath(name) if not _os_.path.exists(path): raise FileNotFoundError(path) if not _os_.path.isdir(path): raise NotADirectoryError(path) - super().__init__(name, **kwargs) + super().__init__(name, **table) if not _os_.path.isdir(_os_.path.join(self.path, ".git")): raise TypeError("{} is not a gnulib repository".format(self.path))