Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
# -*- 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
Ejemplo n.º 3
0
 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)