fixed a bug + print stack trace on exception

This commit is contained in:
otavepto 2024-02-16 15:44:59 +02:00
parent 6a0b9dbac1
commit 3a701dfbbd
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,4 @@
* generate_emu_config: allow setting the steam id of apps/games owners from an external file `top_owners_ids.txt` beside the script * generate_emu_config: allow setting the steam id of apps/games owners from an external file `top_owners_ids.txt` beside the script
* generate_emu_config: add the id of the currently logged-in user to the internal list of apps/games owners
* generate_emu_config: always use the directory of the script for: the data `backup` folder, the `login_temp` folder, the `my_login.txt` file * generate_emu_config: always use the directory of the script for: the data `backup` folder, the `login_temp` folder, the `my_login.txt` file
--- ---

View File

@ -19,6 +19,7 @@ import urllib.error
import threading import threading
import queue import queue
import shutil import shutil
import traceback
def get_exe_dir(): def get_exe_dir():
# https://pyinstaller.org/en/stable/runtime-information.html # https://pyinstaller.org/en/stable/runtime-information.html
@ -347,11 +348,9 @@ TOP_OWNER_IDS = list(dict.fromkeys([
])) ]))
def generate_achievement_stats(client, game_id : int, output_directory, backup_directory) -> list[dict]: def generate_achievement_stats(client, game_id : int, output_directory, backup_directory) -> list[dict]:
steam_id_list = TOP_OWNER_IDS.copy()
steam_id_list.add(client.steam_id)
stats_schema_found = None stats_schema_found = None
print(f"finding achievements stats...") print(f"finding achievements stats...")
for id in steam_id_list: for id in TOP_OWNER_IDS:
#print(f"finding achievements stats using account ID {id}...") #print(f"finding achievements stats using account ID {id}...")
out = get_stats_schema(client, game_id, id) out = get_stats_schema(client, game_id, id)
if out is not None and len(out.body.schema) > 0: if out is not None and len(out.body.schema) > 0:
@ -905,5 +904,9 @@ if __name__ == "__main__":
except Exception as e: except Exception as e:
print("Unexpected error:") print("Unexpected error:")
print(e) print(e)
print("-----------------------")
for line in traceback.format_exception(e):
print(line)
print("-----------------------")
sys.exit(1) sys.exit(1)