Skip to content

Instantly share code, notes, and snippets.

@pjz
Created February 8, 2013 07:02
Show Gist options
  • Save pjz/4737190 to your computer and use it in GitHub Desktop.
Save pjz/4737190 to your computer and use it in GitHub Desktop.
auto-css-compressing simplate for gittip
from fabricate import run
raw_css = os.path.join(website.www_root, '..', 'templates', 'gittip.css')
class Cache(object):
data = None
cache = Cache()
^L
built_css = request.fs + ".cached"
_, _, outputs = run('sccs', '-t', 'compressed', raw_css, built_css)
if outputs is not None:
cache.data = file(built_css).read()
response.body = cache.data
raise response
^L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment