2010/11/29 Chris Nelson <chris.nel...@sixnet.com>:
> Alex Willmer wrote:
>> On Mon, Nov 29, 2010 at 1:15 PM, Chris Nelson
>> ...
>> The steps above should sort you.
>
> Thanks.  But it still doesn't work for me.
>
> My plugin now starts:
>
> class TaacJSGanttSupport(Component):
>    implements(IRequestFilter, ITemplateProvider)
>
>    # ITemplateProvider methods
>    def get_htdocs_dirs(self):
>        return [('tracjsgnatt', resource_filename(__name__, 'htdocs'))]
>
>    def get_templates_dirs(self):
>        return []
>
>    # IRequestFilter methods
>    def pre_process_request(self, req, handler):
>        # I think we should look for a TracJSGantt on the page and set
>        # a flag for the post_process_request handler if found
>        return handler
>
>    def post_process_request(self, req, template, data, content_type):
>        add_script(req, 'tracjsgantt/jsgantt.js')
>        add_stylesheet(req, 'tracjsgantt/jsgantt.css')
>        return template, data, content_type
>
> When build, install, and invoke this, I find:
>
> $ find /opt/trac -name jsgantt.js
> /opt/trac/sandbox/.egg-cache/Trac_jsGantt-0.1-py2.5.egg-tmp/tracjsgantt/
> htdocs/jsgantt.js
>
> But no CSS.
>

You need to include the css files to be picked by the setup.py script, this way:

...
...
 packages=['tracjsgantt'],
   package_data = { 'tracjsgantt': ['htdocs/*.js', 'path-to-css/*.css'] },
...
...

this way yout css files will be included in you final egg file.


-- 
Dalton Barreto
http://daltonmatos.wordpress.com

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to 
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to