Spaces:
Runtime error
Runtime error
refactor
Browse files
app.py
CHANGED
|
@@ -42,9 +42,12 @@ def get_python_files(owner, repo, tree_sha):
|
|
| 42 |
|
| 43 |
|
| 44 |
@conditonal_decorator(time_function, DEV)
|
| 45 |
-
def
|
| 46 |
-
analyzer = CodeImportsAnalyzer(python_files)
|
| 47 |
asyncio.run(analyzer.analyze())
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
return analyzer.generate_imports_graph()
|
| 49 |
|
| 50 |
|
|
@@ -62,8 +65,12 @@ if clicked_ok_button and owner and repo:
|
|
| 62 |
with st.spinner("Getting python files..."):
|
| 63 |
python_files = get_python_files(owner, repo, tree_sha)
|
| 64 |
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
with st.spinner("Generating graph visualization file..."):
|
| 69 |
generate_graph_visualization_file(imports_graph, f"{owner}/{repo}")
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
@conditonal_decorator(time_function, DEV)
|
| 45 |
+
def parse_python_files(analyzer):
|
|
|
|
| 46 |
asyncio.run(analyzer.analyze())
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
@conditonal_decorator(time_function, DEV)
|
| 50 |
+
def generate_imports_graph(analyzer):
|
| 51 |
return analyzer.generate_imports_graph()
|
| 52 |
|
| 53 |
|
|
|
|
| 65 |
with st.spinner("Getting python files..."):
|
| 66 |
python_files = get_python_files(owner, repo, tree_sha)
|
| 67 |
|
| 68 |
+
analyzer = CodeImportsAnalyzer(python_files)
|
| 69 |
+
with st.spinner("Parsing python files..."):
|
| 70 |
+
parse_python_files(analyzer)
|
| 71 |
+
|
| 72 |
+
with st.spinner("Generating imports graph..."):
|
| 73 |
+
imports_graph = generate_imports_graph(analyzer)
|
| 74 |
|
| 75 |
with st.spinner("Generating graph visualization file..."):
|
| 76 |
generate_graph_visualization_file(imports_graph, f"{owner}/{repo}")
|