minor PEP8 cleanup (" -> ')
This commit is contained in:
parent
6416b66f6e
commit
61fb3b1044
18 changed files with 456 additions and 456 deletions
|
@ -24,7 +24,7 @@ cdef class Aggregate:
|
|||
def _link_module(Aggregate self, Module module):
|
||||
# check for name (=type) collision
|
||||
if module._name in self._modules.keys():
|
||||
raise ModuleCollision(module._name, None, "name", None)
|
||||
raise ModuleCollision(module._name, None, 'name', None)
|
||||
|
||||
# check if requirements are satisfied
|
||||
unsatisfied_deps = module._requires - set(self._provided.keys())
|
||||
|
@ -36,10 +36,10 @@ cdef class Aggregate:
|
|||
common_collisions = {nc for nc in new_commons if nc in self._attrs and not nc in self._common.keys()}
|
||||
if common_collisions:
|
||||
colliding_module_names = {self._attrs[x]._name for x in common_collisions}
|
||||
raise ModuleCollision(module._name, colliding_module_names, "non-common method", common_collisions)
|
||||
raise ModuleCollision(module._name, colliding_module_names, 'non-common method', common_collisions)
|
||||
|
||||
# check for an attr collision
|
||||
module_attrs = {x for x in dir(module) if x[0] != "_"}
|
||||
module_attrs = {x for x in dir(module) if x[0] != '_'}
|
||||
attr_collisions = (module_attrs - module._common) & (set(self._attrs.keys()) | set(self._common.keys()))
|
||||
if attr_collisions:
|
||||
colliding_module_names = set()
|
||||
|
@ -50,13 +50,13 @@ cdef class Aggregate:
|
|||
if collision in self._common:
|
||||
colliding_module_names.add(self._common[collision]._name)
|
||||
|
||||
raise ModuleCollision(module._name, colliding_module_names, "attribute", attr_collisions)
|
||||
raise ModuleCollision(module._name, colliding_module_names, 'attribute', attr_collisions)
|
||||
|
||||
# check for a provided keyword collision
|
||||
provided_collisions = module._provides & set(self._provided.keys())
|
||||
if provided_collisions:
|
||||
colliding_module_names = {self._provided[x]._name for x in provided_collisions}
|
||||
raise ModuleCollision(module._name, colliding_module_names, "provided keyword", provided_collisions)
|
||||
raise ModuleCollision(module._name, colliding_module_names, 'provided keyword', provided_collisions)
|
||||
|
||||
# link the module
|
||||
self._modules[module._name] = module
|
||||
|
@ -81,7 +81,7 @@ cdef class Aggregate:
|
|||
module._top = self
|
||||
|
||||
# call the module's _on_link method, if it has one
|
||||
if hasattr(module, "_on_link"):
|
||||
if hasattr(module, '_on_link'):
|
||||
module._on_link()
|
||||
|
||||
def _unlink_module(Aggregate self, str module_name):
|
||||
|
@ -142,19 +142,19 @@ cdef class Aggregate:
|
|||
module_count = len(self._modules)
|
||||
|
||||
if module_count:
|
||||
lines = ["Aggregate("]
|
||||
lines = ['Aggregate(']
|
||||
|
||||
|
||||
for i, module in enumerate(self._modules.values()):
|
||||
if i + 1 < module_count:
|
||||
comma = ","
|
||||
comma = ','
|
||||
else:
|
||||
comma = ""
|
||||
comma = ''
|
||||
|
||||
lines.append(" %s%s" %(repr(module), comma))
|
||||
lines.append(' %s%s' %(repr(module), comma))
|
||||
|
||||
lines.append(")")
|
||||
lines.append(')')
|
||||
|
||||
return "\n".join(lines)
|
||||
return '\n'.join(lines)
|
||||
else:
|
||||
return "Aggregate()"
|
||||
return 'Aggregate()'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue