From 124a7411e29331effb3f334841e5abb10927bf35 Mon Sep 17 00:00:00 2001 From: Anna Date: Tue, 1 Jun 2010 17:30:58 -0400 Subject: [PATCH] Added a default avatar image for users without one --- README.markdown | 3 ++- ui/question_mark.svg | 3 +++ usercache.py | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 ui/question_mark.svg diff --git a/README.markdown b/README.markdown index 7dcdbae..1ad1ade 100644 --- a/README.markdown +++ b/README.markdown @@ -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 diff --git a/ui/question_mark.svg b/ui/question_mark.svg new file mode 100644 index 0000000..1af8d2a --- /dev/null +++ b/ui/question_mark.svg @@ -0,0 +1,3 @@ + +? + \ No newline at end of file diff --git a/usercache.py b/usercache.py index d48b1e0..64653e5 100644 --- a/usercache.py +++ b/usercache.py @@ -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):