ROMCleaner
ROMCleaner will remove files on disk (and from the cache file) that are no longer included in the user config.
ROMCleaner has no config arguments.
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