comparison src/server/server.py @ 936:78692d47340d

server (pages): added getPageByName
author Goffi <goffi@goffi.org>
date Thu, 27 Apr 2017 01:12:57 +0200
parents c3ae008f7a0f
children 00236973e138
comparison
equal deleted inserted replaced
935:c3ae008f7a0f 936:78692d47340d
1564 return 1564 return
1565 else: 1565 else:
1566 url = os.path.join(u'/', u'/'.join(callback_data['pre_path']), callback_data['callback'](self, uri_data)) 1566 url = os.path.join(u'/', u'/'.join(callback_data['pre_path']), callback_data['callback'](self, uri_data))
1567 return url 1567 return url
1568 1568
1569 def getPageByName(self, name):
1570 """retrieve page instance from its name
1571
1572 @param name(unicode): name of the page
1573 @return (LiberviaPage): page instance
1574 @raise KeyError: the page doesn't exist
1575 """
1576 return self.named_pages[name]
1577
1569 def getChildWithDefault(self, path, request): 1578 def getChildWithDefault(self, path, request):
1570 # we handle children ourselves 1579 # we handle children ourselves
1571 raise exceptions.InternalError(u"this method should not be used with LiberviaPage") 1580 raise exceptions.InternalError(u"this method should not be used with LiberviaPage")
1572 1581
1573 def nextPath(self, request): 1582 def nextPath(self, request):