Imported some fixes to oauthtwitter from its issue tracker
This commit is contained in:
parent
5768f0e91c
commit
69cba102d3
3 changed files with 40 additions and 27 deletions
11
hrafn.py
11
hrafn.py
|
@ -64,18 +64,15 @@ class Hrafn():
|
|||
self.num_entries = int(config.get('global', 'entries'))
|
||||
self.refresh_time = int(config.get('global', 'refreshtime'))
|
||||
|
||||
if not self.db.has_key('active_user'):
|
||||
self.db['active_user'] = None
|
||||
|
||||
# Now set up the accounts and their corresponding APIs
|
||||
self.accounts = {}
|
||||
for token in self.db['tokens']:
|
||||
api = apithreads.CustomApi(token)
|
||||
self.add_account(api)
|
||||
|
||||
if not self.db.has_key('active_user'):
|
||||
try:
|
||||
self.db['active_user'] = self.accounts.keys()[0]
|
||||
except IndexError:
|
||||
self.db['active_user'] = None
|
||||
|
||||
self.username = self.db['active_user']
|
||||
|
||||
try:
|
||||
|
@ -148,7 +145,7 @@ class Hrafn():
|
|||
|
||||
|
||||
def update_account_label(self):
|
||||
if self.username:
|
||||
if self.username is not None:
|
||||
self.account_label.set_text(self.username + ': ')
|
||||
|
||||
|
||||
|
|
Reference in a new issue