Skip to content
Browse files

Merge pull request #2 from dtl/feature/app-defensive-staticpathurl

Feature/app defensive staticpathurl
  • Loading branch information...
2 parents 704bcca + ae8249a commit 87744a2ed5a0e9e312f627e9ab1b59066062e61e @sjl committed Aug 19, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 flaskext/lesscss.py
View
13 flaskext/lesscss.py
@@ -15,7 +15,18 @@
def lesscss(app):
@app.before_request
def _render_less_css():
- static_dir = app.root_path + app.static_path
+ if not hasattr(app, 'static_url_path'):
+ from warnings import warn
+ warn(DeprecationWarning('static_path is called '
+ 'static_url_path since Flask 0.7'),
+ stacklevel=2)
+
+ static_url_path = app.static_path
+
+ else:
+ static_url_path = app.static_url_path
+
+ static_dir = app.root_path + app.static_url_path
less_paths = []
for path, subdirs, filenames in os.walk(static_dir):

0 comments on commit 87744a2

Please sign in to comment.
Something went wrong with that request. Please try again.