def upgrade_timestamp(root, data): for meta in XPath('./opf:metadata/opf:meta[@name="calibre:timestamp"]')(root): m = meta.getparent() remove_element(meta, data.refines) val = meta.get('content') if val: try: val = parse_date(val, is_w3cdtf=True) except Exception: pass else: create_timestamp(root, data.prefixes, m, val)
def upgrade_timestamp(root, data): for meta in XPath('./opf:metadata/opf:meta[@name="calibre:timestamp"]')(root): m = meta.getparent() remove_element(meta, data.refines) val = meta.get('content') if val: try: val = parse_date(val, is_w3cdtf=True) except Exception: pass else: create_timestamp(root, data.prefixes, m, val)