You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							31 lines
						
					
					
						
							1019 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							31 lines
						
					
					
						
							1019 B
						
					
					
				| from pathlib import Path | |
| 
 | |
| from clishared import cli_join_rom, cli_read_rom | |
| 
 | |
| print("ThinkPad X230 Bios Dumper v1") | |
| 
 | |
| project_name = input("What would you like to name your project? ") | |
| project_path = Path(project_name).resolve() | |
| 
 | |
| if project_path.exists(): | |
|     if project_path.is_file(): | |
|         raise FileExistsError(f"Cannot create project folder {project_path}, a file already exists here.") | |
|     elif project_path.is_dir(): | |
|         response = input("Folder already exists at this location. Proceed and risk overwriting existing files? (y/N): ") | |
|         if not response or (response.strip()[0] not in ['y', 'Y']): | |
|             raise FileExistsError(f"Cannot create project folder {project_path}, a directory already exists here.") | |
| else: | |
|     project_path.mkdir() | |
|      | |
| clean_path = project_path / "clean" | |
| if not clean_path.exists(): | |
|     clean_path.mkdir() | |
| 
 | |
| cli_read_rom("bottom", clean_path) | |
| # Bell to remind user to move clip | |
| print("\a", end="") | |
| cli_read_rom("top", clean_path) | |
| 
 | |
| cli_join_rom(clean_path) | |
| 
 | |
| print("All done.") |