Created
February 8, 2013 07:02
-
-
Save pjz/4737190 to your computer and use it in GitHub Desktop.
auto-css-compressing simplate for gittip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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