Skip to content

Commit

Permalink
enable pages with saved keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptSmith committed Feb 27, 2017
1 parent f66f441 commit e5dc642
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions reaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ def load_auth_keys(self):
self.redditApplicationSecretInput.setText(self.auth_keys.get(
'reddit_application_secret', ''))

self.enable_tabs()

if self.auth_keys != {}:
self.stack_input()

Expand All @@ -250,8 +252,26 @@ def save_auth_keys(self):

pickle.dump(self.auth_keys, open('reaper_keys.p', 'wb'))

self.enable_tabs()
self.stack_input()

def enable_tabs(self):
facebook = self.auth_keys.get('facebook_api_key') != ""
self.facebookTab.setEnabled(facebook)

twitter = self.auth_keys.get('twitter_app_key') != "" and \
self.auth_keys.get('twitter_app_secret') != "" and \
self.auth_keys.get('twitter_oauth_token') != "" and \
self.auth_keys.get('twitter_oauth_token_secret') != ""
self.twitterTab.setEnabled(twitter)

youtube = self.auth_keys.get('youtube_api_key') != ""
self.youtubeTab.setEnabled(youtube)

reddit = self.auth_keys.get('reddit_application_id') != "" and \
self.auth_keys.get('reddit_application_secret') != ""
self.redditTab.setEnabled(reddit)

@staticmethod
def error_message(exception):
msg = QMessageBox()
Expand Down

0 comments on commit e5dc642

Please sign in to comment.