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
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:
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:
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()
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)