Changes between Version 7 and Version 8 of EggCookingTutorial/AdvancedEggCooking2


Ignore:
Timestamp:
Sep 5, 2005 4:33:24 PM (9 years ago)
Author:
gotoh
Comment:

Use good prefix name distinct from directory name.

Legend:

Unmodified
Added
Removed
Modified
  • EggCookingTutorial/AdvancedEggCooking2

    v7 v8  
    5959Add the following code at the tail in file ''helloworld.py'' which 
    6060implements {{{get_htdocs_dir()}}} to tell the static data path information for this plugin  
    61 with identical prefix 'helloworld'. 
     61with identical prefix 'hw'. 
    6262{{{ 
    6363#!python 
     
    7575        """ 
    7676        from pkg_resources import resource_filename 
    77         return [('helloworld', resource_filename(__name__, 'htdocs'))] 
     77        return [('hw', resource_filename(__name__, 'htdocs'))] 
    7878}}} 
    7979 
     
    8484#!python 
    8585    def process_request(self, req): 
    86         add_stylesheet(req, 'helloworld/css/helloworld.css') 
     86        add_stylesheet(req, 'hw/css/helloworld.css') 
    8787        return 'helloworld.cs', None 
    8888}}} 
    89 Note that prefix path 'helloworld/' specified by {{{get_htdocs_dirs()}}} should be used. 
     89Note that prefix path 'hw/' specified by {{{get_htdocs_dirs()}}} should be used. 
    9090 
    9191And also import {{{add_stylesheet()}}} at the beginning of ''helloworld.py''. 
     
    122122                                         
    123123    def process_request(self, req): 
    124         add_stylesheet(req, 'helloworld/css/helloworld.css') 
     124        add_stylesheet(req, 'hw/css/helloworld.css') 
    125125        return 'helloworld.cs', None 
    126126                 
     
    147147        """ 
    148148        from pkg_resources import resource_filename 
    149         return [('helloworld', resource_filename(__name__, 'htdocs'))] 
     149        return [('hw', resource_filename(__name__, 'htdocs'))] 
    150150}}} 
    151151 
     
    162162<div id="content" class="helloworld"> 
    163163 <h1>Hello world!</h1> 
    164  <img src="<?cs var:chrome.href ?>/helloworld/images/helloworld.jpg"> 
     164 <img src="<?cs var:chrome.href ?>/hw/images/helloworld.jpg"> 
    165165</div> 
    166166 
     
    181181[[TagIt()]] 
    182182 
     183