Added a default avatar image for users without one
This commit is contained in:
parent
f51d187610
commit
124a7411e2
|
@ -36,4 +36,5 @@ If things get really mucked up, deleting ~/.hrafn.db will reset the application
|
|||
|
||||
### Notes
|
||||
|
||||
The system tray icon is Public Domain from: http://commons.wikimedia.org/wiki/File:Capi_x_Raven.svg
|
||||
The system tray icon is Public Domain from http://commons.wikimedia.org/wiki/File:Capi_x_Raven.svg
|
||||
The question mark icon is Public Domain from http://commons.wikimedia.org/wiki/File:Question_mark.svg
|
||||
|
|
3
ui/question_mark.svg
Normal file
3
ui/question_mark.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="220px" height="385px">
|
||||
<text font-size="500" y="360" font-family="Times New Roman">?</text>
|
||||
</svg>
|
After Width: | Height: | Size: 188 B |
|
@ -99,6 +99,11 @@ def add_to_av_cache(user):
|
|||
loader.write(str(data))
|
||||
image = loader.get_pixbuf()
|
||||
loader.close()
|
||||
|
||||
if image is None:
|
||||
image = gtk.gdk.pixbuf_new_from_file('ui/question_mark.svg')
|
||||
image = image.scale_simple(48, 48, gtk.gdk.INTERP_BILINEAR)
|
||||
|
||||
with AvCache().lock:
|
||||
AvCache().map[user.screen_name] = image
|
||||
except (URLError, ValueError):
|
||||
|
|
Reference in New Issue
Block a user