Skip to content
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

[Feat] startup GUI automatic detection of grassdata: make case independent #644

Closed
mlennert opened this issue May 18, 2020 · 4 comments
Closed
Labels
enhancement New feature or request gsoc Reserved for Google Summer of Code student(s)

Comments

@mlennert
Copy link
Contributor

In the current implementation, the startup gui screen automatically detects a grassdata directory if present, but it does not detect GRASSDATA, Grassdata, GrassData, or any other possible combinations of case.
IMHO this detection should be case independent to allow for different cultures of case usage in file and directory naming.
[I could even imagine going a step further and detecting all directories with the word grassdata in them and providing the list for the user to chose from. This would allow the user to separate their data into several GRASS databases if so desired and make it easy to launch in whatever they want to use. But that idea is maybe better discussed in another issue if anyone finds it necessary.]

@mlennert mlennert added the enhancement New feature or request label May 18, 2020
@petrasovaa petrasovaa added the gsoc Reserved for Google Summer of Code student(s) label May 18, 2020
@petrasovaa petrasovaa assigned petrasovaa and unassigned petrasovaa May 22, 2020
petrasovaa pushed a commit that referenced this issue Jun 20, 2020
Detects a grassdata (case insensitive) directory if present in usual locations (home, home/Documents)
@wenzeslaus wenzeslaus added this to To do in New GUI Startup via automation Jul 1, 2020
@wenzeslaus
Copy link
Member

@mlennert Can you please test master and close?

@mlennert
Copy link
Contributor Author

mlennert commented Jul 1, 2020

In its current form, the code gives preference to grassdata over GRASSDATA, and preference to GRASSDATA over Grassdata. This means that if you have an empty grassdata and a GRASSDATA filled with locations, it will still privilege the former. This is due to simple alphabetic ordering of the os.walk(candidate), but is a bit annoying. Maybe a check should be added to go through all existing candidates and see if they contain anything and rather chose as default an existing directory that actually has locations in it ?

Ideally, the startup should detect all possible candidates and propose a choice to the user. But maybe this is overkill.

I personally also prefer uppercase directory names and so wouldn't have chosen 'grassdata' as the default name of the directory to create if none exist, but this is not important enough for me to argue about it ;-)

@wenzeslaus
Copy link
Member

This means that if you have an empty grassdata and a GRASSDATA filled with locations, it will still privilege the former...rather chose as default an existing directory that actually has locations in it ?

What is the use case you are trying to address? It seems very narrow. Users with bunch of empty randomly named "grassdata" directories?

Ideally, the startup should detect all possible candidates and propose a choice to the user...

Users who are actually using multiple directories will be addressed by #741. Don't forget this issue is addressing first time start of GRASS GIS in case there is an existing "grassdata" directory (later it uses the last one used).

I personally also prefer uppercase directory names and so wouldn't have chosen 'grassdata' as the default name of the directory to create if none exist...

I think the name of the directory is open to discussion, but grassdata is what we currently have everywhere in documentation as far as I recall. I don't think the convention you are using is that common to make it the preferred one. It would be more likely that we would change it to something like GrassData or GrassSpatialDatabase in order to follow what operating systems are using (Document, Music, ...) and to behave like other software (PlayOnLinux's virtual drives, R, Dropbox). A topic for a new issue if needed.

Besides this, does this work for you as advertised? Can we close this?

@mlennert
Copy link
Contributor Author

mlennert commented Jul 1, 2020

Yes. It works.

@mlennert mlennert closed this as completed Jul 1, 2020
New GUI Startup automation moved this from To do to Done Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gsoc Reserved for Google Summer of Code student(s)
Projects
No open projects
Development

No branches or pull requests

3 participants