self.gconf.set_string("/apps/maemo/mevemon/accounts/%s" % uid, api_key)
def get_auth(self, uid):
-
api_key = self.get_api_key(uid)
try:
return sheet
+ def charid2uid(self, charID):
+ acct_dict = self.get_accounts()
+
+ for uid, apiKey in acct_dict.items():
+ auth = self.cached_api.auth(userID=uid, apiKey=apiKey)
+ api_char_list = auth.account.Characters()
+
+ for character in api_char_list.characters:
+ if character.characterID== charID:
+ return uid
+
+
+ return None
+
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
elif result == RESPONSE_EDIT:
# get the selected treeview item and pop up the account_box
self.edit_account(accounts_treeview)
- pass
elif result == RESPONSE_DELETE:
# get the selected treeview item, and delete the gconf keys
self.delete_account(accounts_treeview)
- pass
elif result == gtk.RESPONSE_OK:
self.char_model.get_characters()
break
dialog.destroy()
- def get_selected_item(treeview, column):
+ def get_selected_item(treeview, column):
selection = treeview.get_selection()
model, miter = selection.get_selected()
# column 0 is the portrait, column 1 is name
char_name = model.get_value(miter, 1)
+ uid = model.get_value(miter, 2)
self.char_id = self.controller.char_name2id(char_name)
- self.sheet = self.controller.get_char_sheet(self.char_id)
+
+ self.sheet = self.controller.get_char_sheet(uid, self.char_id)
win.set_title(char_name)
self.fill_stats(stats_vbox)
self.add_label("<big>Skill in Training:</big>", vbox, align="normal")
- skill = self.controller.get_skill_in_training(self.char_id)
+ skill = self.controller.get_skill_in_training(uid, self.char_id)
if skill.skillInTraining: