Nick:

The quick answer is Yes.
You can pack full library(js, css, images...etc) without modify the
structure or library it self.

I'll take my experience of packing "qooxdoo" javascript framework to
widget for example,
qooxdoo has several folders containing javascript, css, and images. we
can access qooxdoo by importing "qooxdoo.js", which is in "script"
folder.

1. Extract library directories in static folder.

2. Find static directory

{{{
# find static directory
js_dir = pkg_resources.resource_filename("qooxdoo",
                                         "static")
register_static_directory("qooxdoo", js_dir)


qooxdoo_js = JSLink("qooxdoo", "/script/qooxdoo.js")
}}}

3. Call it

class Qooxdoo(Widget):
    javascript = [qooxdoo_js]


That's all. (Not that hard, right? :D )

You should get the concept that the default
"css", "javascript", "images" directories in "static" folder are just
for people to have better converntion.

But it wont limit you to arrange your library in your way.


--
Fred


> I just wanted to see how to eliminate the need to make changes in the
> third-party
> js library. My thoughts were more along the lines of licensing. For
> instance,
> if I take this library, can I package it and submit it to cogbin if I have
> to modify it? It's not my library after all...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to