diff --git a/uni_RX4R_v75sm.frk b/old/uni_RX4R_v75sm.frk similarity index 100% rename from uni_RX4R_v75sm.frk rename to old/uni_RX4R_v75sm.frk diff --git a/uni_RX6R_v75sm.frk b/old/uni_RX6R_v75sm.frk similarity index 100% rename from uni_RX6R_v75sm.frk rename to old/uni_RX6R_v75sm.frk diff --git a/packaging/files_name_mapping.py b/packaging/files_name_mapping.py index 971ef9e..6716d06 100644 --- a/packaging/files_name_mapping.py +++ b/packaging/files_name_mapping.py @@ -7,38 +7,49 @@ mapping_list = { 'X8R': ['X6R', 'X8R'], - 'RX4R': ['RX4R', 'RX6R'], - 'RXXR_GRXX': ['G-RX6', 'G-RX8'], 'RX8RPRO': ['RX8R-PRO'], + # 'RX4R': ['RX4R', 'RX6R'], + 'RXXR_GRXX': ['G-RX6', 'G-RX8', 'RX4R', 'RX6R'], } +ignored_list = ['RX4R', 'RX6R'] + raw_dir = os.path.normpath(f'{SCRIPT_DIR}/../raw/') to_dir = os.path.normpath(f'{SCRIPT_DIR}/..') -frk_list = os.listdir(raw_dir) - -for from_name in frk_list: - to_name = from_name.lower() - g = re.match('(uni_)?(.*)_([a-z]*)(\d{2,3})([a-z]*)\.frk', to_name) - g1 = g.group(1) - rx_name = g.group(2).upper() - g3 = g.group(3) - ver = g.group(4) - g5 = g.group(5) - - g3 = g3.replace('rom', '') - g5 = g5.replace('rom', '') - postfix = g3 + g5 - - if rx_name in mapping_list: - mapped_rxs = mapping_list[rx_name] - for mapped_rx in mapped_rxs: - to_name = f'uni_{mapped_rx}_v{ver}{postfix}.frk' + + +def main(): + frk_list = os.listdir(raw_dir) + + for from_name in frk_list: + to_name = from_name.lower() + g = re.match(r'(uni_)?(.*)_([a-z]*)(\d{2,3})([a-z]*)\.frk', to_name) + g1 = g.group(1) + rx_name = g.group(2).upper() + g3 = g.group(3) + ver = g.group(4) + g5 = g.group(5) + + g3 = g3.replace('rom', '') + g5 = g5.replace('rom', '') + postfix = g3 + g5 + + if rx_name in ignored_list: + continue + + if rx_name in mapping_list: + mapped_rxs = mapping_list[rx_name] + for mapped_rx in mapped_rxs: + to_name = f'uni_{mapped_rx}_v{ver}{postfix}.frk' + print(to_name) + shutil.copy2(f'{raw_dir}/{from_name}', f'{to_dir}/{to_name}') + else: + to_name = f'uni_{rx_name}_v{ver}{postfix}.frk' print(to_name) shutil.copy2(f'{raw_dir}/{from_name}', f'{to_dir}/{to_name}') - else: - to_name = f'uni_{rx_name}_v{ver}{postfix}.frk' + print(to_name) - shutil.copy2(f'{raw_dir}/{from_name}', f'{to_dir}/{to_name}') + pass + - print(to_name) - pass +main() diff --git a/raw/RX4R_75sm.frk b/raw/RX4R_75sm.frk deleted file mode 100644 index 3e43854..0000000 Binary files a/raw/RX4R_75sm.frk and /dev/null differ diff --git a/readme.md b/readme.md index 02fddd9..a28f988 100644 --- a/readme.md +++ b/readme.md @@ -14,8 +14,8 @@ https://forum.alofthobbies.com/index.php?threads/uni-receiver-firmware-release-f | XSR | xsr_rom57.frk | | RX8R | rx8r_rom57.frk | | RX8R-PRO | UNI_rx8rpro_59sm.frk | -| RX4R | RX4R_75sm.frk | -| RX6R | RX4R_75sm.frk | +| RX4R | UNI_RXxR_GRXx_78sm.frk | +| RX6R | UNI_RXxR_GRXx_78sm.frk | | G-RX6 | UNI_RXxR_GRXx_78sm.frk | | G-RX8 | UNI_RXxR_GRXx_78sm.frk | diff --git a/uni_RX4R_v78sm.frk b/uni_RX4R_v78sm.frk new file mode 100644 index 0000000..266bd71 Binary files /dev/null and b/uni_RX4R_v78sm.frk differ diff --git a/uni_RX6R_v78sm.frk b/uni_RX6R_v78sm.frk new file mode 100644 index 0000000..266bd71 Binary files /dev/null and b/uni_RX6R_v78sm.frk differ