-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathget_member_details.py
37 lines (30 loc) · 1.12 KB
/
get_member_details.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import functions
import argparse
import os
cur_path = os.path.dirname(os.path.realpath(__file__))
if (os.name == 'nt'):
path_seperator = "\\"
else:
path_seperator = "/"
if os.path.isfile(cur_path + path_seperator + 'local_config.py'):
import local_config as config
else:
import config
if config.GitHubAuthKey == "":
print "Please add your Github api key (Settings -> Applications -> Personal Access Tokens) to config.py\n"
exit()
if config.Organisation == "":
print "Please add your Github organisation (https://github.com/settings/organizations) to config.py\n"
exit()
parser = argparse.ArgumentParser(description='Show details Github user.')
parser.add_argument('username', metavar='<user name>', nargs=1,
help='Github user names that should queried')
args = parser.parse_args()
user = args.username[0]
response = functions.do_github_api_request('https://api.github.com/users/' + user)
message = response.get('message', None)
if message:
print(message)
else:
for key in response.keys():
print str(key) + ": " + str(response[key])