ROMMover
ROMMover will move the final chosen ROM files to a clean directory structure, optionally unzipping files along the way.
If multi-disc handling is enabled, then for multi-disc games files will be moved to a hidden folder (e.g.
.Final Fantasy VII (USA) within the main game folder), and an m3u playlist file will be created to point at those
files.
If a patch file is found and ROMPatcher is turned on, then the file will also be patched at this stage.
For more details on the ROMMover arguments, see the config file documentation.
API
- class romsearch.ROMMover(platform, config_file=None, config=None, platform_config=None, regex_config=None, logger=None, log_line_sep='=', log_line_length=100)[source]
ROM Moving and cache updating tool
Because we do this per-platform, per-game, they need to be specified here
- Parameters:
platform (str) – Platform name
config_file (str, optional) – path to config file. Defaults to None.
config (dict, optional) – configuration dictionary. Defaults to None.
platform_config (dict, optional) – platform configuration dictionary. Defaults to None.
regex_config (dict, optional) – regex configuration dictionary. Defaults to None.
logger (logging.Logger, optional) – logger. Defaults to None.
log_line_length (int, optional) – Line length of log. Defaults to 100
- cache_update(game, rom, files, out_dir, rom_dict)[source]
Update the cache with new file data
- Parameters:
game – Game name
rom – ROM name for dictionary info
files – List of files to save to cache
out_dir – Output directory for files, relative to [rom_dir]/[platform]
rom_dict – Dictionary of ROM properties
- cache_update_multi_disc(game, m3u_name, files, out_dir)[source]
Update the cache with m3u playlist info
- Parameters:
game – Game name
m3u_name – m3u playlist name to save to cache
files – List of files to save to cache
out_dir – Output directory for files, relative to [rom_dir]/[platform]
- check_compress_suitable(rom_file)[source]
Check if a file is suitable for compression given compression method
- Parameters:
rom_file – File to check
- check_files_exist(rom, files, file_ext_key, patched_rom=False)[source]
Check files exist, so we know whether to move things around or not
- Parameters:
rom – ROM name
files – List of existing files
file_ext_key – Potential file extensions
patched_rom – Whether ROM is patched or not. Defaults to False
- clean_compress_dir(rom_dict)[source]
Clean any unneeded files from the compress directory
- Parameters:
rom_dict (dict) – ROM dictionary for everything
- clean_patch_dir(rom_dict)[source]
Clean any unneeded directories from the patch directory
- Parameters:
rom_dict (dict) – ROM dictionary for everything
- compress_file(rom)[source]
Compress a file
- Parameters:
rom – ROM name
- move_file(zip_file_name, game, out_dir=None, unzip=False, delete_folder=False)[source]
Move file to directory structure, optionally unzipping
- move_roms(all_rom_dict)[source]
Actually move the roms
- Parameters:
all_rom_dict (dict) – ROM dictionary for everything
- run(rom_dict)[source]
Run the ROMMover
- Parameters:
rom_dict (dict) – ROM dictionary
- save_cache()[source]
Save out the cache file