Changeset 70:0049d64aa464 in documentViewer
- Timestamp:
- Nov 4, 2008, 7:51:35 PM (16 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r68 r70 333 333 334 334 335 def getAuthinfoFromIndexMeta(self,path,docinfo=None,dom=None ):335 def getAuthinfoFromIndexMeta(self,path,docinfo=None,dom=None,cut=0): 336 336 """gets authorization info from the index.meta file at path or given by dom""" 337 337 logger("documentViewer (getauthinfofromindexmeta)", logging.INFO,"path: %s"%(path)) … … 343 343 344 344 if dom is None: 345 dom = self.getIndexMeta(getParentDir(path)) 345 for x in range(cut+1): 346 path=getParentDir(path) 347 dom = self.getIndexMeta(path) 346 348 347 349 acctype = dom.xpath("//access-conditions/access/@type") … … 355 357 356 358 357 def getBibinfoFromIndexMeta(self,path,docinfo=None,dom=None ):359 def getBibinfoFromIndexMeta(self,path,docinfo=None,dom=None,cut=0): 358 360 """gets bibliographical info from the index.meta file at path or given by dom""" 359 361 logging.debug("documentViewer (getbibinfofromindexmeta) path: %s"%(path)) … … 363 365 364 366 if dom is None: 365 dom = self.getIndexMeta(getParentDir(path)) 367 for x in range(cut+1): 368 path=getParentDir(path) 369 dom = self.getIndexMeta(path) 366 370 367 371 # put in all raw bib fields as dict "bib" … … 509 513 return docinfo 510 514 511 def getDocinfoFromImagePath(self,path,docinfo=None ):515 def getDocinfoFromImagePath(self,path,docinfo=None,cut=0): 512 516 """path ist the path to the images it assumes that the index.meta file is one level higher.""" 513 517 logger("documentViewer (getdocinfofromimagepath)", logging.INFO,"path: %s"%(path)) … … 520 524 docinfo['imageURL'] = imageUrl 521 525 522 docinfo = self.getBibinfoFromIndexMeta(path,docinfo=docinfo )523 docinfo = self.getAuthinfoFromIndexMeta(path,docinfo=docinfo )526 docinfo = self.getBibinfoFromIndexMeta(path,docinfo=docinfo,cut=cut) 527 docinfo = self.getAuthinfoFromIndexMeta(path,docinfo=docinfo,cut=cut) 524 528 return docinfo 525 529 … … 541 545 elif mode=="imagepath": 542 546 docinfo = self.getDocinfoFromImagePath(url, docinfo=docinfo) 547 elif mode=="filepath": 548 docinfo = self.getDocinfoFromImagePath(url, docinfo=docinfo,cut=1) 543 549 else: 544 550 logger("documentViewer (getdocinfo)", logging.ERROR,"unknown mode!")
Note: See TracChangeset
for help on using the changeset viewer.