From 6b104da93275e647276ef3a32078e2fc03a29b9e Mon Sep 17 00:00:00 2001 From: Ryan Campbell Date: Mon, 19 Apr 2010 13:02:15 -0600 Subject: [PATCH] fixed a few errors from the last commit --- mevemon.py | 13 ++++++++++--- ui/fremantle/ui.py | 5 +++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mevemon.py b/mevemon.py index cf4a81d..251ac72 100644 --- a/mevemon.py +++ b/mevemon.py @@ -46,7 +46,7 @@ class mEveMon(): self.cached_api = eveapi.EVEAPIConnection( cacheHandler = apicache.cache_handler( debug = False ) ) try: - self.auth = cached_api.auth( userID = uid, apiKey = api_key ) + self.auth = self.cached_api.auth( userID = uid, apiKey = api_key ) except eveapi.Error, e: # if we can't, return the error message/pic --danny return None @@ -68,7 +68,7 @@ class mEveMon(): return sheet - def char_id2name(charID): + def char_id2name(self, charID): # the api can take a comma-seperated list of ids, but we'll just take # a single id for now try: @@ -78,7 +78,7 @@ class mEveMon(): return name - def char_name2id(name): + def char_name2id(self, name): # the api can take a comma-seperated list of names, but we'll just take # a single name for now try: @@ -118,6 +118,13 @@ class mEveMon(): return ui_char_list + def get_portrait(self, char_name, size): + """ + returns the relative path of the retrieved portrait + """ + charID = self.char_name2id(char_name) + return fetchimg.portrait_filename(charID, size) + if __name__ == "__main__": app = mEveMon() app.run() diff --git a/ui/fremantle/ui.py b/ui/fremantle/ui.py index a155a2b..7e8db4d 100644 --- a/ui/fremantle/ui.py +++ b/ui/fremantle/ui.py @@ -70,8 +70,13 @@ class mEveMonUI(): win.set_title(char_name) label = gtk.Label("This is a subview with information about %s" % char_name) + portrait = gtk.Image() + portrait.set_from_file(self.controller.get_portrait(char_name, 256)) + portrait.show() + vbox = gtk.VBox(False, 0) + vbox.pack_start(portrait, True, True, 0) vbox.pack_start(label, True, True, 0) win.add(vbox) -- 1.7.9.5