Permalink
Browse files

ability to store extra info in credentials pickled files

Extra key-value pairs can be stored in the credentials files
  • Loading branch information...
msonsona committed Nov 6, 2015
1 parent 92d8ab1 commit ff3214256a20c7c823b909a181658f2182e42051
Showing with 14 additions and 0 deletions.
  1. +14 −0 credentials_pickler.py
@@ -7,6 +7,17 @@
access_token = input("4. Enter the access_token > ")
access_token_secret = input("5. Enter the access_token_secret > ")
extra_info = 'y'
extra_tokens = []
while extra_info == 'y':
extra_info = input("Do you want to store any extra key - value pair? (y/n) > ")
if extra_info == 'y':
extra_info_key = input("First, enter the name (key) > ")
extra_info_value = input("Second, enter the value to store > ")
extra_tokens.append({'key': extra_info_key,
'value': extra_info_value})
credentials = {
'account': account,
'consumer_key': consumer_key,
@@ -15,6 +26,9 @@
'access_token_secret': access_token_secret
}
if len(extra_tokens):
credentials['extra_tokens'] = extra_tokens
print(credentials)
filename = "%s.pickle" % account

0 comments on commit ff32142

Please sign in to comment.