-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from bbtufty/romparser-patches
RAHashes with patch files
- Loading branch information
Showing
19 changed files
with
391 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Nintendo - Game Boy: | ||
file_mapping: "Nintendo - Game Boy" | ||
file_mapping: "Nintendo - Game Boy (*)" | ||
|
||
Nintendo - Game Boy Color: | ||
file_mapping: "Nintendo - Game Boy Color" | ||
file_mapping: "Nintendo - Game Boy Color (*)" | ||
|
||
Nintendo - Nintendo Entertainment System: | ||
file_mapping: "Nintendo - Nintendo Entertainment System (Headered)" | ||
file_mapping: "Nintendo - Nintendo Entertainment System (Headered) (*)" | ||
|
||
Nintendo - Super Nintendo Entertainment System: | ||
file_mapping: "Nintendo - Super Nintendo Entertainment System" | ||
file_mapping: "Nintendo - Super Nintendo Entertainment System (*)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from .parsing_tools import check_regex_parsing, parse_games_from_dat | ||
from .gamefinder_dev import check_regex_parsing, parse_games_from_dat | ||
from .rahasher_dev import check_rahasher_names | ||
|
||
__all__ = [ | ||
"check_regex_parsing", | ||
"check_rahasher_names", | ||
"parse_games_from_dat", | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import os | ||
|
||
from ..util import load_yml, load_json | ||
|
||
|
||
def check_rahasher_names(config_file, platform): | ||
"""Using a config file and platform, get all applicable RA names with hashes | ||
Args: | ||
config_file (string): Path to the config file | ||
platform (string): Platform name | ||
""" | ||
|
||
config = load_yml(config_file) | ||
|
||
ra_hash_dir = config.get("dirs", {}).get("ra_hash_dir", None) | ||
|
||
if ra_hash_dir is None: | ||
raise ValueError("No ra_hash_dir found in config file") | ||
|
||
ra_hash_filename = os.path.join(ra_hash_dir, f"{platform}.json") | ||
|
||
if not os.path.exists(ra_hash_filename): | ||
raise ValueError("No RA hash file found") | ||
|
||
ra_hash_dict = load_json(ra_hash_filename) | ||
|
||
ra_hashes = {} | ||
for r in ra_hash_dict: | ||
for h in ra_hash_dict[r]["Hashes"]: | ||
ra_hashes[h["MD5"]] = { | ||
"name": h["Name"], | ||
"hash": h["MD5"], | ||
"patch_name": h["PatchUrl"], | ||
} | ||
|
||
return ra_hashes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.