comparison py/tempserver.py @ 259:26eee8591f61

long polling works
author Matt Johnston <matt@ucc.asn.au>
date Tue, 09 Jun 2015 23:27:44 +0800
parents 0a1b642e3086
children 20c89630be6c
comparison
equal deleted inserted replaced
256:6d06795aefbb 259:26eee8591f61
16 import fridge 16 import fridge
17 import config 17 import config
18 import sensor 18 import sensor
19 import params 19 import params
20 import uploader 20 import uploader
21 import configwaiter
21 22
22 23
23 class Tempserver(object): 24 class Tempserver(object):
24 def __init__(self, test_mode): 25 def __init__(self, test_mode):
25 self.readings = [] 26 self.readings = []
139 140
140 def main(): 141 def main():
141 parser = argparse.ArgumentParser() 142 parser = argparse.ArgumentParser()
142 parser.add_argument('--hup', action='store_true') 143 parser.add_argument('--hup', action='store_true')
143 parser.add_argument('--new', action='store_true') 144 parser.add_argument('--new', action='store_true')
144 parser.add_argument('--daemon', action='store_true') 145 parser.add_argument('-D', '--daemon', action='store_true')
145 parser.add_argument('-d', '--debug', action='store_true') 146 parser.add_argument('-d', '--debug', action='store_true')
146 parser.add_argument('-t', '--test', action='store_true') 147 parser.add_argument('-t', '--test', action='store_true')
147 args = parser.parse_args() 148 args = parser.parse_args()
148 149
149 setup_logging(args.debug) 150 setup_logging(args.debug)