from .module_info import ModuleInfo
-__version__ = '0.1.2'
+__version__ = '0.1.3'
LOG = logging.getLogger(__name__)
del self._map[full_name]
+ # -------------------------------------------------------------------------
+ def merge(self, item):
+
+ if not isinstance(item, ModuleInfo):
+ raise TypeError(self.msg_invalid_modinfo_type.format(item.__class__.__name__))
+
+ full_name = item.full_name
+ if full_name in self._map.keys():
+ if self.verbose > 2:
+ LOG.debug("Merging module {!r}.".format(full_name))
+ self._map[full_name].merge_in(item)
+ else:
+ if self.verbose > 2:
+ LOG.debug("New module {!r}.".format(full_name))
+ self._set_item(full_name, item)
+
# -------------------------------------------------------------------------
# The next five methods are requirements of the ABC.
def __setitem__(self, key, value):
if full_name == '':
raise ValueError(self.msg_empty_key_error.format(key))
+ if self.verbose > 4:
+ LOG.debug("Searching for key {!r} ...".format(key))
+
return full_name in self._map
# -------------------------------------------------------------------------