comparison libervia/server/pages.py @ 1171:469d0de8da0e

pages (blog, u): added atom feed link in "links" template data.
author Goffi <goffi@goffi.org>
date Fri, 26 Apr 2019 08:42:27 +0200
parents 97e850e6fae9
children 0f37b65fe7c2
comparison
equal deleted inserted replaced
1170:4648a333b33f 1171:469d0de8da0e
633 return os.path.join( 633 return os.path.join(
634 u"/", current_url, path, *[quote(a) for a in args if a is not None] 634 u"/", current_url, path, *[quote(a) for a in args if a is not None]
635 ) 635 )
636 636
637 def getURLByNames(self, named_path): 637 def getURLByNames(self, named_path):
638 """retrieve URL from pages names and arguments 638 """Retrieve URL from pages names and arguments
639 639
640 @param request(server.Request): request linked to the session
641 @param named_path(list[tuple[unicode, list[unicode]]]): path to the page as a list 640 @param named_path(list[tuple[unicode, list[unicode]]]): path to the page as a list
642 of tuples of 2 items: 641 of tuples of 2 items:
643 - first item is page name 642 - first item is page name
644 - second item is list of path arguments of this page 643 - second item is list of path arguments of this page
645 @return (unicode): URL to the requested page with given path arguments 644 @return (unicode): URL to the requested page with given path arguments
659 if page_args: 658 if page_args:
660 path.extend([quote(a) for a in page_args]) 659 path.extend([quote(a) for a in page_args])
661 return self.host.checkRedirection(self.vhost_root, u"/".join(path)) 660 return self.host.checkRedirection(self.vhost_root, u"/".join(path))
662 661
663 def getURLByPath(self, *args): 662 def getURLByPath(self, *args):
664 """generate URL by path 663 """Generate URL by path
665 664
666 this method as a similar effect as getURLByNames, but it is more readable 665 this method as a similar effect as getURLByNames, but it is more readable
667 by using SubPage to get pages instead of using tuples 666 by using SubPage to get pages instead of using tuples
668 @param request(server.Request): request linked to the session
669 @param *args: path element: 667 @param *args: path element:
670 - if unicode, will be used as argument 668 - if unicode, will be used as argument
671 - if util.SubPage instance, must be the name of a subpage 669 - if util.SubPage instance, must be the name of a subpage
672 @return (unicode): generated path 670 @return (unicode): generated path
673 """ 671 """