def PUT(self): house = json.loads(web.data()) logging.debug('edit houses:%s %s', web.ctx.ip, house) token = web.cookies().get('token') db.modify_house(web.ctx.ip, house['name'].strip(), house['text'], datetime.now().strftime('%Y-%m-%d %H:%M'), token)
# -*- coding: utf-8 -*- import db for line in open('./log.log'): if line.find('edit houses') != -1: pos1 = line.find('{') pos2 = line.find('}') data = line[pos1: pos2+1] print data data = eval(data) try: db.modify_house(data['ip'], data['name'], data['text'], data['lastmodified'], '') except: print 'error:', data print data
def PUT(self): house = json.loads(web.data()) token = web.cookies().get('token') logging.debug('edit houses:%s %s %s', web.ctx.ip, house, token) db.modify_house(web.ctx.ip, house['name'].strip(), house['text'], datetime.now().strftime('%Y-%m-%d %H:%M'), token)