# HG changeset patch # User Matt Johnston # Date 1342021033 -28800 # Node ID 5e3880342390705eabac9f9f809f2b48b7109230 # Parent b33045e7e08e07f82ef915de6f03470fbf79d7be - fix set_params (strange) - allow overriding settings in another config file diff -r b33045e7e08e -r 5e3880342390 main.c --- a/main.c Wed Jul 11 22:50:23 2012 +0800 +++ b/main.c Wed Jul 11 23:37:13 2012 +0800 @@ -486,10 +486,9 @@ { cmd_get_params(); } - else if (strncmp_P(readbuf, PSTR("set_params "), - strlen("set_params ") == 0)) + else if (strncmp_P(readbuf, PSTR("set_params "), 11) == 0) { - cmd_set_params(&readbuf[strlen("set_params ")]); + cmd_set_params(&readbuf[11]); } else if (strcmp_P(readbuf, PSTR("awake")) == 0) { @@ -501,7 +500,7 @@ } else { - printf_P(PSTR("Bad command\n")); + printf_P(PSTR("Bad command '%s'\n"), readbuf); } } diff -r b33045e7e08e -r 5e3880342390 web/config.py --- a/web/config.py Wed Jul 11 22:50:23 2012 +0800 +++ b/web/config.py Wed Jul 11 23:37:13 2012 +0800 @@ -5,7 +5,7 @@ DATA_PATH = '/home/matt/templog/web/data' -HMAC_KEY = 'a hmac key' +HMAC_KEY = 'a hmac key' # override in local config file UPDATE_URL = 'https://evil.ucc.asn.au/~matt/templog/update' @@ -33,3 +33,12 @@ # determine by zooming in an image viewer GRAPH_LEFT_MARGIN = 63 + +try: + import localconfig + g = globals() + for k in dir(other): + if k in g: + g[k] = other.__dict__[k] +except ImportError: + pass