fixed a few errors from the last commit
authorRyan Campbell <campbellr@gmail.com>
Mon, 19 Apr 2010 19:02:15 +0000 (13:02 -0600)
committerRyan Campbell <campbellr@gmail.com>
Mon, 19 Apr 2010 19:02:15 +0000 (13:02 -0600)
mevemon.py
ui/fremantle/ui.py

index cf4a81d..251ac72 100644 (file)
@@ -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()
index a155a2b..7e8db4d 100644 (file)
@@ -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)