Fixed emf handling of bad definitions
This commit is contained in:
parent
09a8dfefc1
commit
027153b882
1 changed files with 8 additions and 0 deletions
|
@ -74,6 +74,7 @@ class MetadataElement(Loggable):
|
||||||
# If value is present and normalized then we only check if it's
|
# If value is present and normalized then we only check if it's
|
||||||
# normalized or not. We normalize if it's not normalized already
|
# normalized or not. We normalize if it's not normalized already
|
||||||
|
|
||||||
|
|
||||||
if self.name in original:
|
if self.name in original:
|
||||||
v = original[self.name]
|
v = original[self.name]
|
||||||
if self.__is_normalized(v): return v
|
if self.__is_normalized(v): return v
|
||||||
|
@ -141,11 +142,18 @@ def normalize_mutagen(path):
|
||||||
md['path'] = path
|
md['path'] = path
|
||||||
return md
|
return md
|
||||||
|
|
||||||
|
|
||||||
|
class OverwriteMetadataElement(Exception):
|
||||||
|
def __init__(self, m): self.m = m
|
||||||
|
def __str__(self): return "Trying to overwrite: %s" % self.m
|
||||||
|
|
||||||
class MetadataReader(object):
|
class MetadataReader(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.clear()
|
self.clear()
|
||||||
|
|
||||||
def register_metadata(self,m):
|
def register_metadata(self,m):
|
||||||
|
if m in self.__mdata_name_map:
|
||||||
|
raise OverwriteMetadataElement(m)
|
||||||
self.__mdata_name_map[m.name] = m
|
self.__mdata_name_map[m.name] = m
|
||||||
d = dict( (name,m.dependencies()) for name,m in
|
d = dict( (name,m.dependencies()) for name,m in
|
||||||
self.__mdata_name_map.iteritems() )
|
self.__mdata_name_map.iteritems() )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue