<div dir="ltr">Hi,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 30, 2013 at 3:29 PM, Pietro <span dir="ltr"><<a href="mailto:peter.zamb@gmail.com" target="_blank">peter.zamb@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi all,<br>
<br>
Nikos A. found a strange behaviour... that I'm not able to understand...<br>
<br>
I'm in the North Carolina (PERMANENT):<br>
<br>
{{{<br>
In [1]: import grass.lib.gis as libgis  # import the ctypes<br>
<br>
In [2]: !g.mapset -p  # look in which mapset we are<br>
PERMANENT<br>
<br>
In [3]: libgis.G__getenv('MAPSET')  # look in which mapset we are using ctypes<br>
Out[3]: 'PERMANENT'<br>
<br>
In [4]: !g.mapset user1   # change the mapset<br>
Your shell continues to use the history for the old mapset<br>
You can switch the history by commands:<br>
history -w; history -r /data/gis/nc/user1/.bash_history;<br>
HISTFILE=/data/gis/nc/user1/.bash_history<br>
<br>
In [5]: !g.mapset -p  # look in which mapset we are<br>
user1<br>
<br>
In [6]: libgis.G__getenv('MAPSET')  # look in which mapset we are using ctypes<br>
Out[6]: 'PERMANENT'<br>
<br>
In [7]: !g.gisenv<br>
MAPSET=user1<br>
GISDBASE=/data/gis<br>
LOCATION_NAME=nc<br>
GUI=text<br>
GISDBASEE=/data/gis<br>
<br>
}}}<br>
<br>
Why the ctypes version return 'PERMANENT' instead of 'user1'?<br>
<br>
the flag "p" of the module g.mapset use exactly the same function.<br>
<br>
<a href="http://trac.osgeo.org/grass/browser/grass/trunk/general/g.mapset/main.c#L103" target="_blank">http://trac.osgeo.org/grass/browser/grass/trunk/general/g.mapset/main.c#L103</a><br>
<a href="http://trac.osgeo.org/grass/browser/grass/trunk/general/g.gisenv/main.c#L119" target="_blank">http://trac.osgeo.org/grass/browser/grass/trunk/general/g.gisenv/main.c#L119</a><br>
<br>
There is someone that is able to understand what is not working?<br>
Any idea?<br></blockquote><div><br></div><div style>I have myself experienced similar problem and I think it's related to this ticket [1].</div><div style><br></div><div style>[1] <a href="http://trac.osgeo.org/grass/ticket/717">http://trac.osgeo.org/grass/ticket/717</a></div>

<div style><br></div><div style><br></div><div style>Anna</div><div style> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<br>
Best regards.<br>
<span class=""><font color="#888888"><br>
Pietro<br>
_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</font></span></blockquote></div><br></div></div>