lib/filesystem/map.py
branchsites
changeset 32 be954df4f0e8
parent 31 107062ebb6f9
child 33 19ea04f4b0cd
equal deleted inserted replaced
31:107062ebb6f9 32:be954df4f0e8
    14     PAGE_TYPES = [
    14     PAGE_TYPES = [
    15         ('html',                    page.HTMLPage           ),
    15         ('html',                    page.HTMLPage           ),
    16         (template.TEMPLATE_EXT,     page.TemplatePage       ),
    16         (template.TEMPLATE_EXT,     page.TemplatePage       ),
    17     ]
    17     ]
    18 
    18 
    19     def __init__ (self, path) :
    19     def __init__ (self, path, template) :
    20         """
    20         """
    21             Create, path is where the pages are stored. The list of pages is loaded from $path/list
    21             Create, path is where the pages are stored. The list of pages is loaded from $path/list
    22         """
    22         """
    23         
    23         
    24         # store
    24         # store
    25         self.path = path
    25         self.path = path 
       
    26         self.template = template
    26 
    27 
    27         # load the page tree
    28         # load the page tree
    28         self.tree = page_tree.PageTree(path + '/list')
    29         self.tree = page_tree.PageTree(path + '/list')
    29     
    30     
    30     def _lookup_page_type (self, url, path, filename, basename, extension, tail) :
    31     def _lookup_page_type (self, url, path, filename, basename, extension, tail) :
   116 
   117 
   117         # bind to request
   118         # bind to request
   118         p.bind_request(request)
   119         p.bind_request(request)
   119 
   120 
   120         # render the template
   121         # render the template
   121         response_data = template.render("layout",
   122         response_data = template.render(self.template,
   122             site_root_url   = request.get_script_dir(),
   123             site_root_url   = request.get_script_dir(),
   123             site_page_url   = request.get_page_prefix(),
   124             site_page_url   = request.get_page_prefix(),
   124             page            = p,
   125             page            = p,
   125             menu            = menu.Menu(self, p),
   126             menu            = menu.Menu(self, p),
   126         )
   127         )