def pckt_authen():
 pocket_credential = ((os.environ.get('HOME', os.environ.get('USERPROFILE', '')) + os.sep) + '.rainbow_pckt_oauth')
 if (not os.path.exists(pocket_credential)):
  request_token = Pocket.get_request_token(consumer_key=PCKT_CONSUMER_KEY)
  auth_url = Pocket.get_auth_url(code=request_token, redirect_uri='/')
  webbrowser.open(auth_url)
  printNicely(green('*** Press [ENTER] after authorization ***'))
  raw_input()
  user_credentials = Pocket.get_credentials(consumer_key=PCKT_CONSUMER_KEY, code=request_token)
  access_token = user_credentials['access_token']
  f = open(pocket_credential, 'w')
  f.write(access_token)
  f.close()
 else:
  with open(pocket_credential, 'r') as f:
   access_token = str(f.readlines()[0])
   f.close()
 return Pocket(PCKT_CONSUMER_KEY, access_token)

def pckt_authen ( ) : pocket_credential = ( ( os . environ . get ( 'HOME' , os . environ . get ( 'USERPROFILE' , '' ) ) + os . sep ) + '.rainbow_pckt_oauth' ) if ( not os . path . exists ( pocket_credential ) ) : request_token = Pocket . get_request_token ( consumer_key = PCKT_CONSUMER_KEY ) auth_url = Pocket . get_auth_url ( code = request_token , redirect_uri = '/' ) webbrowser . open ( auth_url ) printNicely ( green ( '*** Press [ENTER] after authorization ***' ) ) raw_input ( ) user_credentials = Pocket . get_credentials ( consumer_key = PCKT_CONSUMER_KEY , code = request_token ) access_token = user_credentials [ 'access_token' ] f = open ( pocket_credential , 'w' ) f . write ( access_token ) f . close ( ) else : with open ( pocket_credential , 'r' ) as f : access_token = str ( f . readlines ( ) [ 0 ] ) f . close ( ) return Pocket ( PCKT_CONSUMER_KEY , access_token )
authenticate with pocket oauth .