Skip to content

Commit feb751d

Browse files
authored
move print html tag to a new func
1 parent 2b6e0ed commit feb751d

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

export.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,7 @@ def group_by_languages(repos):
7171

7272
return languages
7373

74-
username="basemax"
75-
profile = check_user(username)
76-
77-
try:
78-
# print(profile)
79-
# print(profile["public_repos"])
80-
public_repos = profile["public_repos"]
81-
except IndexError:
82-
public_repos = 0
83-
84-
if public_repos:
85-
all_repos = get_all_repos(username, public_repos)
86-
groups = group_by_languages(all_repos)
87-
74+
def generate_html(groups):
8875
print("<h1>" + profile["name"] + " GitHub</h1>")
8976

9077
for language, repos in groups.items():
@@ -100,6 +87,24 @@ def group_by_languages(repos):
10087
print(" </li>")
10188

10289
print("</ul>\n")
103-
print(res)
90+
91+
username="basemax"
92+
profile = check_user(username)
93+
94+
try:
95+
# print(profile)
96+
# print(profile["public_repos"])
97+
public_repos = profile["public_repos"]
98+
except IndexError:
99+
public_repos = 0
100+
101+
if public_repos:
102+
all_repos = get_all_repos(username, public_repos)
103+
104+
groups = group_by_languages(all_repos)
105+
# print(groups)
106+
107+
# generate HTML output
108+
generate_html(groups)
104109
else:
105110
print("Error: No public repositories or maybe network problem!")

0 commit comments

Comments
 (0)