Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Consolidate
Browse files Browse the repository at this point in the history
  • Loading branch information
dlo9 committed Jul 27, 2019
1 parent dd95a96 commit bf66bcc
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Pocket.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,6 @@ class Pocket(BasicNewsRecipe):
for item in response['list'].values()
] if response['list'] else [])]

def show_user_auth_prompt(self, request_token):
self.abort_recipe_processing('''
Calibre must be granted access to your Pocket account. Please click
<a href="https://getpocket.com/auth/authorize?request_token={0}&redirect_uri={1}">here</a>
to authenticate via a browser, and then re-fetch the news.
'''.format(request_token, self.redirect_uri))

def reauthorize(self):
set_persistent_state(None)
self.ensure_authorization(self.browser)
Expand All @@ -198,7 +191,11 @@ class Pocket(BasicNewsRecipe):
if state.stage is AuthStage.FirstRun:
state = self.first_run(browser)
set_persistent_state(state)
self.show_user_auth_prompt(state.code)
self.abort_recipe_processing('''
Calibre must be granted access to your Pocket account. Please click
<a href="https://getpocket.com/auth/authorize?request_token={0}&redirect_uri={1}">here</a>
to authenticate via a browser, and then re-fetch the news.
'''.format(request_token, self.redirect_uri))
elif state.stage is AuthStage.Authorizing:
state = self.authorize(browser, state.code)
set_persistent_state(state)
Expand Down

0 comments on commit bf66bcc

Please sign in to comment.