Mercurial > hg > MPIWGWeb
comparison MPIWGRoot.py @ 128:11b7f98c7ed1
added book links aus pubman
author | dwinter |
---|---|
date | Thu, 30 May 2013 22:00:15 +0200 |
parents | 4a8a532a05ba |
children | 741ddaf604b1 |
comparison
equal
deleted
inserted
replaced
127:4a8a532a05ba | 128:11b7f98c7ed1 |
---|---|
518 fw.write("%s,%s\n"%(id,l)) | 518 fw.write("%s,%s\n"%(id,l)) |
519 fw.flush() | 519 fw.flush() |
520 | 520 |
521 fw.close() | 521 fw.close() |
522 | 522 |
523 | 523 def getBookLinkFromID(self,ident): |
524 """holt die url auf eine buchseite, bekommt identifier MPIWG-Book:XXXX""" | |
525 | |
526 splitted = ident.split(":") | |
527 if len(splitted)!=2: | |
528 logging.debug("getBookLinkFromID: %s not a valid book id, should be MPIWG-Book:XXXX"%ident) | |
529 return | |
530 | |
531 books = getattr(self,'books',None) | |
532 if books is None: | |
533 logging.debug("getBookLinkFromID: cannot find books page folder") | |
534 return | |
535 | |
536 | |
537 bookobj = getattr(books,splitted[1],None) | |
538 | |
539 if bookobj is None: | |
540 logging.debug("getBookLinkFromID: %s not a valid book id"%ident) | |
541 return | |
542 | |
543 | |
544 return "books/"+splitted[1] | |
524 | 545 |
525 | 546 |
526 def manage_addMPIWGRootForm(self): | 547 def manage_addMPIWGRootForm(self): |
527 """form for adding the root""" | 548 """form for adding the root""" |
528 pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','addMPIWGRootForm.zpt')).__of__(self) | 549 pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','addMPIWGRootForm.zpt')).__of__(self) |