diff --git a/.gitignore b/.gitignore index d17eb26..884ac71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,5 @@ venv/ __pycache__/ -README.txt -build/ -dist/ -main.spec -output/ -setup.py -Aion-Classic-Mods.json logs/logs.log config/config.ini -config/lists/filter_delete.json -config/lists/font_delete.json -config/lists/voice_delete.json +config/lists/ diff --git a/app_functions.py b/app_functions.py index 58351f3..ccc93b4 100644 --- a/app_functions.py +++ b/app_functions.py @@ -1,6 +1,9 @@ +from __future__ import (division, absolute_import, print_function, unicode_literals) from configparser import ConfigParser from tkinter import messagebox, filedialog -import os, os.path, hashlib, winreg, sys, json, logging, threading, ctypes, locale, shutil, psutil, time +import os, os.path, hashlib, winreg, sys, json, logging, threading, ctypes, locale, shutil, psutil, time, tempfile +import urllib.request as urllib2 +import urllib.parse as urlparse logging.basicConfig(filename='.\\logs\\logs.log', format='%(asctime)s [%(threadName)s] -> [%(levelname)s] -> :: %(message)s', encoding='utf-8', level=logging.DEBUG, filemode='w') logging.getLogger().addHandler(logging.StreamHandler()) @@ -229,7 +232,7 @@ def verifyFilesButton(file_type_list, type_count = 0 for file_type in file_type_list: def verifyFilesThreaded(file_type, type_count): - logging.debug(f"{sys._getframe().f_code.co_name}() -> thread started.") + logging.debug(f"({file_type}) {sys._getframe().f_code.co_name}() -> thread started.") file_type_label_list[type_count].configure(text=translateText("app_return_label_verifying"), text_color=text_color_verifying) install_buttons_list[type_count].configure(text=translateText("app_button_verifying"), state="disabled", font=font_regular) @@ -239,10 +242,18 @@ def verifyFilesThreaded(file_type, type_count): file_type_label_list[type_count].configure(text=translateText("app_return_label_install_ready"), text_color=text_color_fail) install_buttons_list[type_count].configure(text=translateText("app_button_install"), state="normal", font=font_regular_bold) delete_buttons_list[type_count].configure(state="disabled", font=font_regular) + if (file_type == "translation"): + file_type_label_list[type_count].configure(text=translateText("app_return_label_update"), text_color=text_color_success) + install_buttons_list[type_count].configure(text=translateText("app_button_download"), state="normal", font=font_regular_bold) + delete_buttons_list[type_count].configure(state="normal", font=font_regular_bold) else: file_type_label_list[type_count].configure(text=translateText("app_return_label_uptodate"), text_color=text_color_success) install_buttons_list[type_count].configure(text=translateText("app_button_uptodate"), state="disabled", font=font_regular) delete_buttons_list[type_count].configure(state="normal", font=font_regular_bold) + if (file_type == "translation"): + file_type_label_list[type_count].configure(text=translateText("app_return_label_update"), text_color=text_color_success) + install_buttons_list[type_count].configure(text=translateText("app_button_download"), state="normal", font=font_regular_bold) + delete_buttons_list[type_count].configure(state="normal", font=font_regular_bold) verifyFilesThreaded_func = threading.Thread(target=verifyFilesThreaded, args=(file_type, type_count)) verifyFilesThreaded_func.start() #verifyFilesThreaded_func.join() # crashes the app =( @@ -270,17 +281,20 @@ def copyFilesButton(file_type, copy_delete, return_label, return_button, delete_ logging.debug(f"{sys._getframe().f_code.co_name}() -> {copy_delete.capitalize()} ({file_type.capitalize()}) button pressed.") return_label.configure(text=translateText("app_return_label_verifying")) def copyFilesThreaded(): - copy_files_return = copyFiles(file_type, copy_delete) + copy_files_return = copyFiles(file_type, copy_delete, return_label) if copy_files_return == False: return False elif copy_files_return == True: if copy_delete == "copy": return_label.configure(text=translateText("app_return_label_install"), text_color=text_color_success) return_button.configure(text=translateText("app_button_uptodate"), state="disabled", font=font_regular) + delete_button.configure(state="normal", font=font_regular_bold) + if (file_type == "translation"): + return_button.configure(text=translateText("app_button_download"), state="normal", font=font_regular_bold) elif copy_delete == "delete": return_label.configure(text=translateText("app_return_label_deleted"), text_color=text_color_success) return_button.configure(state="disabled", font=font_regular) - delete_button.configure(state="disabled", font=font_regular_bold) + delete_button.configure(state="disabled", font=font_regular) copyFilesThreaded_func = threading.Thread(target=copyFilesThreaded) copyFilesThreaded_func.start() except Exception as e: @@ -302,6 +316,8 @@ def firstRun(): getClassicNaPath() logging.debug(f"{sys._getframe().f_code.co_name}() -> getClassicEuPath() initialized.") getClassicEuPath() + logging.debug(f"{sys._getframe().f_code.co_name}() -> getClassicEuLauncherPath() initialized.") + getClassicEuLauncherPath() logging.debug(f"{sys._getframe().f_code.co_name}() -> verifyGamePath() initialized.") verifyGamePath() logging.debug(f"{sys._getframe().f_code.co_name}() -> defineRegion() initialized.") @@ -537,6 +553,8 @@ def getRelativeFilePath(game_file_type): file_path = "textures\\ui" elif (game_file_type == "voice"): file_path = "sounds\\voice" + elif (game_file_type == "translation"): + file_path = "data" else: logging.error(f"ERROR -> {sys._getframe().f_code.co_name}() :: Unknown file type.") return @@ -603,14 +621,14 @@ def verifyFiles(game_file_type): Calls 'get_full_files()' to finish processing the request. """ try: - if game_file_type in ("filter", "font", "voice"): + if game_file_type in ("filter", "font", "voice", "translation"): # Returns [[verify_hash_list], [copy_files_list]] files_path = getFilePath(game_file_type) assets_full_file_path = files_path[0] full_file_path = files_path[1] - compared_files = getFiles(assets_full_file_path, full_file_path) #compared_files[0] = hash | compared_files[1] = all files - logging.debug(f"{sys._getframe().f_code.co_name}() -> compared_files: {len(compared_files)} - {compared_files}") + compared_files = getFiles(assets_full_file_path, full_file_path, game_file_type) #compared_files[0] = hash | compared_files[1] = all files + logging.debug(f"({game_file_type}) {sys._getframe().f_code.co_name}() -> compared_files: {len(compared_files)} - {compared_files}") def saveFilesJson(copy_files_verify): install_files = copy_files_verify[0] @@ -631,46 +649,63 @@ def saveFilesJson(copy_files_verify): copy_files_verify = compareFilesHash(compared_files) saveFilesJson(copy_files_verify) - logging.debug(f"{sys._getframe().f_code.co_name}() -> copy_files_verify: {len(copy_files_verify)} - {copy_files_verify}") + logging.debug(f"({game_file_type}) {sys._getframe().f_code.co_name}() -> copy_files_verify: {len(copy_files_verify)} - {copy_files_verify}") else: - logging.error(f"ERROR -> {sys._getframe().f_code.co_name}() -> game_file_type: {game_file_type} :: Unknown file type.") + logging.error(f"ERROR -> ({game_file_type}) {sys._getframe().f_code.co_name}() -> game_file_type: {game_file_type} :: Unknown file type.") copy_files_verify = {} - logging.debug(f"{sys._getframe().f_code.co_name}() -> copy_files_verify: {len(copy_files_verify)} {copy_files_verify}.") + logging.debug(f"({game_file_type}) {sys._getframe().f_code.co_name}() -> copy_files_verify: {len(copy_files_verify)} {copy_files_verify}.") if len(copy_files_verify[0]) <= 0: return False elif len(copy_files_verify[0]) >= 1: return True else: - logging.warning(f"{sys._getframe().f_code.co_name}() -> copy_files_verify type: {type(copy_files_verify)}.") + logging.warning(f"({game_file_type}) {sys._getframe().f_code.co_name}() -> copy_files_verify type: {type(copy_files_verify)}.") return False except Exception as e: getException(e) return False -def getFiles(assets_full_file_path, full_file_path): +def getFiles(assets_full_file_path, full_file_path, game_file_type): logging.debug(f"{sys._getframe().f_code.co_name}() -> assets_full_file_path: {assets_full_file_path} - full_file_path: {full_file_path}") try: copy_files_list = [] verify_hash_list = [] for assets_dir in assets_full_file_path: - logging.debug(f"{sys._getframe().f_code.co_name}() -> assets_dir: {assets_dir}.") - for (dirpath, dirnames, filenames) in os.walk(assets_dir): - for filename in filenames: - relative_path = dirpath.replace(assets_dir, "") - for files_dir in full_file_path: - file_path = files_dir+relative_path+'\\'+filename - asset_path = assets_dir+relative_path+'\\'+filename - if not os.path.exists(file_path): - logging.debug(f"{sys._getframe().f_code.co_name}() -> file_path -> copy_files_list[]: NAY {file_path}") - copy_files_list.extend([[asset_path, file_path]]) - else: - logging.debug(f"{sys._getframe().f_code.co_name}() -> file_path -> verify_hash_list[]: AY {file_path}") - verify_hash_list.extend([[asset_path, file_path]]) - logging.debug(f"{sys._getframe().f_code.co_name}() -> verify_hash_list: {verify_hash_list}") - logging.info(f"{sys._getframe().f_code.co_name}() -> verify_hash_list: {len(verify_hash_list)} files need to be compared.") - logging.debug(f"{sys._getframe().f_code.co_name}() -> copy_files_list: {copy_files_list}") + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> assets_dir: {assets_dir}.") + if (game_file_type == "translation"): + for file in os.listdir(assets_dir): + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> os.listdir(assets_dir): {os.listdir(assets_dir)} type(file)): {type(file)} NOT file:{file}.") + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> os.listdir(assets_dir): {os.listdir(assets_dir)} type(file)): {type(file)} file: {file}.") + if (file.endswith('.pak')): + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> file: {file}.") + for files_dir in full_file_path: + file_path = files_dir+'\\'+file + asset_path = assets_dir+'\\'+file + if not os.path.exists(file_path): + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> file_path -> copy_files_list[]: NAY {file_path}") + copy_files_list.extend([[asset_path, file_path]]) + else: + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> file_path -> verify_hash_list[]: AY {file_path}") + verify_hash_list.extend([[asset_path, file_path]]) + copy_files_list.extend([[asset_path, file_path]]) + else: + for (dirpath, dirnames, filenames) in os.walk(assets_dir): + for filename in filenames: + relative_path = dirpath.replace(assets_dir, "") + for files_dir in full_file_path: + file_path = files_dir+relative_path+'\\'+filename + asset_path = assets_dir+relative_path+'\\'+filename + if not os.path.exists(file_path): + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> file_path -> copy_files_list[]: NAY {file_path}") + copy_files_list.extend([[asset_path, file_path]]) + else: + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> file_path -> verify_hash_list[]: AY {file_path}") + verify_hash_list.extend([[asset_path, file_path]]) + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> verify_hash_list: {verify_hash_list}") + logging.info(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> verify_hash_list: {len(verify_hash_list)} files need to be compared.") + logging.debug(f"({assets_dir}) {sys._getframe().f_code.co_name}() -> copy_files_list: {copy_files_list}") return verify_hash_list, copy_files_list except Exception as e: getException(e) @@ -706,13 +741,15 @@ def compareFilesHash(compared_files): getException(e) return False -def copyFiles(game_file_type, copy_delete): +def copyFiles(game_file_type, copy_delete, return_label): """ Creates directories, removes old/different files, copies new files. """ try: if copy_delete == "copy": + if (game_file_type == "translation"): + downloadFile(game_file_type, return_label) with open(f'.\\config\\lists\\{game_file_type}_install.json') as files_list: copy_files_list = json.load(files_list) files_list.close @@ -758,6 +795,58 @@ def copyFiles(game_file_type, copy_delete): getException(e) return False +def downloadFile(file_type, return_label): + """ + Download and save a file specified by url to dest directory, + """ + file_path = getFilePath(file_type)[0] + logging.debug(f"{sys._getframe().f_code.co_name}() -> file_path: {file_path}") + + if (file_type == "translation"): + url = "https://github.com/giordanidev/aion-classic-ptbr/raw/main/teste/data_ptbr.pak" + dest = file_path[0] + u = urllib2.urlopen(url) + + scheme, netloc, path, query, fragment = urlparse.urlsplit(url) + + filename = os.path.basename(path) + logging.debug(f"{sys._getframe().f_code.co_name}() -> filename: {filename}") + + logging.debug(f"{sys._getframe().f_code.co_name}() -> dest: {dest}") + if dest: + filepath = os.path.join(dest, filename) + + with open(filepath, 'wb') as f: + meta = u.info() + meta_func = meta.getheaders if hasattr(meta, 'getheaders') else meta.get_all + meta_length = meta_func("Content-Length") + file_size = None + if meta_length: + file_size = int(meta_length[0]) + + print(f"Testing with {file_size} Bytes download") + print("Downloading: {0} Bytes: {1}".format(url, file_size)) + + file_size_dl = 0 + block_sz = 8192 + while True: + buffer = u.read(block_sz) + if not buffer: + break + + file_size_dl += len(buffer) + f.write(buffer) + + status = f"{translateText('app_button_downloading')} {filename}:" + if file_size: + status += " {0:3.0f}%".format(file_size_dl * 100 / file_size) + status += chr(13) + print(status, end="") + return_label.configure(text=status, text_color=text_color_success) + print() + + return filepath + def forceCloseAion(action, game_client, close_button, return_label): running_apps = psutil.process_iter(['pid','name']) #returns names of running processes found = False diff --git a/assets/Data/data_ptBR.pak b/assets/Data/data_ptBR.pak new file mode 100644 index 0000000..f2fe176 Binary files /dev/null and b/assets/Data/data_ptBR.pak differ diff --git a/config/config.ini b/config/config.ini index c886303..65bc481 100644 --- a/config/config.ini +++ b/config/config.ini @@ -5,3 +5,4 @@ region = napath = eupath = eulauncherpath = + diff --git a/config/lang/en_US.json b/config/lang/en_US.json index 96688ba..2a8d586 100644 --- a/config/lang/en_US.json +++ b/config/lang/en_US.json @@ -1,6 +1,6 @@ { "app_title": "Aion Classic 'Mods' by Load", - "app_version": " - v1.1.0", + "app_version": " - v1.2.0", "app_info_label": "Please choose an option to begin.", "voice": "KR voices", @@ -16,6 +16,7 @@ "app_return_label_waiting": "Waiting...", "app_return_label_verifying": "Verifying files, please wait!", "app_return_label_uptodate": "There are no new files to update.", + "app_return_label_update": "Update available.", "app_return_label_install": "Success! Files have been installed.", "app_return_label_install_ready": "Files are ready to be installed.", "app_return_label_deleted": "Success! Files deleted.", @@ -28,6 +29,7 @@ "app_button_verifying": "Verifying...", "app_button_install": "Install", "app_button_download": "Download", + "app_button_downloading": "Downloading", "app_button_delete": "Delete", "app_button_uptodate": "Up to date!", "app_button_close_game": "Close Aion", diff --git a/config/lang/pt_BR.json b/config/lang/pt_BR.json index d5547b7..c4bbbfd 100644 --- a/config/lang/pt_BR.json +++ b/config/lang/pt_BR.json @@ -16,6 +16,7 @@ "app_return_label_waiting": "Esperando...", "app_return_label_verifying": "Verificando arquivos... Por favor, aguarde!", "app_return_label_uptodate": "Não há novos arquivos para atualizar.", + "app_return_label_update": "Atualização disponível.", "app_return_label_install": "Successo! Arquivos instalados.", "app_return_label_install_ready": "Arquivos estão prontos para ser instalados.", "app_return_label_deleted": "Successo! Arquivos excluídos.", @@ -27,7 +28,8 @@ "app_button_verify_all": "Verificar Todos", "app_button_verifying": "Verificando...", "app_button_install": "Instalar", - "app_button_download": "Download", + "app_button_download": "Baixar", + "app_button_downloading": "Baixando", "app_button_delete": "Excluir", "app_button_uptodate": "Atualizado!", "app_button_close_game": "Fechar Aion", diff --git a/config/lists/filter_delete.json b/config/lists/filter_delete.json index df96bb8..9e26dfe 100644 --- a/config/lists/filter_delete.json +++ b/config/lists/filter_delete.json @@ -1,34 +1 @@ -[ - [ - ".\\assets\\data\\Strings\\aionfilterline_load.dat", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\data\\Strings\\aionfilterline_load.dat" - ], - [ - ".\\assets\\data\\Strings\\aionfilterline_load.dat", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\data\\Strings\\aionfilterline_load.dat" - ], - [ - ".\\assets\\data\\Strings\\aionfilterline_load.dat", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\data\\Strings\\aionfilterline_load.dat" - ], - [ - ".\\assets\\data\\Strings\\aionfilterline_load.dat", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\data\\Strings\\aionfilterline_load.dat" - ], - [ - ".\\assets\\data\\Strings\\aionfilterline_load.pak", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\data\\Strings\\aionfilterline_load.pak" - ], - [ - ".\\assets\\data\\Strings\\aionfilterline_load.pak", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\data\\Strings\\aionfilterline_load.pak" - ], - [ - ".\\assets\\data\\Strings\\aionfilterline_load.pak", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\data\\Strings\\aionfilterline_load.pak" - ], - [ - ".\\assets\\data\\Strings\\aionfilterline_load.pak", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\data\\Strings\\aionfilterline_load.pak" - ] -] \ No newline at end of file +{} \ No newline at end of file diff --git a/config/lists/font_delete.json b/config/lists/font_delete.json index 9ba64cf..9e26dfe 100644 --- a/config/lists/font_delete.json +++ b/config/lists/font_delete.json @@ -1,18 +1 @@ -[ - [ - ".\\assets\\textures\\ui\\hit_number_jp.pak", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\textures\\ui\\hit_number_jp.pak" - ], - [ - ".\\assets\\textures\\ui\\hit_number_jp.pak", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\textures\\ui\\hit_number_jp.pak" - ], - [ - ".\\assets\\textures\\ui\\hit_number_jp.pak", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\textures\\ui\\hit_number_jp.pak" - ], - [ - ".\\assets\\textures\\ui\\hit_number_jp.pak", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\textures\\ui\\hit_number_jp.pak" - ] -] \ No newline at end of file +{} \ No newline at end of file diff --git a/config/lists/translation_delete.json b/config/lists/translation_delete.json index 0967ef4..9e26dfe 100644 --- a/config/lists/translation_delete.json +++ b/config/lists/translation_delete.json @@ -1 +1 @@ -{} +{} \ No newline at end of file diff --git a/config/lists/translation_install.json b/config/lists/translation_install.json index 0967ef4..9e26dfe 100644 --- a/config/lists/translation_install.json +++ b/config/lists/translation_install.json @@ -1 +1 @@ -{} +{} \ No newline at end of file diff --git a/config/lists/voice_delete.json b/config/lists/voice_delete.json index dbb3170..9e26dfe 100644 --- a/config/lists/voice_delete.json +++ b/config/lists/voice_delete.json @@ -1,98 +1 @@ -[ - [ - ".\\assets\\sounds\\voice\\attack\\attack_kr.pak", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\sounds\\voice\\attack\\attack_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\attack\\attack_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\sounds\\voice\\attack\\attack_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\attack\\attack_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\sounds\\voice\\attack\\attack_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\attack\\attack_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\sounds\\voice\\attack\\attack_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\cast\\cast_kr.pak", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\sounds\\voice\\cast\\cast_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\cast\\cast_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\sounds\\voice\\cast\\cast_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\cast\\cast_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\sounds\\voice\\cast\\cast_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\cast\\cast_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\sounds\\voice\\cast\\cast_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\damage\\damage_kr.pak", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\sounds\\voice\\damage\\damage_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\damage\\damage_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\sounds\\voice\\damage\\damage_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\damage\\damage_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\sounds\\voice\\damage\\damage_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\damage\\damage_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\sounds\\voice\\damage\\damage_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\defence\\defence_kr.pak", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\sounds\\voice\\defence\\defence_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\defence\\defence_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\sounds\\voice\\defence\\defence_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\defence\\defence_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\sounds\\voice\\defence\\defence_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\defence\\defence_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\sounds\\voice\\defence\\defence_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\login\\login_kr.pak", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\sounds\\voice\\login\\login_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\login\\login_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\sounds\\voice\\login\\login_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\login\\login_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\sounds\\voice\\login\\login_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\login\\login_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\sounds\\voice\\login\\login_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\motion\\motion_kr.pak", - "E:\\JOGOS\\AION_CLASSIC\\l10n\\enu\\sounds\\voice\\motion\\motion_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\motion\\motion_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\eng\\sounds\\voice\\motion\\motion_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\motion\\motion_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\fra\\sounds\\voice\\motion\\motion_kr.pak" - ], - [ - ".\\assets\\sounds\\voice\\motion\\motion_kr.pak", - "E:\\JOGOS\\aionclassic\\l10n\\deu\\sounds\\voice\\motion\\motion_kr.pak" - ] -] \ No newline at end of file +{} \ No newline at end of file diff --git a/logs/logs.log b/logs/logs.log index 8ce9c22..e69de29 100644 --- a/logs/logs.log +++ b/logs/logs.log @@ -1,17 +0,0 @@ -2023-07-10 13:43:09,733 [MainThread] -> [DEBUG] -> :: () -> App initialized. -2023-07-10 13:43:09,734 [MainThread] -> [DEBUG] -> :: () -> app_functions.py imported. -2023-07-10 13:43:09,754 [MainThread] -> [DEBUG] -> :: getLang() -> (pt_BR) translation loaded. -2023-07-10 13:43:09,755 [MainThread] -> [DEBUG] -> :: appConfigLoad() -> appConfigLoad: [('theme', 'System'), ('color', 'Blue'), ('region', '3'), ('napath', 'E:\\JOGOS\\AION_CLASSIC'), ('eupath', 'E:\\JOGOS\\aionclassic'), ('eulauncherpath', '')] -2023-07-10 13:43:10,167 [MainThread] -> [DEBUG] -> :: () -> main.py imported. -2023-07-10 13:43:10,169 [MainThread] -> [DEBUG] -> :: appConfigLoad() -> appConfigLoad: [('theme', 'System'), ('color', 'Blue'), ('region', '3'), ('napath', 'E:\\JOGOS\\AION_CLASSIC'), ('eupath', 'E:\\JOGOS\\aionclassic'), ('eulauncherpath', '')] -2023-07-10 13:43:10,271 [MainThread] -> [DEBUG] -> :: __init__() -> App() class initialized. -2023-07-10 13:43:10,288 [MainThread] -> [DEBUG] -> :: __init__() -> createTabs() class initialized. -2023-07-10 13:43:10,289 [MainThread] -> [DEBUG] -> :: appConfigLoad() -> appConfigLoad: [('theme', 'System'), ('color', 'Blue'), ('region', '3'), ('napath', 'E:\\JOGOS\\AION_CLASSIC'), ('eupath', 'E:\\JOGOS\\aionclassic'), ('eulauncherpath', '')] -2023-07-10 13:43:10,289 [MainThread] -> [DEBUG] -> :: __init__() -> app_config.items(): [('theme', 'System'), ('color', 'Blue'), ('region', '3'), ('napath', 'E:\\JOGOS\\AION_CLASSIC'), ('eupath', 'E:\\JOGOS\\aionclassic'), ('eulauncherpath', '')] -2023-07-10 13:43:10,303 [MainThread] -> [DEBUG] -> :: __init__() -> Tabs created. -2023-07-10 13:43:10,304 [MainThread] -> [DEBUG] -> :: appConfigLoad() -> appConfigLoad: [('theme', 'System'), ('color', 'Blue'), ('region', '3'), ('napath', 'E:\\JOGOS\\AION_CLASSIC'), ('eupath', 'E:\\JOGOS\\aionclassic'), ('eulauncherpath', '')] -2023-07-10 13:43:10,304 [MainThread] -> [INFO] -> :: firstRun() :: Not the first run anymore! -2023-07-10 13:43:10,423 [MainThread] -> [DEBUG] -> :: __init__() -> Tabs populated. -2023-07-10 13:43:10,424 [MainThread] -> [DEBUG] -> :: appConfigLoad() -> appConfigLoad: [('theme', 'System'), ('color', 'Blue'), ('region', '3'), ('napath', 'E:\\JOGOS\\AION_CLASSIC'), ('eupath', 'E:\\JOGOS\\aionclassic'), ('eulauncherpath', '')] -2023-07-10 13:43:10,424 [MainThread] -> [DEBUG] -> :: __init__() -> Default values -> theme: System | region: 3 | napath: E:\JOGOS\AION_CLASSIC | eupath: E:\JOGOS\aionclassic | color: Blue -2023-07-10 13:43:10,429 [MainThread] -> [DEBUG] -> :: __init__() -> Default values read. diff --git a/main.py b/main.py index 1552063..2abb469 100644 --- a/main.py +++ b/main.py @@ -119,7 +119,7 @@ def __init__(self, master, changeColorEvent, **kwargs): self.filterButton.grid(row=2, column=3, padx=padx_both, pady=pady_both) self.fontButton = ctk.CTkButton(self.appTopFrame, text=translateText("app_button_install"), state="disabled", width=90) self.fontButton.grid(row=3, column=3, padx=padx_both, pady=pady_both) - self.translationButton = ctk.CTkButton(self.appTopFrame, text=translateText("app_button_install"), state="disabled", width=90) + self.translationButton = ctk.CTkButton(self.appTopFrame, text=translateText("app_button_download"), state="disabled", width=90) self.translationButton.grid(row=4, column=3, padx=padx_both, pady=pady_both) self.voiceDeleteButton = ctk.CTkButton(self.appTopFrame, text=translateText("app_button_delete"), state="disabled", width=90) @@ -152,7 +152,7 @@ def __init__(self, master, changeColorEvent, **kwargs): self.fontButton, self.fontDeleteButton)) self.translationButton.configure(command=partial(copyFilesButton, - "font", + "translation", "copy", self.translationReturnLabel, self.translationButton, @@ -177,7 +177,7 @@ def __init__(self, master, changeColorEvent, **kwargs): self.fontButton, self.fontDeleteButton)) self.translationDeleteButton.configure(command=partial(copyFilesButton, - "font", + "translation", "delete", self.translationReturnLabel, self.translationButton, @@ -188,10 +188,10 @@ def __init__(self, master, changeColorEvent, **kwargs): self.verifyAllButton.grid(row=0, column=3, columnspan=2, padx=padx_both, pady=pady_both) self.verifyAllButton.configure(command=partial(verifyFilesButton, - ["filter", "font", "voice"], - [self.filterButton, self.fontButton, self.voiceButton], - [self.filterDeleteButton, self.fontDeleteButton, self.voiceDeleteButton], - [self.filterReturnLabel, self.fontReturnLabel, self.voiceReturnLabel], + ["filter", "font", "voice", "translation"], + [self.filterButton, self.fontButton, self.voiceButton, self.translationButton], + [self.filterDeleteButton, self.fontDeleteButton, self.voiceDeleteButton, self.translationDeleteButton], + [self.filterReturnLabel, self.fontReturnLabel, self.voiceReturnLabel, self.translationReturnLabel], self.verifyAllButton, self)) @@ -275,6 +275,7 @@ def __init__(self, master, changeColorEvent, **kwargs): f"region: {app_config.get('app', 'region')} | "+ f"napath: {app_config.get('app', 'napath')} | "+ f"eupath: {app_config.get('app', 'eupath')} | "+ + f"eulauncherpath: {app_config.get('app', 'eulauncherpath')} | "+ f"color: {app_config.get('app', 'color')}") if app_config.get('app', 'theme'): lang_theme = getLangTranslation(app_config.get('app', 'theme')) @@ -285,6 +286,7 @@ def __init__(self, master, changeColorEvent, **kwargs): if app_config.get('app', 'region'): self.regionRadio.set(app_config.get('app', 'region')) if app_config.get('app', 'napath'): self.naPathEntry.insert(0, app_config.get('app', 'napath')) if app_config.get('app', 'eupath'): self.euPathEntry.insert(0, app_config.get('app', 'eupath')) + if app_config.get('app', 'eulauncherpath'): self.euLauncherPathEntry.insert(0, app_config.get('app', 'eulauncherpath')) logging.debug(f"{sys._getframe().f_code.co_name}() -> Default values read.") diff --git a/config/config.json b/tests/config.json similarity index 100% rename from config/config.json rename to tests/config.json diff --git a/tests/downloadtest.py b/tests/downloadtest.py deleted file mode 100644 index 0752a71..0000000 --- a/tests/downloadtest.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -from __future__ import (division, absolute_import, print_function, unicode_literals) - -import sys, os, tempfile, logging - -if sys.version_info >= (3,): - import urllib.request as urllib2 - import urllib.parse as urlparse -else: - import urllib2 - import urlparse - -def download_file(url, dest=None): - """ - Download and save a file specified by url to dest directory, - """ - u = urllib2.urlopen(url) - - scheme, netloc, path, query, fragment = urlparse.urlsplit(url) - filename = os.path.basename(path) - if not filename: - filename = 'downloaded.file' - if dest: - filename = os.path.join(dest, filename) - - with open(filename, 'wb') as f: - meta = u.info() - meta_func = meta.getheaders if hasattr(meta, 'getheaders') else meta.get_all - meta_length = meta_func("Content-Length") - file_size = None - if meta_length: - file_size = int(meta_length[0]) - - print(f"Testing with {file_size} Bytes download") - print("Downloading: {0} Bytes: {1}".format(url, file_size)) - - file_size_dl = 0 - block_sz = 8192 - while True: - buffer = u.read(block_sz) - if not buffer: - break - - file_size_dl += len(buffer) - f.write(buffer) - - status = "{0:8}".format(file_size_dl) - if file_size: - status += " [{0:3.0f}%]".format(file_size_dl * 100 / file_size) - status += chr(13) - print(status, end="") - print() - - return filename - -if __name__ == "__main__": # Only run if this file is called directly - url = "https://github.com/giordanidev/aion-classic-mods-py/raw/master/assets/sounds/voice/cast/cast.pak" - filename = download_file(url) - print(filename) \ No newline at end of file diff --git a/installer.nsi b/tests/installer.nsi similarity index 100% rename from installer.nsi rename to tests/installer.nsi