File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [credentials]
2+ client_id =YOUR ID HERE
3+ client_secret =YOUR SECRET HERE
4+ refresh_token =
Original file line number Diff line number Diff line change 66 set up a test user with API credentials and set them up in here.
77'''
88
9- #client_id = 'YOUR CLIENT ID'
10- #client_secret = 'YOUR CLIENT SECRET'
11-
12- client_id = u'6d2d7ee5f212dc1'
13- client_secret = u'18828c1021069154576672e86b8ab2e1559d329a'
14-
15-
169from imgurpython import ImgurClient
1710
1811def get_input (string ):
@@ -22,7 +15,22 @@ def get_input(string):
2215 except :
2316 return input (string )
2417
18+ def get_config ():
19+ ''' More version compatibility stuff '''
20+ try :
21+ import ConfigParser
22+ return ConfigParser .ConfigParser ()
23+ except :
24+ import configparser
25+ return configparser .ConfigParser ()
26+
2527def authenticate ():
28+ # Get client ID and secret from auth.ini
29+ config = get_config ()
30+ config .read ('auth.ini' )
31+ client_id = config ['credentials' ]['client_id' ]
32+ client_secret = config ['credentials' ]['client_secret' ]
33+
2634 client = ImgurClient (client_id , client_secret )
2735
2836 # Authorization flow, pin example (see docs for other auth types)
You can’t perform that action at this time.
0 commit comments