-
Notifications
You must be signed in to change notification settings - Fork 23
Detect paths #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect paths #152
Conversation
Hi @JanCaha, thanks for having a look!
Maybe I don't understand what you mean, but IMO the errors are as expected: those functions are not for use in another OS than the one they are meant for; the error is explicit about that.
It shouldn't matter for Regardless of this, one could indeed argue that detecting available paths using |
Your cross-platform detect-function currently enlists all Windows or macOS paths that are verified to exist (without actually testing yet whether they can run), i.e. what the existing Windows or macOS functions did, while on Linux it just returns So I suggest either to add that for Linux and use this in the overall detect function, or to exclude other OSes than Windows + macOS (error telling simply that other OSes are not supported by the function), or to just stick to the two current exported functions for Windows + macOS. I had no further intentions than the latter, but you're welcome to extend for Linux. |
Hi @JanCaha I cherry-picked one of your fixes in #153 (f8fbd37). I also renamed the windows and the macos functions – as said I had no further plans on this topic but I'm open to extending this! Please let me know whether you'd like to extend this for detecting possible Linux paths (or just exclude Linux) and proceed to create a cross-platform |
Closing for now; feel free to re-open @JanCaha if you'd like to extend further. |
This iterates an idea that @JanCaha already proposed, but was not merged at the time (#152 (comment)). Specifically, the function is now explicitly limited to Windows and macOS.
From #152 (comment):
This way has been implemented in a1f4b5b! |
Some work for #133.
This fixes paths detection functions.
There was one issue with the design though. If the functions
is_windows()
andis_macos()
are not exported, then using functionqgis_detect_windows_paths()
andqgis_detect_macos_paths()
is problematic, as there is no way to avoid running them on Linux (or another platform) without getting error. My solution is to have all the function private for the package and create a public functionqgis_detect_paths()
. This functions detects platform and uses correct function for paths and it never ends with error. This makes more sense for public use IMO.