Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,17 +22,23 @@ def main():
|
|
| 22 |
# Load the selected file
|
| 23 |
file_contents = load_file(selected_file)
|
| 24 |
|
| 25 |
-
# Display file contents
|
| 26 |
-
st.text_area('File Contents:', file_contents, height=300)
|
| 27 |
-
|
| 28 |
# Add parameter input boxes based on file content
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
parameter_values = {}
|
| 31 |
-
for param in parameters:
|
| 32 |
parameter_values[param] = st.text_input(f'Enter value for {param}:')
|
| 33 |
|
| 34 |
-
# Update file with parameter values
|
| 35 |
-
updated_contents = replace_parameters(file_contents, parameter_values)
|
| 36 |
|
| 37 |
# Save button
|
| 38 |
if st.button('Save Changes'):
|
|
|
|
| 22 |
# Load the selected file
|
| 23 |
file_contents = load_file(selected_file)
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
# Add parameter input boxes based on file content
|
| 26 |
+
replacements = {
|
| 27 |
+
"Month_day_year" : current_date_format1,
|
| 28 |
+
"owner_name": "owner_name_new",
|
| 29 |
+
"property_owner": "property_owner_new",
|
| 30 |
+
"property_address": "property_address_new",
|
| 31 |
+
"purchase_price": "1000000",
|
| 32 |
+
"property_size_sf": "1000",
|
| 33 |
+
"price_per_sf": "20.55",
|
| 34 |
+
"brokerage_name": "brokerage_name_new",
|
| 35 |
+
"current_date": current_date_format2
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
parameter_values = {}
|
| 39 |
+
for param in parameters.keys():
|
| 40 |
parameter_values[param] = st.text_input(f'Enter value for {param}:')
|
| 41 |
|
|
|
|
|
|
|
| 42 |
|
| 43 |
# Save button
|
| 44 |
if st.button('Save Changes'):
|