Hi,
I'm writing a plugin based on tickets and am having trouble getting the
.css file to load. I think it fails to load because changes to the
values have no effect, and when I move the file aside, the appearance of
the page does not change at all.
I used the Plugin Template to get the basic structure of my plugin:
ChangeRequest-plugin/
ChangeRequest-plugin/ChangeRequest
ChangeRequest-plugin/ChangeRequest/templates/request.cs
ChangeRequest-plugin/ChangeRequest/htdocs/css/request.css
Here's my *setup.py*:
setup(name=PACKAGE, version=VERSION, packages=['ChangeRequest'],
package_data={'ChangeRequest' : ['templates/*.cs',
'htdocs/css/*.css']})
I make my handler class implement ITemplateProvider and then define:
def *get_htdocs_dirs*(self):
from pkg_resources import resource_filename
return [(__name__, resource_filename( __name__, 'htdocs'))]
def *get_templates_dirs*(self):
from pkg_resources import resource_filename
return [resource_filename( 'ChangeRequest', 'templates')]
I checked that __name__ corresponds to 'ChangeRequest'. Then in my
handler's *process_request*, before returning a cs file, I call
*add_stylesheet*, like this:
add_stylesheet(req, 'ChangeRequest/htdocs/css/request.css')
return 'request.cs', None
I'm basing my path to add_stylesheet on the helloworld tutorial. What's
strange to me is that the clearsilver file loads fine. (I've tried
add_stylesheet() with htdocs/css/request.css, css/request.css
ChangeRequest/css/request.css, too)
What I think is the pertinent HDF looks like this:
chrome {
href = /trac/chrome
links {
<!-- lots commented out -->
stylesheet {
0 {
href = /trac/chrome/common/css/trac.css
type = text/css
}
1 {
href = /trac/chrome/ChangeRequest/htdocs/css/request.css
type = text/css
}
}
}
htdocs_location = /trac/chrome/common/
I would appreciate any feedback!
Thanks,
Nate
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac