Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0054.py @ 1246:8b891f9be183
core, plugins: improve a bit some log messages
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 18 Oct 2014 16:28:37 +0200 |
parents | 96fb74a4714d |
children | 77a4592816f6 |
comparison
equal
deleted
inserted
replaced
1245:84d06701f5c4 | 1246:8b891f9be183 |
---|---|
141 | 141 |
142 def save_photo(self, photo_xml): | 142 def save_photo(self, photo_xml): |
143 """Parse a <PHOTO> elem and save the picture""" | 143 """Parse a <PHOTO> elem and save the picture""" |
144 for elem in photo_xml.elements(): | 144 for elem in photo_xml.elements(): |
145 if elem.name == 'TYPE': | 145 if elem.name == 'TYPE': |
146 log.info(_('Photo of type [%s] found') % str(elem)) | 146 log.debug(_('Photo of type [%s] found') % str(elem)) |
147 if elem.name == 'BINVAL': | 147 if elem.name == 'BINVAL': |
148 log.debug(_('Decoding binary')) | 148 log.debug(_('Decoding binary')) |
149 decoded = b64decode(str(elem)) | 149 decoded = b64decode(str(elem)) |
150 image_hash = sha1(decoded).hexdigest() | 150 image_hash = sha1(decoded).hexdigest() |
151 filename = self.avatar_path + '/' + image_hash | 151 filename = self.avatar_path + '/' + image_hash |