Allow programatic definitions to contain multiple lines (one definition per line)
Close #462
This commit is contained in:
parent
a82a6331af
commit
790634dcf6
|
@ -225,9 +225,10 @@ class BaseRegistry(meta.with_metaclass(_Meta)):
|
|||
"""
|
||||
|
||||
if isinstance(definition, string_types):
|
||||
definition = Definition.from_string(definition)
|
||||
|
||||
self._define(definition)
|
||||
for line in definition.split('\n'):
|
||||
self._define(Definition.from_string(line))
|
||||
else:
|
||||
self._define(definition)
|
||||
|
||||
def _define(self, definition):
|
||||
"""Add unit to the registry.
|
||||
|
|
Loading…
Reference in New Issue