Changeset 49
- Timestamp:
- 09/25/07 05:41:12 (1 year ago)
- Files:
-
- photobooth/photobooth.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
photobooth/photobooth.py
r47 r49 79 79 d.addCallback(lambda x: self.startCountdown()) 80 80 self.bucket.append(evt.data) 81 d.addErrback(lambda _: None) 81 82 return d 82 83 … … 100 101 people = [self.people[tag] for tag in self.bucket if tag in self.people] 101 102 return defer.succeed(people) 102 d = self._tagsToPeople()103 104 def _addContacts(rv):105 for p in rv:106 p['contacts'] = [{"id": "test", "name": p['name'] + "TEST"},107 {"id": "test2", "name": p['name'] + "TEST2"}108 ]109 return rv110 #d.addCallback(_addContacts)111 def _printError(e):112 import traceback113 traceback.print_exc()114 return []115 d.addErrback(_printError)116 return d117 103 118 104 def _tagToPerson(self, tag): … … 125 111 dict(uri='urn:rfid:%s'%(tag))) 126 112 def _getId(rv): 113 if not rv: 114 raise NotFoundException("no user found for tag %s"%(tag)) 127 115 return rv[0]['thg_id'] 128 116 … … 132 120 133 121 def _getPersonByThing(self, thing): 122 if not thing: 123 return None 134 124 d = self.remote.call("picnic.persons.get", 135 125 dict(id=thing)) … … 141 131 142 132 def _fillContacts(self, person): 133 if not person: 134 return None 143 135 d = self.remote.call("picnic.relations.getList", 144 136 dict(id=person['id']))
