From: Dmitry Selyutin Date: Sun, 22 Oct 2017 20:18:12 +0000 (+0300) Subject: module: simplify file table generation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f437557d5d3c5ca10347ab93eb0f6953f6f62ce9;p=thirdparty%2Fgnulib.git module: simplify file table generation --- diff --git a/pygnulib/module.py b/pygnulib/module.py index dfdf7de5f1..4e839046fa 100644 --- a/pygnulib/module.py +++ b/pygnulib/module.py @@ -387,10 +387,8 @@ class Base: class File(Base): """gnulib module text file""" - _TABLE = {} - for (_key, (_, _typeid, _value)) in Base._TABLE.items(): - _TABLE[_value] = (_typeid, _key) - _FIELDS = [field for (_, _, field) in Base._TABLE.values()] + _TABLE = {_value[2]:(_value[1], _key) for (_key, _value) in Base._TABLE.items()} + _FIELDS = [_field for (_, _, _field) in Base._TABLE.values()] _PATTERN = _re.compile("({}):".format("|".join(_FIELDS)))