# HG changeset patch # User Denis Laxalde # Date 1553602093 -3600 # Node ID bbbccb0b3a66c3e866b75a67a2337c1953d72025 # Parent 623e9dd2977f5e7cd11f62c6cf3f766972ad479c Flake8 cubicweb/cwvreg.py diff -r 623e9dd2977f -r bbbccb0b3a66 cubicweb/cwvreg.py --- a/cubicweb/cwvreg.py Fri Mar 22 17:32:30 2019 +0100 +++ b/cubicweb/cwvreg.py Tue Mar 26 13:08:13 2019 +0100 @@ -127,7 +127,7 @@ def register(self, obj, **kwargs): obj = related_appobject(obj) oid = kwargs.get('oid') or obj.__regid__ - if oid != 'Any' and not oid in self.schema: + if oid != 'Any' and oid not in self.schema: self.error('don\'t register %s, %s type not defined in the ' 'schema', obj, oid) return @@ -252,7 +252,7 @@ if rset is None: actions = self.poss_visible_objects(req, rset=rset, **kwargs) else: - actions = rset.possible_actions(**kwargs) # cached implementation + actions = rset.possible_actions(**kwargs) # cached implementation result = {} for action in actions: result.setdefault(action.category, []).append(action) @@ -361,12 +361,14 @@ def items(self): return [item for item in super(CWRegistryStore, self).items() if not item[0] in ('propertydefs', 'propertyvalues')] + def iteritems(self): return (item for item in super(CWRegistryStore, self).items() if not item[0] in ('propertydefs', 'propertyvalues')) def values(self): return [value for key, value in self.items()] + def itervalues(self): return (value for key, value in self.items()) @@ -461,7 +463,7 @@ # bad class reference pb after reloading cfg = self.config for cube in cfg.expand_cubes(cubes, with_recommends=True): - if not cube in cubes: + if cube not in cubes: cube_modnames = cfg.appobjects_cube_modnames(cube) self._cleanup_sys_modules(cube_modnames) self.register_modnames(modnames) @@ -537,7 +539,7 @@ registry.objid(obj), ' or '.join(regids), regname) self.unregister(obj) super(CWRegistryStore, self).initialization_completed() - if 'uicfg' in self: # 'uicfg' is not loaded in a pure repository mode + if 'uicfg' in self: # 'uicfg' is not loaded in a pure repository mode for rtags in self['uicfg'].values(): for rtag in rtags: # don't check rtags if we don't want to cleanup_unused_appobjects @@ -616,8 +618,8 @@ vocab = pdef['vocabulary'] if vocab is not None: if callable(vocab): - vocab = vocab(None) # XXX need a req object - if not value in vocab: + vocab = vocab(None) # XXX need a req object + if value not in vocab: raise ValueError(_('unauthorized value')) return value @@ -640,11 +642,11 @@ # XXX unify with yams.constraints.BASE_CONVERTERS? YAMS_TO_PY = BASE_CONVERTERS.copy() YAMS_TO_PY.update({ - 'Bytes': Binary, - 'Date': date, - 'Datetime': datetime, + 'Bytes': Binary, + 'Date': date, + 'Datetime': datetime, 'TZDatetime': datetime, - 'Time': time, - 'TZTime': time, - 'Interval': timedelta, - }) + 'Time': time, + 'TZTime': time, + 'Interval': timedelta, +}) diff -r 623e9dd2977f -r bbbccb0b3a66 flake8-ok-files.txt --- a/flake8-ok-files.txt Fri Mar 22 17:32:30 2019 +0100 +++ b/flake8-ok-files.txt Tue Mar 26 13:08:13 2019 +0100 @@ -1,6 +1,7 @@ cubicweb/__init__.py cubicweb/__main__.py cubicweb/cwctl.py +cubicweb/cwvreg.py cubicweb/dataimport/csv.py cubicweb/dataimport/importer.py cubicweb/dataimport/massive_store.py