fire-detection / scripts /check_status_upload.py
Alley P
refactor: reorganize proj structure ; remove unused scripts; add dataset configs
7873ee1
Raw
History Blame Contribute Delete
1.97 kB
#!/usr/bin/env python3
import subprocess
import os
from pathlib import Path
def find_python_processes():
try:
result = subprocess.run(
['wmic', 'process', 'where', 'name="python.exe"', 'get', 'processid,commandline'],
capture_output=True,
text=True
)
if result.returncode == 0:
lines = result.stdout.strip().split('\n')
upload_processes = [
line.strip() for line in lines[1:] if line.strip() and 'upload' in line.lower()
]
if upload_processes:
print("βœ“ Upload processes found:")
for proc in upload_processes:
print(f" {proc}")
else:
print("⚠ No upload processes found")
else:
print("βœ— Error checking processes")
except Exception as e:
print(f"Error: {e}")
def check_files():
files_to_check = [
'upload_log.txt',
'test_upload_results.txt',
'dagshub_analysis.txt'
]
for file_path in files_to_check:
path = Path(file_path)
if path.exists():
size = path.stat().st_size
print(f"βœ“ {file_path} exists ({size} bytes)")
else:
print(f"⚠ {file_path} does not exist")
def main():
print("=== Upload Status Check ===")
print(f"Current directory: {os.getcwd()}")
print()
print("1. Checking processes...")
find_python_processes()
print("\n2. Checking files...")
check_files()
try:
result = subprocess.run(['dagshub', '--help'], capture_output=True, text=True, timeout=5)
if result.returncode == 0:
print("βœ“ DagsHub CLI is working")
else:
print("βœ— DagsHub CLI is not working")
except Exception as e:
print(f"βœ— Error testing DagsHub CLI: {e}")
if __name__ == "__main__":
main()