~pablo-a-saavedra/gwibber/yammer-integration

« back to all changes in this revision

Viewing changes to gwibber/accounts.py

  • Committer: Ken VanDine
  • Date: 2010-09-01 01:56:24 UTC
  • mfrom: (738.1.4 gwibber-2.30-oauth)
  • Revision ID: ken.vandine@canonical.com-20100901015624-kjxjz78ozdd3dt42
Tags: 2.30.2
Merged twitter/oauth branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
            self.add_account()
125
125
            return
126
126
        for self.account in self.accounts:
127
 
            if self.account_verify(self.account):
 
127
            #if self.account_verify(self.account):
128
128
                try:
129
129
                    icf = resources.icon(self.account["protocol"], use_theme=False) or resources.get_ui_asset("icons/breakdance/16x16/%s.png" % self.account["protocol"])
130
130
                    icon = gtk.gdk.pixbuf_new_from_file(icf)
133
133
                    icon = gtk.icon_theme_add_builtin_icon("gwibber", 22,
134
134
                                                           gtk.gdk.pixbuf_new_from_file_at_size(
135
135
                                                           resources.get_ui_asset("gwibber.svg"), 16, 16))
136
 
                has_password = True
 
136
                has_secret = True
137
137
                for config in self.protocols[self.account["protocol"]]["config"]:
138
138
                    is_private = config.startswith("private:")
139
139
                    config = config.replace("private:", "")
140
 
                    value = self.account[config]
141
140
                    if is_private:
 
141
                        if not self.account.has_key(config): self.account[config] = ":KEYRING:MISSING"
142
142
                        if self.account[config].startswith(":KEYRING:"):
143
143
                            try:
144
144
                                value = gnomekeyring.find_items_sync(gnomekeyring.ITEM_GENERIC_SECRET, {"id": str("%s/%s" % (self.account["_id"], config))})[0].secret
145
145
                            except gnomekeyring.NoMatchError:
146
 
                                has_password = False
147
 
                                    
 
146
                                has_secret = False
148
147
 
149
148
                bg_color = None
150
 
                if not has_password:
 
149
                if not has_secret:
151
150
                    bg_color = "pink"
152
151
                
153
152
                accounts_store.append(None, [self.account["protocol"] + " (" + self.account["username"] + ")", icon, self.account, bg_color])
269
268
            image_type.set_from_pixbuf(icon)
270
269
        try:
271
270
          if not new_account:
272
 
              self.aw = eval(protocol["name"]).AccountWidget(self.account)
 
271
              self.aw = eval(protocol["name"]).AccountWidget(self.account, self.ui)
273
272
          else:
274
273
              self.aw = eval(protocol["name"]).AccountWidget(None, self.ui)
275
274
          self.aw.show()