Field(DCNS('language'), 'language', required=False),
Field(DCNS('subject.period'), 'epochs', salias='epoch', multiple=True),
Field(DCNS('subject.type'), 'kinds', salias='kind', multiple=True),
Field(DCNS('language'), 'language', required=False),
Field(DCNS('subject.period'), 'epochs', salias='epoch', multiple=True),
Field(DCNS('subject.type'), 'kinds', salias='kind', multiple=True),
- Field(DCNS('subject.genre'), 'genres', salias='genre', multiple=True, required=False),
- Field(DCNS('subject.style'), 'styles', salias='style', multiple=True, required=False),
+ Field(DCNS('subject.genre'), 'genres', salias='genre', multiple=True,
+ required=False),
+ Field(DCNS('subject.style'), 'styles', salias='style', multiple=True,
+ required=False),
Field(DCNS('format.dimensions'), 'dimensions', required=False),
Field(DCNS('format.checksum.sha1'), 'sha1', required=True),
Field(DCNS('description.medium'), 'medium', required=False),
Field(DCNS('format.dimensions'), 'dimensions', required=False),
Field(DCNS('format.checksum.sha1'), 'sha1', required=True),
Field(DCNS('description.medium'), 'medium', required=False),
- Field(DCNS('description.dimensions'), 'original_dimensions', required=False),
+ Field(DCNS('description.dimensions'), 'original_dimensions',
+ required=False),
Field(DCNS('format'), 'mime_type', required=False),
Field(DCNS('format'), 'mime_type', required=False),
- Field(DCNS('identifier.url'), 'url', WLPictureURI, strict=as_wlpictureuri_strict)
+ Field(DCNS('identifier.url'), 'url', WLPictureURI,
+ strict=as_wlpictureuri_strict)
MIME = ['image/gif', 'image/jpeg', 'image/png',
'application/x-shockwave-flash', 'image/psd', 'image/bmp',
'image/tiff', 'image/tiff', 'application/octet-stream',
MIME = ['image/gif', 'image/jpeg', 'image/png',
'application/x-shockwave-flash', 'image/psd', 'image/bmp',
'image/tiff', 'image/tiff', 'application/octet-stream',
- 'image/jp2', 'application/octet-stream', 'application/octet-stream',
- 'application/x-shockwave-flash', 'image/iff', 'image/vnd.wap.wbmp', 'image/xbm']
+ 'image/jp2', 'application/octet-stream',
+ 'application/octet-stream', 'application/x-shockwave-flash',
+ 'image/iff', 'image/vnd.wap.wbmp', 'image/xbm']
def __init__(self, dir_):
super(ImageStore, self).__init__()
def __init__(self, dir_):
super(ImageStore, self).__init__()
parser = etree.XMLParser(remove_blank_text=False)
tree = etree.parse(six.BytesIO(data.encode('utf-8')), parser)
parser = etree.XMLParser(remove_blank_text=False)
tree = etree.parse(six.BytesIO(data.encode('utf-8')), parser)
- me = cls(tree, parse_dublincore=parse_dublincore, image_store=image_store)
+ me = cls(tree, parse_dublincore=parse_dublincore,
+ image_store=image_store)
return [[0, 0], [-1, -1]]
def has_all_props(node, props):
return [[0, 0], [-1, -1]]
def has_all_props(node, props):
- return reduce(and_, map(lambda prop: prop in node.attrib, props))
+ return six.moves.reduce(
+ and_, map(lambda prop: prop in node.attrib, props)
+ )
if not has_all_props(area, ['x1', 'x2', 'y1', 'y2']):
return None
if not has_all_props(area, ['x1', 'x2', 'y1', 'y2']):
return None
"""
# omg no support for //sem[(@type='theme') or (@type='object')] ?
for part in list(self.edoc.iterfind("//sem[@type='theme']")) +\
"""
# omg no support for //sem[(@type='theme') or (@type='object')] ?
for part in list(self.edoc.iterfind("//sem[@type='theme']")) +\
- pd['object'] = part.attrib['type'] == 'object' and want_unicode(part.attrib.get('object', u'')) or None
- pd['themes'] = part.attrib['type'] == 'theme' and [part.attrib.get('theme', u'')] or []
+ pd['object'] = (
+ part.attrib['type'] == 'object'
+ and want_unicode(part.attrib.get('object', u''))
+ or None
+ )
+ pd['themes'] = (
+ part.attrib['type'] == 'theme'
+ and [part.attrib.get('theme', u'')]
+ or []
+ )