Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,13 +16,15 @@ if 'selected_branches' not in st.session_state:
|
|
16 |
st.session_state['selected_branches'] = []
|
17 |
if 'selected_contributor' not in st.session_state:
|
18 |
st.session_state['selected_contributor'] = ''
|
19 |
-
if '
|
20 |
-
st.session_state['
|
21 |
if 'sync' not in st.session_state:
|
22 |
st.session_state['sync'] = False
|
23 |
if 'Recap' not in st.session_state:
|
24 |
st.session_state['Recap'] = False
|
25 |
|
|
|
|
|
26 |
markdown = r"""
|
27 |
# GitHub Recap: Repository
|
28 |
Details about the repository: Lorem ipsum dolor sit amet...
|
@@ -62,14 +64,13 @@ st.session_state['reponame'] = st.text_input("reponame")
|
|
62 |
|
63 |
if st.button("sync"):
|
64 |
st.session_state['sync'] = True
|
65 |
-
# Load button to fetch repo data (simulated with mock data)
|
66 |
-
if st.session_state['sync']:
|
67 |
contributors_list = get_contributors(st.session_state['reponame'], updated_token=st.session_state['private_token'])
|
68 |
branches_list = get_repo_branches(st.session_state['reponame'], updated_token=st.session_state['private_token'])
|
|
|
|
|
69 |
|
70 |
st.session_state['selected_branches'] = branches_list
|
71 |
st.session_state['selected_contributor'] = '' # Reset selected contributor
|
72 |
-
|
73 |
# Branch selection
|
74 |
branch_option = st.radio("Select branches:", options=["all", "specific"])
|
75 |
|
@@ -82,11 +83,17 @@ if st.session_state['sync']:
|
|
82 |
# Get recap button
|
83 |
if st.button("Get Recap"):
|
84 |
st.session_state['Recap'] = True
|
|
|
85 |
|
|
|
86 |
st.session_state['sync'] = False
|
87 |
|
88 |
if st.session_state['Recap']:
|
89 |
-
|
|
|
|
|
|
|
|
|
90 |
# Placeholder for GitHub markdown content
|
91 |
rs.slides(markdown, height=500)
|
92 |
|
|
|
16 |
st.session_state['selected_branches'] = []
|
17 |
if 'selected_contributor' not in st.session_state:
|
18 |
st.session_state['selected_contributor'] = ''
|
19 |
+
if 'commits' not in st.session_state:
|
20 |
+
st.session_state['commits'] = []
|
21 |
if 'sync' not in st.session_state:
|
22 |
st.session_state['sync'] = False
|
23 |
if 'Recap' not in st.session_state:
|
24 |
st.session_state['Recap'] = False
|
25 |
|
26 |
+
|
27 |
+
|
28 |
markdown = r"""
|
29 |
# GitHub Recap: Repository
|
30 |
Details about the repository: Lorem ipsum dolor sit amet...
|
|
|
64 |
|
65 |
if st.button("sync"):
|
66 |
st.session_state['sync'] = True
|
|
|
|
|
67 |
contributors_list = get_contributors(st.session_state['reponame'], updated_token=st.session_state['private_token'])
|
68 |
branches_list = get_repo_branches(st.session_state['reponame'], updated_token=st.session_state['private_token'])
|
69 |
+
# Load button to fetch repo data (simulated with mock data)
|
70 |
+
if st.session_state['sync']:
|
71 |
|
72 |
st.session_state['selected_branches'] = branches_list
|
73 |
st.session_state['selected_contributor'] = '' # Reset selected contributor
|
|
|
74 |
# Branch selection
|
75 |
branch_option = st.radio("Select branches:", options=["all", "specific"])
|
76 |
|
|
|
83 |
# Get recap button
|
84 |
if st.button("Get Recap"):
|
85 |
st.session_state['Recap'] = True
|
86 |
+
st.session_state['commits'] = get_contributor_commits(repo_name, contributor, period, updated_token=None)
|
87 |
|
88 |
+
# st.session_state['markdown'] = get_markdown(st.session_state['commits'])
|
89 |
st.session_state['sync'] = False
|
90 |
|
91 |
if st.session_state['Recap']:
|
92 |
+
# get_contributor_commits(repo_name, contributor, period, updated_token=None)
|
93 |
+
if st.session_state['commits']:
|
94 |
+
st.text(str(len(st.session_state['commits'])), " commits fetched")
|
95 |
+
else:
|
96 |
+
st.text("fetching commits")
|
97 |
# Placeholder for GitHub markdown content
|
98 |
rs.slides(markdown, height=500)
|
99 |
|