zorua98741 / PS3-Rich-Presence-for-Discord

Rich presence app for playstation 3. Display what game you are playing on the PS3 via PC
58 stars 6 forks source link

a few improvements #18

Closed st0rmw1ndz closed 5 months ago

st0rmw1ndz commented 7 months ago

refactor: PrepWork class now uses a JSON file for reading the config, other uses of the config now call a key from the config variable on an instance of PrepWork refactor: make formatting Black compliant refactor: PrepWork class now uses a Path object for reading the config file, instead of os.path

note: I haven't built the app with PyInstaller, so I'm not sure if doing so would break anything. Running the script itself worked for me, though

zorua98741 commented 7 months ago

Hi st0rmw1ndz, thanks for the pr and sorry for not seeing it sooner. Looks good, I'll review it this weekend, Does using json for the config save time? The primary purpose of having it as a text document was so that users didn't have to fluff about with selecting how to open the file, but if it's slow I don't see why we can't change to json and add a small instruction for setting what program to open it with

st0rmw1ndz commented 6 months ago

Oh hey, I'm not sure if using JSON is any faster. The main thing was that I saw the code to parse the text file was larger than it needed to be, and editing the text file wasn't as intuitive as JSON. If you want, YAML or INI is also an option which likely would be easier for the user to understand and edit.

st0rmw1ndz commented 6 months ago

Oh and by the way, I believe the PrepWork class could be minimized or removed and just use variables defined in a scope of something like a main function, which likely would be easier for future additions.