Compare commits
4 Commits
8b4f00913b
...
61b139fcb9
| Author | SHA1 | Date | |
|---|---|---|---|
| 61b139fcb9 | |||
| 1662c3d2dd | |||
| 67bfc5c103 | |||
| 70ea7c39b3 |
@ -187,15 +187,27 @@ with col1:
|
|||||||
key='source_dir_input',
|
key='source_dir_input',
|
||||||
help="Enter the full path to the directory containing files to process")
|
help="Enter the full path to the directory containing files to process")
|
||||||
|
|
||||||
if st.button("Browse Source Directory", key='source_browse'):
|
col_src1, col_src2 = st.columns([1, 4])
|
||||||
try:
|
with col_src1:
|
||||||
path = select_directory_with_dialog("Select Source Directory")
|
if st.button("Browse", key='source_browse'):
|
||||||
if path:
|
st.info("""
|
||||||
st.session_state['source_dir'] = path
|
To browse for a directory:
|
||||||
st.session_state['source_dir_input'] = path
|
1. Open Windows File Explorer
|
||||||
st.experimental_rerun()
|
2. Navigate to your desired folder
|
||||||
except Exception as e:
|
3. Click in the address bar (or press Alt+D)
|
||||||
st.error(f"Error selecting directory: {str(e)}")
|
4. Copy the full path (Ctrl+C)
|
||||||
|
5. Paste it here (Ctrl+V)
|
||||||
|
""")
|
||||||
|
|
||||||
|
# Add a check and display for source directory status
|
||||||
|
if source_dir:
|
||||||
|
# Convert Windows path to Linux path if needed
|
||||||
|
source_dir = source_dir.replace('\\', '/')
|
||||||
|
if os.path.exists(source_dir):
|
||||||
|
st.success(f"✅ Source directory exists: {source_dir}")
|
||||||
|
else:
|
||||||
|
st.error(f"❌ Source directory not found: {source_dir}")
|
||||||
|
st.info("Make sure the path is accessible to the Linux server")
|
||||||
|
|
||||||
# Destination Directory
|
# Destination Directory
|
||||||
dest_dir = st.text_input("Destination Directory Path",
|
dest_dir = st.text_input("Destination Directory Path",
|
||||||
@ -203,15 +215,31 @@ with col1:
|
|||||||
key='dest_dir_input',
|
key='dest_dir_input',
|
||||||
help="Enter the full path where processed files will be saved")
|
help="Enter the full path where processed files will be saved")
|
||||||
|
|
||||||
if st.button("Browse Destination Directory", key='dest_browse'):
|
col_dest1, col_dest2 = st.columns([1, 4])
|
||||||
try:
|
with col_dest1:
|
||||||
path = select_directory_with_dialog("Select Destination Directory")
|
if st.button("Browse", key='dest_browse'):
|
||||||
if path:
|
st.info("""
|
||||||
st.session_state['dest_dir'] = path
|
To browse for a directory:
|
||||||
st.session_state['dest_dir_input'] = path
|
1. Open Windows File Explorer
|
||||||
st.experimental_rerun()
|
2. Navigate to your desired folder
|
||||||
except Exception as e:
|
3. Click in the address bar (or press Alt+D)
|
||||||
st.error(f"Error selecting directory: {str(e)}")
|
4. Copy the full path (Ctrl+C)
|
||||||
|
5. Paste it here (Ctrl+V)
|
||||||
|
""")
|
||||||
|
|
||||||
|
# Add a check and display for destination directory status
|
||||||
|
if dest_dir:
|
||||||
|
# Convert Windows path to Linux path if needed
|
||||||
|
dest_dir = dest_dir.replace('\\', '/')
|
||||||
|
dest_parent = os.path.dirname(dest_dir)
|
||||||
|
if os.path.exists(dest_parent):
|
||||||
|
if os.path.exists(dest_dir):
|
||||||
|
st.success(f"✅ Destination directory exists: {dest_dir}")
|
||||||
|
else:
|
||||||
|
st.info(f"i️ Destination directory will be created: {dest_dir}")
|
||||||
|
else:
|
||||||
|
st.error(f"❌ Parent directory not found: {dest_parent}")
|
||||||
|
st.info("Make sure the path is accessible to the Linux server")
|
||||||
|
|
||||||
with col2:
|
with col2:
|
||||||
if file_type == "Excel":
|
if file_type == "Excel":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user