Allow add_to_project() to take generator for node types
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
|
import types
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -61,7 +62,8 @@ def add_to_project(project, node_types, replace_existing):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
assert isinstance(project, dict)
|
assert isinstance(project, dict)
|
||||||
assert isinstance(node_types, (list, set, frozenset, tuple))
|
assert isinstance(node_types, (list, set, frozenset, tuple, types.GeneratorType)), \
|
||||||
|
'node_types is of wrong type %s' % type(node_types)
|
||||||
|
|
||||||
project_id = project['_id']
|
project_id = project['_id']
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user