Spaces:
Sleeping
Sleeping
error commitw
Browse files- app.py +4 -1
- proper_main.py +11 -24
app.py
CHANGED
@@ -30,7 +30,10 @@ def main():
|
|
30 |
st.experimental_rerun()
|
31 |
if option == "Python Analysis":
|
32 |
repo_name,score=self_analysis(report_analysis)
|
33 |
-
|
|
|
|
|
|
|
34 |
st.experimental_rerun()
|
35 |
|
36 |
elif option == "GPT Evaluation":
|
|
|
30 |
st.experimental_rerun()
|
31 |
if option == "Python Analysis":
|
32 |
repo_name,score=self_analysis(report_analysis)
|
33 |
+
output="The Complex Repo is "+ str(repo_name)+" Because the Complexity Score is "+str(score)
|
34 |
+
#st.write("The Complex Repo is",repo_name," Because the Complexity Score is",score)
|
35 |
+
st.text_area("Bot Response:", value=output, height=100)
|
36 |
+
time.sleep(15)
|
37 |
st.experimental_rerun()
|
38 |
|
39 |
elif option == "GPT Evaluation":
|
proper_main.py
CHANGED
@@ -23,32 +23,19 @@ except Exception as e:
|
|
23 |
|
24 |
|
25 |
|
26 |
-
def web_scrape(
|
27 |
-
base_url = "https://
|
28 |
-
|
29 |
-
repos = []
|
30 |
-
user_url = user_url
|
31 |
-
|
32 |
-
if user_url.endswith("/"):
|
33 |
-
user_url = user_url[:-1]
|
34 |
-
|
35 |
-
try:
|
36 |
-
response = requests.get(user_url + "?tab=repositories")
|
37 |
-
except Exception as e:
|
38 |
-
return ("Please provide a valid link:", 1)
|
39 |
-
|
40 |
if response.status_code != 200:
|
41 |
return ("Please provide a valid link.",1)
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
new_url = base_url + a['href']
|
51 |
-
repos.append(new_url)
|
52 |
return (repos,0)
|
53 |
|
54 |
|
|
|
23 |
|
24 |
|
25 |
|
26 |
+
def web_scrape(username,st):
|
27 |
+
base_url = f"https://api.github.com/users/{username}/repos"
|
28 |
+
response = requests.get(url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
if response.status_code != 200:
|
30 |
return ("Please provide a valid link.",1)
|
31 |
+
st.text("Extracting the Repos")
|
32 |
+
repos = []
|
33 |
+
repositories = response.json()
|
34 |
+
for repo in repositories:
|
35 |
+
|
36 |
+
repo_name = repo["name"]
|
37 |
+
|
38 |
+
repos.append(repo_name)
|
|
|
|
|
39 |
return (repos,0)
|
40 |
|
41 |
|