Commits

Steve Losh committed 72d6370

lesscss: initial commit

Comments (0)

Files changed (1)

garter/lesscss.py

+def _render_less_css():
+    for fn in less_files:
+        css_path = os.path.join(static_dir, fn + '.css')
+        less_path = os.path.join(static_dir, fn + '.less')
+        css_mtime, less_mtime = os.path.getmtime(css_path), os.path.getmtime(less_path)
+        if less_mtime >= css_mtime:
+            subprocess.call(['lessc', css_path, less_path], shell=False)
+
+def lesscss(app):
+    app.before_request(_render_less_css)
+