Ejemplo n.º 1
0
 def set_device_from_id(self, wurfl_id, device):
     device = device.copy()
     device["errors"] = {}
     wurfl_id = wurfl_id.encode("utf8")
     old_device = self.get_device_from_id(wurfl_id, do_stats=False)
     if old_device:
         device = update_device(old_device, device)
     self.set(wurfl_id, json.dumps(device))
Ejemplo n.º 2
0
 def set_device(self, user_agent, device):
     user_agent = user_agent.encode("utf8")
     device = device.copy()
     device["errors"] = {}
     old_device = self.get_device(user_agent, do_stats=False)
     if old_device:
         device = update_device(old_device, device)
     wurfl_id = device[u"id"].encode("utf8")
     self.set(user_agent, wurfl_id)
     self.set(wurfl_id, json.dumps(device))
     self.set_mtime(device['mtime'])