Skip to content

Commit fefb17a

Browse files
committed
Re-format app.py Python code with Black formatter
and re-sort importing modules with isort
1 parent e8d13bb commit fefb17a

File tree

1 file changed

+13
-7
lines changed
  • infrastructure/users-repo

1 file changed

+13
-7
lines changed

infrastructure/users-repo/app.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
# Author: Madhu Akula
33
# This program has been created as part of Kubernetes Goat
44
# User repositories information using API
5-
import requests
65
import json
7-
import sys
86
import os
7+
import sys
8+
9+
import requests
10+
911

1012
def get_repo_details(user_name):
1113
# This need to be added in environment variables
12-
API_KEY = os.environ['API_KEY']
13-
headers = {'secret-api-key': API_KEY}
14-
r = requests.get("https://api.github.com/users/" + user_name + "/repos", headers=headers)
14+
API_KEY = os.environ["API_KEY"]
15+
headers = {"secret-api-key": API_KEY}
16+
r = requests.get(
17+
"https://api.github.com/users/" + user_name + "/repos", headers=headers
18+
)
1519
return print(json.dumps(r.json(), indent=2))
1620

21+
1722
def main():
1823
print("Welcome to users repo information")
19-
if len (sys.argv) != 2 :
24+
if len(sys.argv) != 2:
2025
print("Usage: python main.py madhuakula")
21-
sys.exit (1)
26+
sys.exit(1)
2227
user_name = sys.argv[1]
2328
get_repo_details(user_name)
2429

30+
2531
if __name__ == "__main__":
2632
main()

0 commit comments

Comments
 (0)