PATCH.- Webhelpers Minification with cascade application

0 views
Skip to first unread message

Néstor Salceda

unread,
Aug 6, 2010, 7:40:58 AM8/6/10
to pylons-devel
Hello!

Let me to explain the motivation for this patch. In my company, we
are writing several webapps using Pylons, and we use several common JS
and CSS files.

Instead of being replicating the job copying and maintaining the files
in all applications, we are packaged some files into Python packages
(by example jQuery or jQuery UI). These packages provides us its root
path and we use the Cascade mechanism for serving the static files.
Then if jQuery releases, we just package the release and let pip to
upgrade in all applications.

The trouble is when the application is in production where we combine
and minify the CSS and Javascript files. This happens because, the
minification helper uses only the config['pylons.paths']
['static_files'] value and the packaged files aren't in that location.

Then, I've cooked a patch in order to look up the files in another
config['pylons.path'] key.

I would like to be included in Webhelpers (if possible), and I will
appreciate the feedback, and I will do the modifications needed in
order to be included :)

http://pastebin.com/nWWqPdrj

Thanks you!
Néstor

Mike Orr

unread,
Aug 6, 2010, 1:14:00 PM8/6/10
to pylons...@googlegroups.com

I'll make a ticket for this in bitbucket as soon as it allows me to
log in. But there's an existing problem with jsmin, the license of the
"C" version. (Can't link to it because butbucket is down.) It has a
"do no evil" license which Fedora can't distribute. If I can't get it
relicensed I'll have to delete it. The C code is also convoluted and
undocumented, which I've just left as is. I haven't decided whether to
keep just the Python version or delete jsmin entirely.

--
Mike Orr <slugg...@gmail.com>

Néstor Salceda

unread,
Aug 9, 2010, 7:29:25 AM8/9/10
to pylons-devel
Okey Mike!

I'm going to package the modified minify module for my projects (it's
a bit urgent :P) and I will try the minification with other software
(YUI, and others).

And I will post the results :)

Thanks!
Reply all
Reply to author
Forward
0 new messages