pvl.web.args: --web-static
authorTero Marttila <terom@paivola.fi>
Mon, 13 Jan 2014 19:41:38 +0200
changeset 362 003b624d35a8
parent 361 a780a180a453
child 363 6a0de0315782
pvl.web.args: --web-static
pvl/web/args.py
--- a/pvl/web/args.py	Mon Jan 13 19:41:28 2014 +0200
+++ b/pvl/web/args.py	Mon Jan 13 19:41:38 2014 +0200
@@ -14,6 +14,9 @@
     parser.add_option('--web-layout', metavar='TEMPLATE',
             help="Use template from given file for layout")
 
+    parser.add_option('--web-static', metavar='PATH', default='static',
+            help="Path to static files")
+
     return parser
 
 def apply (options, application, *args, **opts) :
@@ -36,12 +39,15 @@
         Run the werkzeug development server.
     """
 
+    static_files = { }
+
+    if options.web_static :
+        static_files['/static'] = options.web_static
+
     werkzeug.serving.run_simple('0.0.0.0', 8080, wsgi,
         #use_reloader    = True, 
         use_debugger    = (options.loglevel == logging.DEBUG),
-        static_files    = {
-            '/static':      'static',
-        },
+        static_files    = static_files,
     )
 
     return 0