From b1ddcfa7eec738cc987cc92edd8f7e6362999e4d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 1 Mar 2014 10:02:32 +0530 Subject: [PATCH] Make the raw unique identifier field available --- src/calibre/ebooks/metadata/opf2.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/opf2.py b/src/calibre/ebooks/metadata/opf2.py index 2cd6df487c..319a72f694 100644 --- a/src/calibre/ebooks/metadata/opf2.py +++ b/src/calibre/ebooks/metadata/opf2.py @@ -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'): @@ -1115,7 +1115,13 @@ class OPF(object): # {{{ for m in matches: raw = m.text 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 def page_progression_direction(self):