提交 e0749882 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Flake8 for gof/optdb.py

上级 e810b0b7
...@@ -32,7 +32,7 @@ class DB(object): ...@@ -32,7 +32,7 @@ class DB(object):
self.__db__ = DefaultOrderedDict(OrderedSet) self.__db__ = DefaultOrderedDict(OrderedSet)
self._names = set() self._names = set()
self.name = None # will be reset by register self.name = None # will be reset by register
#(via obj.name by the thing doing the registering) # (via obj.name by the thing doing the registering)
def register(self, name, obj, *tags, **kwargs): def register(self, name, obj, *tags, **kwargs):
""" """
...@@ -175,8 +175,10 @@ class Query(object): ...@@ -175,8 +175,10 @@ class Query(object):
self.exclude = OrderedSet(self.exclude) self.exclude = OrderedSet(self.exclude)
def __str__(self): def __str__(self):
return "Query{inc=%s,ex=%s,require=%s,subquery=%s,position_cutoff=%d}" % ( return ("Query{inc=%s,ex=%s,require=%s,subquery=%s,"
self.include, self.exclude, self.require, self.subquery, self.position_cutoff) "position_cutoff=%d}" %
(self.include, self.exclude, self.require, self.subquery,
self.position_cutoff))
# add all opt with this tag # add all opt with this tag
def including(self, *tags): def including(self, *tags):
...@@ -268,7 +270,7 @@ class SequenceDB(DB): ...@@ -268,7 +270,7 @@ class SequenceDB(DB):
position_cutoff = kwtags.pop('position_cutoff', position_cutoff = kwtags.pop('position_cutoff',
config.optdb.position_cutoff) config.optdb.position_cutoff)
if len(tags) >= 1 and isinstance(tags[0], Query): if len(tags) >= 1 and isinstance(tags[0], Query):
# the call to super should have raise an error with a good message # the call to super should have raise an error with a good message
assert len(tags) == 1 assert len(tags) == 1
if getattr(tags[0], 'position_cutoff', None): if getattr(tags[0], 'position_cutoff', None):
position_cutoff = tags[0].position_cutoff position_cutoff = tags[0].position_cutoff
......
...@@ -269,7 +269,6 @@ whitelist_flake8 = [ ...@@ -269,7 +269,6 @@ whitelist_flake8 = [
"sparse/sandbox/sp.py", "sparse/sandbox/sp.py",
"gof/destroyhandler.py", "gof/destroyhandler.py",
"gof/unify.py", "gof/unify.py",
"gof/optdb.py",
"gof/utils.py", "gof/utils.py",
"gof/graph.py", "gof/graph.py",
"gof/callcache.py", "gof/callcache.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论