Compare commits
No commits in common. "caf7844972b1241787a00f28d4498707e0fae851" and "c6caac6965ce731e9a5c4ae30cd095651d32cf5c" have entirely different histories.
caf7844972
...
c6caac6965
@ -3,4 +3,3 @@ msoffcrypto-tool>=5.0.0
|
|||||||
tqdm>=4.65.0
|
tqdm>=4.65.0
|
||||||
streamlit>=1.24.0
|
streamlit>=1.24.0
|
||||||
python-docx>=0.8.11
|
python-docx>=0.8.11
|
||||||
tkinter
|
|
||||||
|
|||||||
@ -171,43 +171,29 @@ with col1:
|
|||||||
|
|
||||||
col_src1, col_src2 = st.columns([1, 4])
|
col_src1, col_src2 = st.columns([1, 4])
|
||||||
with col_src1:
|
with col_src1:
|
||||||
if st.button("Browse", key='source_browse'):
|
if st.button("How to Browse", key='source_browse'):
|
||||||
try:
|
st.info("""
|
||||||
if platform.system() == "Darwin": # macOS
|
To find your folder path in Windows:
|
||||||
try:
|
1. Open File Explorer
|
||||||
result = subprocess.run(
|
2. Navigate to your desired folder
|
||||||
['osascript', '-e', 'choose folder with prompt "Select Source Directory"'],
|
3. Click in the address bar (or press Alt+D)
|
||||||
capture_output=True,
|
4. Copy the full path (Ctrl+C)
|
||||||
text=True
|
5. Paste it here (Ctrl+V)
|
||||||
)
|
|
||||||
if result.returncode == 0:
|
Example paths:
|
||||||
path = result.stdout.strip()
|
C:\\Users\\YourName\\Documents
|
||||||
st.session_state['source_dir'] = path
|
D:\\Work\\Files
|
||||||
st.session_state['source_dir_input'] = path
|
""")
|
||||||
st.experimental_rerun()
|
|
||||||
except Exception as e:
|
|
||||||
st.error(f"Error using AppleScript: {str(e)}")
|
|
||||||
else: # Windows or Linux
|
|
||||||
import tkinter as tk
|
|
||||||
from tkinter import filedialog
|
|
||||||
root = tk.Tk()
|
|
||||||
root.withdraw()
|
|
||||||
root.wm_attributes('-topmost', 1)
|
|
||||||
path = filedialog.askdirectory(title="Select Source Directory")
|
|
||||||
if path:
|
|
||||||
st.session_state['source_dir'] = path
|
|
||||||
st.session_state['source_dir_input'] = path
|
|
||||||
st.experimental_rerun()
|
|
||||||
root.destroy()
|
|
||||||
except Exception as e:
|
|
||||||
st.error(f"Error selecting directory: {str(e)}")
|
|
||||||
|
|
||||||
# Add a check and display for source directory status
|
# Add a check and display for source directory status
|
||||||
if source_dir:
|
if source_dir:
|
||||||
|
# Convert Windows path to Linux path if needed
|
||||||
|
source_dir = source_dir.replace('\\', '/')
|
||||||
if os.path.exists(source_dir):
|
if os.path.exists(source_dir):
|
||||||
st.success(f"✅ Source directory exists: {source_dir}")
|
st.success(f"✅ Source directory exists: {source_dir}")
|
||||||
else:
|
else:
|
||||||
st.error(f"❌ Source directory not found: {source_dir}")
|
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",
|
||||||
@ -217,39 +203,24 @@ with col1:
|
|||||||
|
|
||||||
col_dest1, col_dest2 = st.columns([1, 4])
|
col_dest1, col_dest2 = st.columns([1, 4])
|
||||||
with col_dest1:
|
with col_dest1:
|
||||||
if st.button("Browse", key='dest_browse'):
|
if st.button("How to Browse", key='dest_browse'):
|
||||||
try:
|
st.info("""
|
||||||
if platform.system() == "Darwin": # macOS
|
To find your folder path in Windows:
|
||||||
try:
|
1. Open File Explorer
|
||||||
result = subprocess.run(
|
2. Navigate to your desired folder
|
||||||
['osascript', '-e', 'choose folder with prompt "Select Destination Directory"'],
|
3. Click in the address bar (or press Alt+D)
|
||||||
capture_output=True,
|
4. Copy the full path (Ctrl+C)
|
||||||
text=True
|
5. Paste it here (Ctrl+V)
|
||||||
)
|
|
||||||
if result.returncode == 0:
|
Example paths:
|
||||||
path = result.stdout.strip()
|
C:\\Users\\YourName\\Documents
|
||||||
st.session_state['dest_dir'] = path
|
D:\\Work\\Files
|
||||||
st.session_state['dest_dir_input'] = path
|
""")
|
||||||
st.experimental_rerun()
|
|
||||||
except Exception as e:
|
|
||||||
st.error(f"Error using AppleScript: {str(e)}")
|
|
||||||
else: # Windows or Linux
|
|
||||||
import tkinter as tk
|
|
||||||
from tkinter import filedialog
|
|
||||||
root = tk.Tk()
|
|
||||||
root.withdraw()
|
|
||||||
root.wm_attributes('-topmost', 1)
|
|
||||||
path = filedialog.askdirectory(title="Select Destination Directory")
|
|
||||||
if path:
|
|
||||||
st.session_state['dest_dir'] = path
|
|
||||||
st.session_state['dest_dir_input'] = path
|
|
||||||
st.experimental_rerun()
|
|
||||||
root.destroy()
|
|
||||||
except Exception as e:
|
|
||||||
st.error(f"Error selecting directory: {str(e)}")
|
|
||||||
|
|
||||||
# Add a check and display for destination directory status
|
# Add a check and display for destination directory status
|
||||||
if dest_dir:
|
if dest_dir:
|
||||||
|
# Convert Windows path to Linux path if needed
|
||||||
|
dest_dir = dest_dir.replace('\\', '/')
|
||||||
dest_parent = os.path.dirname(dest_dir)
|
dest_parent = os.path.dirname(dest_dir)
|
||||||
if os.path.exists(dest_parent):
|
if os.path.exists(dest_parent):
|
||||||
if os.path.exists(dest_dir):
|
if os.path.exists(dest_dir):
|
||||||
@ -258,6 +229,7 @@ with col1:
|
|||||||
st.info(f"i️ Destination directory will be created: {dest_dir}")
|
st.info(f"i️ Destination directory will be created: {dest_dir}")
|
||||||
else:
|
else:
|
||||||
st.error(f"❌ Parent directory not found: {dest_parent}")
|
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