turns out windows' built in zip hates LZMA
also fix APMC output path
This commit is contained in:
		
							parent
							
								
									8a1ac566c8
								
							
						
					
					
						commit
						b2f5f095fc
					
				
							
								
								
									
										2
									
								
								Main.py
								
								
								
								
							
							
						
						
									
										2
									
								
								Main.py
								
								
								
								
							| 
						 | 
					@ -566,7 +566,7 @@ def main(args, seed=None):
 | 
				
			||||||
        if args.create_spoiler:  # needs spoiler.hashes to be filled, that depend on rom_futures being done
 | 
					        if args.create_spoiler:  # needs spoiler.hashes to be filled, that depend on rom_futures being done
 | 
				
			||||||
            world.spoiler.to_file(os.path.join(temp_dir, '%s_Spoiler.txt' % outfilebase))
 | 
					            world.spoiler.to_file(os.path.join(temp_dir, '%s_Spoiler.txt' % outfilebase))
 | 
				
			||||||
        logger.info('Creating final archive.')
 | 
					        logger.info('Creating final archive.')
 | 
				
			||||||
        with zipfile.ZipFile(output_path(f"AP_{world.seed_name}.zip"), mode="w", compression=zipfile.ZIP_LZMA,
 | 
					        with zipfile.ZipFile(output_path(f"AP_{world.seed_name}.zip"), mode="w", compression=zipfile.ZIP_DEFLATED,
 | 
				
			||||||
                             compresslevel=9) as zf:
 | 
					                             compresslevel=9) as zf:
 | 
				
			||||||
            for file in os.scandir(temp_dir):
 | 
					            for file in os.scandir(temp_dir):
 | 
				
			||||||
                zf.write(os.path.join(temp_dir, file), arcname=file.name)
 | 
					                zf.write(os.path.join(temp_dir, file), arcname=file.name)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
from typing import Dict, Set
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .Items import MinecraftItem, item_table, item_frequencies
 | 
					from .Items import MinecraftItem, item_table, item_frequencies
 | 
				
			||||||
| 
						 | 
					@ -81,11 +81,10 @@ class MinecraftWorld(World):
 | 
				
			||||||
    def generate_output(self, output_directory: str):
 | 
					    def generate_output(self, output_directory: str):
 | 
				
			||||||
        import json
 | 
					        import json
 | 
				
			||||||
        from base64 import b64encode
 | 
					        from base64 import b64encode
 | 
				
			||||||
        from Utils import output_path
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        data = self._get_mc_data()
 | 
					        data = self._get_mc_data()
 | 
				
			||||||
        filename = f"AP_{self.world.seed_name}_P{self.player}_{self.world.get_player_names(self.player)}.apmc"
 | 
					        filename = f"AP_{self.world.seed_name}_P{self.player}_{self.world.get_player_names(self.player)}.apmc"
 | 
				
			||||||
        with open(output_path(filename), 'wb') as f:
 | 
					        with open(os.path.join(output_directory, filename), 'wb') as f:
 | 
				
			||||||
            f.write(b64encode(bytes(json.dumps(data), 'utf-8')))
 | 
					            f.write(b64encode(bytes(json.dumps(data), 'utf-8')))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def fill_slot_data(self): 
 | 
					    def fill_slot_data(self): 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue