~kamus/+junk/gwibber-kamus

« back to all changes in this revision

Viewing changes to gwibber/gwui.py

  • Committer: Ken VanDine
  • Date: 2010-09-22 13:09:15 UTC
  • Revision ID: ken.vandine@canonical.com-20100922130915-jer8i2co5u2k1khw
Don't crash the client if an account exists for a service that isn't available

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
    for account in json.loads(self.accounts.List()):
121
121
      aId = account["id"]
122
122
 
123
 
      if "receive" in self.services[account["service"]]["features"]:
 
123
      if self.services.has_key(account["service"]) and "receive" in self.services[account["service"]]["features"]:
124
124
 
125
125
        item = {
126
126
            "name": account.get("username", "None"),
638
638
  def populate(self):
639
639
    self.accounts = []
640
640
    for account in json.loads(self.model.accounts.List()):
641
 
      if "send" in self.model.services[account["service"]]["features"]:
 
641
      if self.model.services.has_key(account["service"]) and "send" in self.model.services[account["service"]]["features"]:
642
642
        self.accounts.append(account)
643
643
 
644
644
  def render(self):