Allow add_to_project() to take generator for node types

This commit is contained in:
2016-11-01 13:57:04 +01:00
parent ab9d5c1793
commit 656944f1ce

View File

@@ -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']