Commit 5c9ee59b0852c3cc4679f481757ad98b87e73655
1 parent
704d1d69
Exists in
master
and in
1 other branch
- fixed /static path in some templates
Showing
5 changed files
with
16 additions
and
19 deletions
Show diff stats
BUGS.md
| 1 | 1 | ||
| 2 | # BUGS | 2 | # BUGS |
| 3 | 3 | ||
| 4 | -- argumentos da linha de comando a funcionar. | ||
| 5 | - usar thread.Lock para aceder a variaveis de estado. | 4 | - usar thread.Lock para aceder a variaveis de estado. |
| 6 | - permitir adicionar imagens nas perguntas. | 5 | - permitir adicionar imagens nas perguntas. |
| 6 | +- debug mode: log levels not working | ||
| 7 | 7 | ||
| 8 | # TODO | 8 | # TODO |
| 9 | 9 | ||
| @@ -22,6 +22,7 @@ | @@ -22,6 +22,7 @@ | ||
| 22 | 22 | ||
| 23 | # FIXED | 23 | # FIXED |
| 24 | 24 | ||
| 25 | +- argumentos da linha de comando a funcionar. | ||
| 25 | - configuracao dos logs cherrypy para se darem bem com os outros | 26 | - configuracao dos logs cherrypy para se darem bem com os outros |
| 26 | - browser e ip usados gravado no test. | 27 | - browser e ip usados gravado no test. |
| 27 | - botões allow all/deny all. | 28 | - botões allow all/deny all. |
questions.py
| @@ -48,6 +48,7 @@ else: | @@ -48,6 +48,7 @@ else: | ||
| 48 | 48 | ||
| 49 | # --------------------------------------------------------------------------- | 49 | # --------------------------------------------------------------------------- |
| 50 | # Runs a script and returns its stdout parsed as yaml, or None on error. | 50 | # Runs a script and returns its stdout parsed as yaml, or None on error. |
| 51 | +# Note: requires python 3.5+ | ||
| 51 | # --------------------------------------------------------------------------- | 52 | # --------------------------------------------------------------------------- |
| 52 | def run_script(script, stdin='', timeout=5): | 53 | def run_script(script, stdin='', timeout=5): |
| 53 | try: | 54 | try: |
serve.py
| @@ -234,8 +234,9 @@ if __name__ == '__main__': | @@ -234,8 +234,9 @@ if __name__ == '__main__': | ||
| 234 | # --- parse command line arguments and build base test | 234 | # --- parse command line arguments and build base test |
| 235 | arg = parse_arguments() | 235 | arg = parse_arguments() |
| 236 | 236 | ||
| 237 | - if arg.debug: | 237 | + if arg.debug: # FIXME log.level DEBUG not working |
| 238 | LOGGER_CONF = path.join(SERVER_PATH, 'config/logger-debug.yaml') | 238 | LOGGER_CONF = path.join(SERVER_PATH, 'config/logger-debug.yaml') |
| 239 | + filename = path.abspath(path.expanduser(arg.testfile[0])) | ||
| 239 | 240 | ||
| 240 | # --- Setup logging | 241 | # --- Setup logging |
| 241 | with open(LOGGER_CONF,'r') as f: | 242 | with open(LOGGER_CONF,'r') as f: |
| @@ -244,10 +245,6 @@ if __name__ == '__main__': | @@ -244,10 +245,6 @@ if __name__ == '__main__': | ||
| 244 | # --- start application | 245 | # --- start application |
| 245 | from app import App | 246 | from app import App |
| 246 | 247 | ||
| 247 | - # FIXME do not send args that were not defined in the commandline | ||
| 248 | - # this means options should be like --show-ref=true|false | ||
| 249 | - # and have no default value | ||
| 250 | - filename = path.abspath(path.expanduser(arg.testfile[0])) | ||
| 251 | try: | 248 | try: |
| 252 | app = App(filename, vars(arg)) | 249 | app = App(filename, vars(arg)) |
| 253 | except: | 250 | except: |
| @@ -275,8 +272,6 @@ if __name__ == '__main__': | @@ -275,8 +272,6 @@ if __name__ == '__main__': | ||
| 275 | 272 | ||
| 276 | 'tools.secureheaders.on': True, | 273 | 'tools.secureheaders.on': True, |
| 277 | 'tools.staticdir.root': SERVER_PATH, | 274 | 'tools.staticdir.root': SERVER_PATH, |
| 278 | - 'tools.staticdir.dir': 'static', # where to get js,css,jpg,... | ||
| 279 | - 'tools.staticdir.on': True, | ||
| 280 | }, | 275 | }, |
| 281 | '/adminwebservice': { | 276 | '/adminwebservice': { |
| 282 | 'request.dispatch': cherrypy.dispatch.MethodDispatcher(), | 277 | 'request.dispatch': cherrypy.dispatch.MethodDispatcher(), |
| @@ -284,9 +279,9 @@ if __name__ == '__main__': | @@ -284,9 +279,9 @@ if __name__ == '__main__': | ||
| 284 | 'tools.response_headers.headers': [('Content-Type', 'text/plain')], | 279 | 'tools.response_headers.headers': [('Content-Type', 'text/plain')], |
| 285 | }, | 280 | }, |
| 286 | '/static': { | 281 | '/static': { |
| 287 | - 'tools.auth.on': False, # everything in /static is public | 282 | + 'tools.auth.on': False, # everything in /static is public |
| 288 | 'tools.staticdir.on': True, | 283 | 'tools.staticdir.on': True, |
| 289 | - 'tools.staticdir.dir': 'static', # where to get js,css,jpg,... | 284 | + 'tools.staticdir.dir': 'static',# where to get js, css, ... |
| 290 | }, | 285 | }, |
| 291 | } | 286 | } |
| 292 | 287 |
templates/admin.html
| @@ -5,14 +5,14 @@ | @@ -5,14 +5,14 @@ | ||
| 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1"> | 6 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | <title> Admin </title> | 7 | <title> Admin </title> |
| 8 | - <link rel="icon" href="favicon.ico"> | 8 | + <link rel="icon" href="/static/favicon.ico"> |
| 9 | 9 | ||
| 10 | <!-- Bootstrap --> | 10 | <!-- Bootstrap --> |
| 11 | - <link rel="stylesheet" href="/css/bootstrap.min.css"> | ||
| 12 | - <link rel="stylesheet" href="/css/bootstrap-theme.min.css"> <!-- optional --> | 11 | + <link rel="stylesheet" href="/static/css/bootstrap.min.css"> |
| 12 | + <link rel="stylesheet" href="/static/css/bootstrap-theme.min.css"> <!-- optional --> | ||
| 13 | 13 | ||
| 14 | - <script src="/js/jquery.min.js"></script> | ||
| 15 | - <script src="/js/bootstrap.min.js"></script> | 14 | + <script src="/static/js/jquery.min.js"></script> |
| 15 | + <script src="/static/js/bootstrap.min.js"></script> | ||
| 16 | 16 | ||
| 17 | <style> | 17 | <style> |
| 18 | /* Fixes navigation panel overlaying content */ | 18 | /* Fixes navigation panel overlaying content */ |
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | } | 31 | } |
| 32 | </style> | 32 | </style> |
| 33 | 33 | ||
| 34 | - <script src="/js/admin.js"></script> | 34 | + <script src="/static/js/admin.js"></script> |
| 35 | </head> | 35 | </head> |
| 36 | <!-- ===================================================================== --> | 36 | <!-- ===================================================================== --> |
| 37 | <body> | 37 | <body> |
templates/test.html
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | }); | 14 | }); |
| 15 | </script> | 15 | </script> |
| 16 | 16 | ||
| 17 | - <script type="text/javascript" src="/js/mathjax/MathJax.js?config=TeX-AMS_CHTML-full"> | 17 | + <script type="text/javascript" src="/static/js/mathjax/MathJax.js?config=TeX-AMS_CHTML-full"> |
| 18 | </script> | 18 | </script> |
| 19 | 19 | ||
| 20 | <!-- Bootstrap --> | 20 | <!-- Bootstrap --> |
| @@ -330,7 +330,7 @@ | @@ -330,7 +330,7 @@ | ||
| 330 | </div> | 330 | </div> |
| 331 | </div> | 331 | </div> |
| 332 | 332 | ||
| 333 | -<script src="/js/tabkey_in_textarea.js"></script> | ||
| 334 | -<script src="/js/prevent_enter_submit.js"></script> | 333 | +<script src="/static/js/tabkey_in_textarea.js"></script> |
| 334 | +<script src="/static/js/prevent_enter_submit.js"></script> | ||
| 335 | </body> | 335 | </body> |
| 336 | </html> | 336 | </html> |