AceCentre / FaceCommander

Control your computer by making faces
Apache License 2.0
2 stars 1 forks source link

Cross-platform home directory utility should be used #20

Closed sjjhsjjh closed 2 months ago

sjjhsjjh commented 3 months ago

The FaceCommander ConfigManager builds a number of platform-specific paths, near here for example. https://github.com/AceCentre/FaceCommander/blob/7d389cb641c82c35a6eadfb26ea8340d72aa436c/src/config_manager.py#L16

A cross-platform module or library should be used instead. For example platformdirs see https://pypi.org/project/platformdirs/

Unless that's been tried before, @gavinhenderson or @willwade do you know?

willwade commented 3 months ago

No. It hasn't and I agree it should. I should have picked this up when I refactored for the installer. Nice one Jim

gavinhenderson commented 3 months ago

Nope dont think its been tried before, seems like a sensible idea to me!

sjjhsjjh commented 3 months ago

Thanks both. That module gives this as the directory for application data, on my Windows 10 machine. C:/Users/<user name>/AppData/Local/AceCentre/FaceCommander

The current code uses this directory. C:/Users/<user name>/FaceCommander

Is it OK to change? Grimassist and GameFace will have been different.

gavinhenderson commented 3 months ago

@sjjhsjjh Is there a functional difference between a folder at the root of the user vs AppData/Local? If there is not then I don't really mind where the folder goes as long as there is no side effects

sjjhsjjh commented 3 months ago

I think it's more of a convention. If I look in my Windows user home directory the immediate sub-directories are the big divisions like Desktop, Documents, and Music, so it makes sense to me that apps shouldn't create new directories up there.

willwade commented 3 months ago

Yeah. It's convention to use %LOCALAPPDATA% - go for the new approach

willwade commented 3 months ago

Ps. Gavin translate app and error correction stuff etc is all going in %localappdara%\AceCentre\