joshuadunlop commited on
Commit
b11764c
·
verified ·
1 Parent(s): 21d9706

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -146,7 +146,6 @@ data_section = st.sidebar.text_area("Paste Data:")
146
  paste_data = st.sidebar.button("Paste Data")
147
  add_row = st.sidebar.button("Add Row")
148
  reset = st.sidebar.button("Reset")
149
- generate_button = st.sidebar.button("Generate All") # Define generate_button here
150
 
151
  # Managing rows and pasted data
152
  if paste_data:
@@ -164,18 +163,13 @@ if reset:
164
 
165
  # Main app layout
166
  row_count = st.session_state.get("row_count", 1)
167
-
168
- # Create two columns: one for the target URL inputs, and one for the download buttons
169
- col1, col2 = st.columns(2)
170
-
171
  for i in range(row_count):
172
- target_url_key = f"target_url_{i}"
173
 
174
- # Input fields in the first column
175
  with col1:
 
176
  target_url = st.text_input(f"Enter the target URL {i + 1}", key=target_url_key)
177
 
178
- # Display and download logic for each row in the second column
179
  with col2:
180
  df_key = f"df_{i}"
181
  df = st.session_state.get(df_key)
@@ -191,6 +185,8 @@ for i in range(row_count):
191
  st.error(f"Failed to generate CSV for URL {i + 1}: No data returned from the API or data processing error.")
192
 
193
  # Generate and reset button logic
 
 
194
  if generate_button:
195
  jobs = Queue()
196
  results = Queue()
@@ -214,7 +210,6 @@ if generate_button:
214
  url_id, df = results.get()
215
  st.session_state[f"df_{url_id}"] = df
216
 
217
-
218
  # Display and download logic for each row
219
  for i in range(row_count):
220
  df_key = f"df_{i}"
 
146
  paste_data = st.sidebar.button("Paste Data")
147
  add_row = st.sidebar.button("Add Row")
148
  reset = st.sidebar.button("Reset")
 
149
 
150
  # Managing rows and pasted data
151
  if paste_data:
 
163
 
164
  # Main app layout
165
  row_count = st.session_state.get("row_count", 1)
 
 
 
 
166
  for i in range(row_count):
167
+ col1, col2 = st.columns(2) # Create two columns
168
 
 
169
  with col1:
170
+ target_url_key = f"target_url_{i}"
171
  target_url = st.text_input(f"Enter the target URL {i + 1}", key=target_url_key)
172
 
 
173
  with col2:
174
  df_key = f"df_{i}"
175
  df = st.session_state.get(df_key)
 
185
  st.error(f"Failed to generate CSV for URL {i + 1}: No data returned from the API or data processing error.")
186
 
187
  # Generate and reset button logic
188
+ generate_button = st.sidebar.button("Generate All")
189
+
190
  if generate_button:
191
  jobs = Queue()
192
  results = Queue()
 
210
  url_id, df = results.get()
211
  st.session_state[f"df_{url_id}"] = df
212
 
 
213
  # Display and download logic for each row
214
  for i in range(row_count):
215
  df_key = f"df_{i}"