Make the raw unique identifier field available

This commit is contained in:
Kovid Goyal 2014-03-01 10:02:32 +05:30
parent ffc4cadf39
commit b1ddcfa7ee

View File

@ -1103,7 +1103,7 @@ class OPF(object): # {{{
yield item
@property
def unique_identifier(self):
def raw_unique_identifier(self):
uuid_elem = None
for attr in self.root.attrib:
if attr.endswith('unique-identifier'):
@ -1114,6 +1114,12 @@ class OPF(object): # {{{
if matches:
for m in matches:
raw = m.text
if raw:
return raw
@property
def unique_identifier(self):
raw = self.raw_unique_identifier
if raw:
return raw.rpartition(':')[-1]