| |
|
|
| 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() |
|
|