comparison documentViewer.py @ 468:dc7c48912110 elementtree

attribution and copyright works mostly now
author casties
date Tue, 02 Aug 2011 18:29:15 +0200
parents 8b75d55582e8
children 15394486ab75
comparison
equal deleted inserted replaced
467:8b75d55582e8 468:dc7c48912110
462 462
463 docinfo['documentUrl'] = docUrl 463 docinfo['documentUrl'] = docUrl
464 # process index.meta contents 464 # process index.meta contents
465 if metaDom is not None: 465 if metaDom is not None:
466 # document directory name and path 466 # document directory name and path
467 logging.debug("RESOURCE: %s"%repr(self.metadataService.resource.getData(dom=metaDom,recursive=1))) 467 logging.debug("RESOURCE: %s"%repr(self.metadataService.resource.meta.getData(dom=metaDom, all=True, recursive=2)))
468 resource = self.metadataService.getResourceData(dom=metaDom) 468 resource = self.metadataService.getResourceData(dom=metaDom)
469 if resource: 469 if resource:
470 docinfo = self.getDocinfoFromResource(docinfo, resource) 470 docinfo = self.getDocinfoFromResource(docinfo, resource)
471 471
472 # texttool info 472 # texttool info
563 563
564 # new style text-url-path 564 # new style text-url-path
565 textUrl = texttool.get('text-url-path', None) 565 textUrl = texttool.get('text-url-path', None)
566 if textUrl: 566 if textUrl:
567 docinfo['textURLPath'] = textUrl 567 docinfo['textURLPath'] = textUrl
568 #TODO: ugly: 568
569 #textUrlkurz = string.split(textUrl, ".")[0] 569 # page flow
570 #docinfo['textURLPathkurz'] = textUrlkurz 570 docinfo['pageFlow'] = texttool.get('page-flow', 'ltr')
571
572 # odd pages are left
573 docinfo['oddPage'] = texttool.get('odd-scan-orientation', 'left')
574
575 # number of title page
576 docinfo['titlePage'] = texttool.get('title-scan-no', 0)
571 577
572 # old presentation stuff 578 # old presentation stuff
573 presentation = texttool.get('presentation', None) 579 presentation = texttool.get('presentation', None)
574 if presentation and docPath: 580 if presentation and docPath:
575 if presentation.startswith('http:'): 581 if presentation.startswith('http:'):
576 docinfo['presentationUrl'] = presentation 582 docinfo['presentationUrl'] = presentation
577 else: 583 else:
578 docinfo['presentationUrl'] = os.path.join(docPath, presentation) 584 docinfo['presentationUrl'] = os.path.join(docPath, presentation)
579 585
586
580 return docinfo 587 return docinfo
581 588
582 def getDocinfoFromBib(self, docinfo, bib): 589 def getDocinfoFromBib(self, docinfo, bib):
583 """reads contents of bib element into docinfo""" 590 """reads contents of bib element into docinfo"""
584 logging.debug("getDocinfoFromBib bib=%s"%repr(bib)) 591 logging.debug("getDocinfoFromBib bib=%s"%repr(bib))