cyyeh commited on
Commit
f9a6b46
·
1 Parent(s): a62882f
Files changed (1) hide show
  1. app.py +11 -4
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 generate_imports_graph(python_files):
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
- with st.spinner("Parsing python files and generating imports graph..."):
66
- imports_graph = generate_imports_graph(python_files)
 
 
 
 
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}")