Suggestion: take Steam ID from user folder
didierrenardub opened this issue Β· comments
Hey @Dooque! First of all, great job in pulling this tool down! π Thank you for that!
Disclaimer: Haven't used your tool yet, just took a look at the source code and the screenshots on the readme file, so maybe I'm missing something when commenting.
Disclaimer 2: I'm from Argentina as well, but since you wrote both the code and readmes in English, I comment in English as well to be consistent. Also, you never know who'll be helping you out in the future!
So, what I see is that you instruct the user to write his/her Steam ID on the configuration file. What you could do is read the folder names from C:\Users\<user>\Games\Age of Empires 2 DE
. There, you have a folder for each Steam ID that has played AoE on the PC.
So, you could get the list of Steam IDs doing something like:
import os
def _get_local_steam_ids():
steam_ids = []
aoe_path = os.path.join(os.environ['USERPROFILE'], 'Games', 'Age of Empires 2 DE')
for dir in os.listdir(aoe_path):
steam_id = None
try:
steam_id = int(dir)
except ValueError:
pass
if steam_id is not None and steam_id > 0:
steam_ids.append(steam_id)
return steam_ids
And that way, we save the user from having to do it on its own!
Hi, that's really a great idea, how I didn't realize. I'll implement it for sure. If you wanna contribute just let me know and I'll add you.
Hey - glad you liked it π
I can't commit to contributing as I'm also developing a project of my own (will make open source when I stop being ashamed of its code haha) but I don't mind being added and trying to sneak some snippets every now and then π.