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

wxGUI: startup screen removed #1400

Merged
merged 45 commits into from
Apr 13, 2021

Conversation

lindakarlovska
Copy link
Contributor

@lindakarlovska lindakarlovska commented Feb 23, 2021

STATE BEFORE THIS PR:

Before this PR, when the last mapset was not usable, the startup screen still appeared.

EXPECTED STATE AFTER THIS PR:

This PR suggests the entire removal of the startup screen and using the default location EPSG:4326 with Data Catalog for the user's data hierarchy definition.

It uses Infobar that informs the user about the reason why they are in the demolocation and suggests further process - creating or finding another usable mapset through Data Catalog.

To be clearer, I will explain here which situations can occur and how the new startup copes with them.

First-time startup
Still the same as before this PR. The data structure info is given to the user.
first_time_user_mapset

Second GRASS GUI startup (without closing the first session)
GRASS was not closed, therefore, the user is still considered a beginner. No settings were saved to the RC file. Whereas the PERMANENT mapset is used, the startup creates a spare mapset called after a user.
first_time_user_mapset_if_no_rc_file

Third GRASS GUI startup (without closing the second session)
Whereas the user mapset is used, the startup creates a spare mapset called "user_1"...

We closed all three sessions.
Then we start up GRASS again:

Last used mapset usable
The normal situation in which the last used mapset in RC file is usable (most common)
last_used_mapset_usable

Now we will try to start GRASS again without closing the previous session:

Last used mapset is locked
last_used_mapset_locked
Yes. The last used mapset is locked (running in the previous session). The infobar is telling us the option for switching and removing gislock or we can set usable mapset through Data Catalog.

To complete the list of situations, two other situations can occur:

Last usable mapset is invalid
invalid_mapset

Last usable mapset is owned by different user
different_user_mapset

Here, GRASS chooses PERMANENT mapset, if not capable, then "user" mapset, if "user" mapset not capable, then it chooses or creates user_2 mapset and so on...
In all situations, the default location is used with applicable advice provided in Infobar.

All comments welcome! :-) This is very important PR so the more discussion the better!

@lindakarlovska lindakarlovska marked this pull request as draft February 23, 2021 17:48
@lindakarlovska lindakarlovska self-assigned this Feb 23, 2021
@lindakarlovska lindakarlovska added this to the 8.0.0 milestone Feb 23, 2021
@lindakarlovska lindakarlovska added GUI wxGUI related enhancement New feature or request labels Feb 23, 2021
@lindakarlovska lindakarlovska marked this pull request as ready for review February 24, 2021 17:20
@veroandreo
Copy link
Contributor

Shouldn't we say something about how to remove all these mapsets that could eventually be created when the user fails to close GRASS properly or opens multiple sessions...? Especially because s/he needs to activate the pencil first to be able to remove mapsets. Just wondering...

Maybe it's just my OCD that makes my mind crash when I see all those user, user_1, user_2, etc 😬

@HuidaeCho
Copy link
Member

HuidaeCho commented Feb 25, 2021

What's not clear to me is where a new mapset is created. In the screenshots, you used the default demo location only. Is a new mapset created in this demo location only, not in the requested location (makes more sense)?

Still, I'm sorry, but I really don't understand the rationale behind this idea of "choose or create automatically a mapset every time GRASS runs." We cannot exactly predict the user's intention when they start GRASS. For me, if a mapset was locked and I accidentally started the same mapset, I would like to be kicked out or offered to remove the lock. Must we always start GRASS without user intervention at all, creating a new mapset sometimes, which in most of the case will have to be manually cleaned up because they are more of temporary fixes from my perspective?

If it has to be done, please add an option to turn it off. Related issue #1403.

@lindakarlovska
Copy link
Contributor Author

What's not clear to me is where a new mapset is created. In the screenshots, you used the default demo location only. Is a new mapset created in this demo location only, not in the requested location (makes more sense)?

Still, I'm sorry, but I really don't understand the rationale behind this idea of "choose or create automatically a mapset every time GRASS runs." We cannot exactly predict the user's intention when they start GRASS. For me, if a mapset was locked and I accidentally started the same mapset, I would like to be kicked out or offered to remove the lock. Must we always start GRASS without user intervention at all, creating a new mapset sometimes, which in most of the case will have to be manually cleaned up because they are more of temporary fixes from my perspective?

If it has to be done, please add an option to turn it off. Related issue #1403.

Yet, I work only with the default location. We discussed it with Anna, and so far it seems to us clearer to always end up the nonstandard GRASS startup in the default location. But it is quite open.

As you write "For me, if a mapset was locked and I accidentally started the same mapset, I would like to be kicked out or offered to remove the lock. " - You are now kicked off and in the Infobar there is the button "Switch to last used mapset" and you can switch to it.
However, I have an idea about generating user mapsets - one nonstandard situation is the locked mapset. If a user switches to the last used mapset using the Infobar button, we could automatically remove the user mapset since it is not needed anymore.
What do you think about it?

I know that there is a lack in generating user mapsets, but IMHO I am still convinced that it is a smaller problem compared to keeping and maintaining the user-unfriendly and old startup screen...

@veroandreo
Copy link
Contributor

What's not clear to me is where a new mapset is created. In the screenshots, you used the default demo location only. Is a new mapset created in this demo location only, not in the requested location (makes more sense)?
Still, I'm sorry, but I really don't understand the rationale behind this idea of "choose or create automatically a mapset every time GRASS runs." We cannot exactly predict the user's intention when they start GRASS. For me, if a mapset was locked and I accidentally started the same mapset, I would like to be kicked out or offered to remove the lock. Must we always start GRASS without user intervention at all, creating a new mapset sometimes, which in most of the case will have to be manually cleaned up because they are more of temporary fixes from my perspective?
If it has to be done, please add an option to turn it off. Related issue #1403.

Yet, I work only with the default location. We discussed it with Anna, and so far it seems to us clearer to always end up the nonstandard GRASS startup in the default location. But it is quite open.

As you write "For me, if a mapset was locked and I accidentally started the same mapset, I would like to be kicked out or offered to remove the lock. " - You are now kicked off and in the Infobar there is the button "Switch to last used mapset" and you can switch to it.
However, I have an idea about generating user mapsets - one nonstandard situation is the locked mapset. If a user switches to the last used mapset using the Infobar button, we could automatically remove the user mapset since it is not needed anymore.
What do you think about it?

I like this solution, it will avoid cluttering the location with empty (?) user_* mapsets - my OCD is happy :)

@wenzeslaus
Copy link
Member

@HuidaeCho @veroandreo About all this cluttering with empty mapsets, how often do you think it happens? The current code in the PR tries PERMANENT mapset and steps through other candidate (mapset) names till it hits one which is usable. If it is the PERMANENT mapset, no mapset is created. If one of these candidates is usable, it uses that and no other mapset is created, etc. As far as I understand the code, the cluttering happens when you keep starting new sessions. Is this a realistic use case which we need to specifically address in the design?

Note also that the locking part is at this point irrelevant for Windows where the locking is not enabled (I don't know why).

...If it has to be done, please add an option to turn it off.

@HuidaeCho If turned of, the question would be what happens instead. For example, making location/mapset optional is an interesting way to address this issue, but the question is how to implement that.

...we could automatically remove the user mapset since it is not needed anymore.

@lindakladivova I consider this nice to have, but not necessary. Depends on how hard this would be to implement. You started to heavily leverage the "gisrc" file, similarly to that, perhaps the VAR file in the mapset is a place for marking mapset as temporary. The concept of a temporary mapset is already there (grass --tmp-mapset ...), but this would require completely different implementation.

@HuidaeCho
Copy link
Member

how often do you think it happens?

It just happened to me 10 minutes ago. I already opened the NC sample mapset in one desktop and tried to open it again in another, all from the same computer. With this PR, I would have ended up in the world demo location, which has nothing to do with the NC sample. I would be lucky that I won't have to delete a new temporary mapset because the default demo mapset was not locked. In some sense, it's better to create all these temporary mapsets only in the demo location to avoid cluttering user locations. Cleaning would be easier.

So this PR is mainly for those who start GRASS using the icon, but I start it from the terminal. I think I found a solution. If I add g.gui in ~/.grass7/bashrc and start grass -text, it will fail if a mapset is locked (we're not changing this CLI behavior right?). If not, GUI will start in the requested mapset because it is usable or locked? I'm not sure about this.

  1. A mapset is usable
  2. Start GRASS in this mapset from the terminal
  3. Start g.gui
  4. To GUI, is this current mapset locked by the same CLI session or usable?

If it's usable because GUI is in the same session, that will be great. This solution will allow a delayed GUI startup only after the CLI session started successfully.

@wenzeslaus
Copy link
Member

how often do you think it [this cluttering with empty mapsets] happens?

It just happened to me 10 minutes ago. I already opened the NC sample mapset in one desktop and tried to open it again in another, all from the same computer. With this PR, I would have ended up in the world demo location, which has nothing to do with the NC sample. I would be lucky that I won't have to delete a new temporary mapset because the default demo mapset was not locked.

You were not lucky. This is how it should behave. No mapset was (would be) created, so no clutter is accumulating which is exactly my point: The scenario when you end up with location cluttered by these mapsets is unlikely.

 _________________________
| No clutter, no problem. |
 -------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
_\|/__\|/__\|/_ ||     ||  _\|/__\|/_

In some sense, it's better to create all these temporary mapsets only in the demo location to avoid cluttering user locations. Cleaning would be easier.

Right, it is a compromise. We could create completely temporary location, but that brings in a lot of other issues like what should happen when a user starts to import data there. Similar, although smaller, issue is with the temporary mapset.

So this PR is mainly for those who start GRASS using the icon,

Yes, something like that. And that's the whole issue here. GRASS power user starting from command line can probably deal with GUI (and GRASS itself) not starting at all in case mapset is locked. However, we are trying to have find a solution which works for all users who use GUI and not just when the mapset is locked. We need to provide something like data catalog/startup screen which allows all kinds of management (force unlock, all database, ..., view content) which leads us to delivering the Data tab which needs an active session, so we need to pick a reasonable mapset.

but I start it from the terminal.

Well, we know when we are running in interactive terminal, so we could behave differently in that case. However, Windows users seem to insist on CLI (#1221), so this distinction could be applied only on Linux and maybe macOS for the time being and that assumes that #1221 gets merged and actually applied in distributions/installations.

start grass -text, it will fail if a mapset is locked (we're not changing this CLI behavior right?).

grass --text and grass --exec should fail with an error message in these situations. (Only partially related: It is still not 100% clear if grass --exec should require mapset always.)

...To GUI, is this current mapset locked by the same CLI session or usable?...If it's usable because GUI is in the same session, that will be great.

Yes, at least that part should work. GUI behaves like any other GRASS GIS module (which sounds nice on the surface, but it is partially the source of this whole starting GRASS issue; if we change that, we have potentially more options available to us).

@veroandreo
Copy link
Contributor

@HuidaeCho @veroandreo About all this cluttering with empty mapsets, how often do you think it happens? The current code in the PR tries PERMANENT mapset and steps through other candidate (mapset) names till it hits one which is usable. If it is the PERMANENT mapset, no mapset is created. If one of these candidates is usable, it uses that and no other mapset is created, etc. As far as I understand the code, the cluttering happens when you keep starting new sessions.

Thanks much for this explanation! I have not understood this before and hence my concern. But like this, to get the location cluttered with user_* mapsets, seems indeed not highly likely.

@lindakarlovska
Copy link
Contributor Author

@HuidaeCho @veroandreo About all this cluttering with empty mapsets, how often do you think it happens? The current code in the PR tries PERMANENT mapset and steps through other candidate (mapset) names till it hits one which is usable. If it is the PERMANENT mapset, no mapset is created. If one of these candidates is usable, it uses that and no other mapset is created, etc. As far as I understand the code, the cluttering happens when you keep starting new sessions. Is this a realistic use case which we need to specifically address in the design?

Note also that the locking part is at this point irrelevant for Windows where the locking is not enabled (I don't know why).

...If it has to be done, please add an option to turn it off.

@HuidaeCho If turned of, the question would be what happens instead. For example, making location/mapset optional is an interesting way to address this issue, but the question is how to implement that.

...we could automatically remove the user mapset since it is not needed anymore.

@lindakladivova I consider this nice to have, but not necessary. Depends on how hard this would be to implement. You started to heavily leverage the "gisrc" file, similarly to that, perhaps the VAR file in the mapset is a place for marking mapset as temporary. The concept of a temporary mapset is already there (grass --tmp-mapset ...), but this would require completely different implementation.

@wenzeslaus I also think that it is not necessary. I realize that there is quite a heavy change in gisrc :-). I was thinking about how to code this PR very long time and finally, used gisrc file because the last used mapset, location, grassdb here are closely related to this issue, so everything would be at the same place. And also reading gisrc in catalog.py is quite elegant. What do you think about the concept I came up with?

@HuidaeCho
Copy link
Member

HuidaeCho commented Mar 6, 2021

@lindakladivova Please make the location of the default database ($HOME/grassdata) configurable at least through $HOME/.grass7/rc manually. I have my own folder structure. Or maybe, please move it to $HOME/.grass7 so it's hidden from ls.

@lindakarlovska
Copy link
Contributor Author

lindakarlovska commented Mar 7, 2021

@lindakladivova Please make the location of the default database ($HOME/grassdata) configurable at least through $HOME/.grass7/rc manually. I have my own folder structure. Or maybe, please move it to $HOME/.grass7 so it's hidden from ls.

@HuidaeCho I like your note about extending the $HOME/.grass7/rc file with the default db. But I am not sure about making the world_latlong_wgs84 location directly in rc. This would mean that a user cannot treat it as a normal db/loc (it would be something like temporary db/loc). I think that the "grassdata" db folder is quite good. And also if the first-time user will see this path $HOME/.grass7/world_latlong_wgs84/PERMANENT, I am not sure if it wouldn't be rather confusing.... However, I do not have any really strong opinion about this. It depends, how we perceive the default location. (@landa, @wenzeslaus ?)

Maybe the default location is a bit more correct collocation here than demolocation (note that default location is also used in Info Bar) since we provide a common EPSG: 4326 option which a user can immediately start using.

@HuidaeCho
Copy link
Member

HuidaeCho commented Mar 7, 2021

@lindakladivova Please make the location of the default database ($HOME/grassdata) configurable at least through $HOME/.grass7/rc manually. I have my own folder structure. Or maybe, please move it to $HOME/.grass7 so it's hidden from ls.

@HuidaeCho I like your note about extending the $HOME/.grass7/rc file with the default db. But I am not sure about making the world_latlong_wgs84 location directly in rc. This would mean that a user cannot treat it as a normal db/loc (it would be something like temporary db/loc). I think that the "grassdata" db folder is quite good. And also if the first-time user will see this path $HOME/.grass7/world_latlong_wgs84/PERMANENT, I am not sure if it wouldn't be rather confusing.... However, I do not have any really strong opinion about this. It depends, how we perceive the default location. (@landa, @wenzeslaus ?)

I agree with you. It all depends on how we look at this database. Is it a demo (probably could be hidden in $HOME/.grass7) or a default database (just like a regular database). Since some people may decide to use this default database for their EPSG4326 locations and renaming $HOME/.grass7 to e.g., $HOME/.grass8 can duplicate the same database later, the latter seems to make more sense. I'm fine with either, but any hardcoded paths will get in anyone's way when they want to keep their folder structure clean in their own way. Maybe, it's just me, but I just feel that the Linux home directory seems to be different from Windows' for that matter. I rarely look into my Windows home directory because random software tends to create random folders there and I stop caring about what are in there and I just don't use it. However, in Linux, that's my true home for my daily use, probably, for most power users as well, who will most likely care about this issue.

Maybe the default location is a bit more correct collocation here than demolocation (note that default location is also used in Info Bar) since we provide a common EPSG: 4326 option which a user can immediately start using.

Absolutely, the default_gisdbase setting as you mentioned in #1419 will address my concern.

@neteler
Copy link
Member

neteler commented Mar 7, 2021

... but any hardcoded paths will get in anyone's way when they want to keep their folder structure clean in their own way. Maybe, it's just me, but I just feel that the Linux home directory seems to be different from Windows' for that matter. I rarely look into my Windows home directory because random software tends to create random folders there and I stop caring about what are in there and I just don't use it. However, in Linux, that's my true home for my daily use, probably, for most power users as well, who will most likely care about this issue.

Today and in the last 10+ years we used and use network drives for storing "grassdata/" (in IRST, in FEM, in some HPC infrastructure, in mundialis, ...). Hence it would be generally important for us to avoid any hardcoded paths.

@petrasovaa
Copy link
Contributor

@lindakladivova Please make the location of the default database ($HOME/grassdata) configurable at least through $HOME/.grass7/rc manually. I have my own folder structure. Or maybe, please move it to $HOME/.grass7 so it's hidden from ls.

@HuidaeCho I like your note about extending the $HOME/.grass7/rc file with the default db. But I am not sure about making the world_latlong_wgs84 location directly in rc. This would mean that a user cannot treat it as a normal db/loc (it would be something like temporary db/loc). I think that the "grassdata" db folder is quite good. And also if the first-time user will see this path $HOME/.grass7/world_latlong_wgs84/PERMANENT, I am not sure if it wouldn't be rather confusing.... However, I do not have any really strong opinion about this. It depends, how we perceive the default location. (@landa, @wenzeslaus ?)

Absolutely, the default_gisdbase setting as you mentioned in #1419 will address my concern.

This doesn't make much sense to me, rc is not a place users should be editing. Why not create it in current database? Disadvantage is that if you use multiple databases, it would eventually be created in each.

Alternatively, we could create a temporary empty location, but that would be probably little more complex, e.g. maybe we would want to hide it from data catalog and when user would switch to other location, it would need to be removed. I think we wouldn't have issues with user importing data into it as long as we clearly inform them in the infobar.

@wenzeslaus
Copy link
Member

Let me comment on what I think the rc (.grassX/rc) file is:

  • The name rc suggest it is a configuration loaded during start of the program relevant to the while runtime of the program similarly to .bashrc or .pylintrc. However, the current rc file is far from these large configurations given its focus on the last used db/location/mapset.
  • The file saves the last used "file" (db/location/mapset - aka last used project), so it works like what, e.g., wxPython calls file history which is used to implement (list of) most recent files (in menu). Just in this case, it is only the most recent one and, quite importantly, it is not the only information stored there.
  • It looks little bit like user settings, but it is not directly modified by the user, instead it stores the most recent used values. This more applies to the value of GUI used (text, wx) than to the db/loc/mapset which, being a file, would not be typically found in settings.
  • The GISRC variable with its associated file and grass.py code referring to .grassX/rc as gisrcrc suggests there was some historical development in what the file was doing possibly having only one rc file around persistent over what would be now different sessions.
  • There seems to be three concepts, a settings/configuration file, last used file/data/project file, and current session file. The rc (.grassX/rc) trying to be the first two while GISRC is the (current) session file. Some untangling might be needed.

@HuidaeCho
Copy link
Member

This doesn't make much sense to me, rc is not a place users should be editing.

Not necessarily directly. Users can use g.gisenv to add/change variables in .grassX/rc.

Alternatively, an environment variable could be another option. It would be more permanent...

Why not create it in current database? Disadvantage is that if you use multiple databases, it would eventually be created in each.

That will be a big disadvantage.

Alternatively, we could create a temporary empty location, but that would be probably little more complex, e.g. maybe we would want to hide it from data catalog and when user would switch to other location, it would need to be removed. I think we wouldn't have issues with user importing data into it as long as we clearly inform them in the infobar.

Only if we can guarantee a clean removal of the temp location. e.g., multiple sessions in the same temp location and exit one session at a time? Or temp location per session?

@lindakarlovska
Copy link
Contributor Author

lindakarlovska commented Mar 9, 2021

This doesn't make much sense to me, rc is not a place users should be editing.

Not necessarily directly. Users can use g.gisenv to add/change variables in .grassX/rc.

Alternatively, an environment variable could be another option. It would be more permanent...

Why not create it in current database? Disadvantage is that if you use multiple databases, it would eventually be created in each.

That will be a big disadvantage.

Alternatively, we could create a temporary empty location, but that would be probably little more complex, e.g. maybe we would want to hide it from data catalog and when user would switch to other location, it would need to be removed. I think we wouldn't have issues with user importing data into it as long as we clearly inform them in the infobar.

Only if we can guarantee a clean removal of the temp location. e.g., multiple sessions in the same temp location and exit one session at a time? Or temp location per session?

@lindakladivova Please make the location of the default database ($HOME/grassdata) configurable at least through $HOME/.grass7/rc manually. I have my own folder structure. Or maybe, please move it to $HOME/.grass7 so it's hidden from ls.

@HuidaeCho I like your note about extending the $HOME/.grass7/rc file with the default db. But I am not sure about making the world_latlong_wgs84 location directly in rc. This would mean that a user cannot treat it as a normal db/loc (it would be something like temporary db/loc). I think that the "grassdata" db folder is quite good. And also if the first-time user will see this path $HOME/.grass7/world_latlong_wgs84/PERMANENT, I am not sure if it wouldn't be rather confusing.... However, I do not have any really strong opinion about this. It depends, how we perceive the default location. (@landa, @wenzeslaus ?)

Absolutely, the default_gisdbase setting as you mentioned in #1419 will address my concern.

This doesn't make much sense to me, rc is not a place users should be editing. Why not create it in current database? Disadvantage is that if you use multiple databases, it would eventually be created in each.

Alternatively, we could create a temporary empty location, but that would be probably little more complex, e.g. maybe we would want to hide it from data catalog and when user would switch to other location, it would need to be removed. I think we wouldn't have issues with user importing data into it as long as we clearly inform them in the infobar.

I think that concept of temporary location will be again something confusing for a first-time user. There is still a risk that a user would not read the advice in the infobar... and then he could lose all the data.
The second thing is that if we hide a temporary empty location, we destroy the important concept of the first infobar which explains data hierarchy...
Or we can have two concepts - one for the first-time startup, I think this concept of "home/grassdata" default grassdb works fine here and then a different concept of a temporary location for other cases... - but still there will be a risk of losing data which is IMHO very serious.

@petrasovaa
Copy link
Contributor

petrasovaa commented Mar 9, 2021

I think that concept of temporary location will be again something confusing for a first-time user. There is still a risk that a user would not read the advice in the infobar... and then he could lose all the data.
The second thing is that if we hide a temporary empty location, we destroy the important concept of the first infobar which explains data hierarchy...
Or we can have two concepts - one for the first-time startup, I think this concept of "home/grassdata" default grassdb works

Yes that's what I meant, the temporary one would be only for these cases, when you can't use the last used mapset.

fine here and then a different concept of a temporary location for other cases... - but still there will be a risk of losing data which is IMHO very serious.

I wouldn't be worried about that too much. The infobar is hard to miss and even if you ignore it, you don't have any data there, which should tell you something is wrong. GUI could be aware that it is running in a temporary location (e.g. based on the name) so we could use that in some way to additionally warn users when they try to import data etc. I don't have this fully thought through, there may be some associated problems with this, but I think it's worth looking into this direction.

@petrasovaa
Copy link
Contributor

petrasovaa commented Mar 9, 2021

Alternatively, we could create a temporary empty location, but that would be probably little more complex, e.g. maybe we would want to hide it from data catalog and when user would switch to other location, it would need to be removed. I think we wouldn't have issues with user importing data into it as long as we clearly inform them in the infobar.

Only if we can guarantee a clean removal of the temp location. e.g., multiple sessions in the same temp location and exit one session at a time? Or temp location per session?

The idea is to not run multiple sessions in one temp location, there could be multiple at the same time.

@lindakarlovska
Copy link
Contributor Author

When testing with --text mode, when last used mapset is in use, it will jump to tmploc instead of failing as before.

So we would prefer the failing as before or you think it is correct to jump to tmploc? Maybe, we should have the same behavior everywhere...

@wenzeslaus
Copy link
Member

But then this temporary location should be read-only, or ?

Let's discuss this in a separate issue if it seems like needed after merging this PR. Current but read-only would be a new concept we don't have any mechanism for.

@wenzeslaus
Copy link
Member

When testing with --text mode, when last used mapset is in use, it will jump to tmploc instead of failing as before.

So we would prefer the failing as before or you think it is correct to jump to tmploc? Maybe, we should have the same behavior everywhere...

Just to record here what we discussed elsewhere: There are different expectation for the CLI behavior than for GUI, so it makes sense here to keep the current --text behavior, i.e., fail, not create a temporary location. It is easy enough in command line to correct that situation just by running a different command.

@lindakarlovska
Copy link
Contributor Author

When testing with --text mode, when last used mapset is in use, it will jump to tmploc instead of failing as before.

So we would prefer the failing as before or you think it is correct to jump to tmploc? Maybe, we should have the same behavior everywhere...

Just to record here what we discussed elsewhere: There are different expectation for the CLI behavior than for GUI, so it makes sense here to keep the current --text behavior, i.e., fail, not create a temporary location. It is easy enough in command line to correct that situation just by running a different command.

Yep, clear. I have corrected the behavior in this situation.

…ries of checks and setup). Do not rely on some later function to do the checking, i.e., remove the additional check in lock_mapset.
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the code after my fixes to checking behavior. --text with broken mapset now gives the detailed message with reasons as it does with explicit mapset in command line, not just mapset invalid. For consistency, safety, and possibly future all paths now lead to a set_mapset call.

The code needs refactoring more than it did before and first time user gets the WGS84 location even in the command line. I suggest that this and any other issues are left for new issues/PRs.

@wenzeslaus wenzeslaus merged commit 8fe1363 into OSGeo:master Apr 13, 2021
@wenzeslaus
Copy link
Member

Merged, but there is couple of loose ends which will need to be addressed in subsequent PRs, most importantly what to do with --text for first time user and the whole --gtext option.

ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
* Startup screen code removed. Used only when 
* Either demo/default world location is used (first time user) or an XY location temporary location is used (fallback).
* Last mapset path is now noted in gisrc of the current session. Used in GUI to offer switch from fallback to locked.
* non_standard_startup and first_time_user in grassdb/checks.py.
* grassdb/config for special strings such as `<UNKNOWN>`.
* Fallback tmp location only for GUI. Default currently for both GUI and CLI (`--text`).
* Call set_mapset in every branch (all paths lead to the same series of checks and setup).
* This increases the need for refactoring of `main()` and needs removal of `--gtext`.
neteler added a commit to neteler/grass that referenced this pull request Jan 2, 2023
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
* Startup screen code removed. Used only when 
* Either demo/default world location is used (first time user) or an XY location temporary location is used (fallback).
* Last mapset path is now noted in gisrc of the current session. Used in GUI to offer switch from fallback to locked.
* non_standard_startup and first_time_user in grassdb/checks.py.
* grassdb/config for special strings such as `<UNKNOWN>`.
* Fallback tmp location only for GUI. Default currently for both GUI and CLI (`--text`).
* Call set_mapset in every branch (all paths lead to the same series of checks and setup).
* This increases the need for refactoring of `main()` and needs removal of `--gtext`.
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 3, 2023
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 5, 2023
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 6, 2023
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request GUI wxGUI related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants