Commits

Jiangge Zhang committed b1cbb9d

extract the static paths into constants.

  • Participants
  • Parent commits 017a503

Comments (0)

Files changed (3)

passwood/assets/consts.py

-SEMANTIC_PATH = "bundles/semantic-ui/build/packaged/{0}"
+SCRIPTS_PATH = "scripts/{0}"
+STYLESHEETS_PATH = "stylesheets/{0}"
+BUNDLES_PATH = "bundles/{0}"
+
+SEMANTIC_PATH = BUNDLES_PATH.format("semantic-ui/build/packaged/{0}")

passwood/assets/scripts.py

 from flask.ext.compressor import JSBundle, FileAsset
 
-from .consts import SEMANTIC_PATH
+from .consts import SEMANTIC_PATH, BUNDLES_PATH, SCRIPTS_PATH
 
 
 default_js = JSBundle("default.js", assets=[
-    FileAsset(filename="bundles/jquery/jquery.js"),
+    FileAsset(filename=BUNDLES_PATH.format("jquery/jquery.js")),
     FileAsset(filename=SEMANTIC_PATH.format("javascript/semantic.js")),
-    FileAsset(filename="scripts/login.coffee", processors=["coffee"]),
+    FileAsset(filename=SCRIPTS_PATH.format("login.coffee"),
+              processors=["coffee"]),
 ], processors=["jsmin"])

passwood/assets/stylesheets.py

 from flask.ext.compressor import CSSBundle, FileAsset
 
-from .consts import SEMANTIC_PATH
+from .consts import SEMANTIC_PATH, STYLESHEETS_PATH
 
 
 default_css = CSSBundle("default.css", assets=[
     FileAsset(filename=SEMANTIC_PATH.format("css/semantic.css"),
               processors=["semantic_font_path"]),
-    FileAsset(filename="stylesheets/login.styl", processors=["stylus"]),
+    FileAsset(filename=STYLESHEETS_PATH.format("layout.styl"),
+              processors=["stylus"]),
+    FileAsset(filename=STYLESHEETS_PATH.format("login.styl"),
+              processors=["stylus"]),
 ], processors=["cssmin"])