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 yield item
@property @property
def unique_identifier(self): def raw_unique_identifier(self):
uuid_elem = None uuid_elem = None
for attr in self.root.attrib: for attr in self.root.attrib:
if attr.endswith('unique-identifier'): if attr.endswith('unique-identifier'):
@ -1115,7 +1115,13 @@ class OPF(object): # {{{
for m in matches: for m in matches:
raw = m.text raw = m.text
if raw: if raw:
return raw.rpartition(':')[-1] return raw
@property
def unique_identifier(self):
raw = self.raw_unique_identifier
if raw:
return raw.rpartition(':')[-1]
@property @property
def page_progression_direction(self): def page_progression_direction(self):