<div dir="ltr">Hi Vaclav,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 14, 2017 at 6:00 PM, Vaclav Petras <span dir="ltr"><<a href="mailto:wenzeslaus@gmail.com" target="_blank">wenzeslaus@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>This is exactly what I had in my mind when doing the last major changes in the grass.py file. <br></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">I generally like the layout you suggested. It seems to me that choosing a good name for the whole module will be a bit tricky. </div></blockquote><div><br>This is intended as a proof of concept to see the feasibility.<br></div><div>I've try to found a better name but didn't come up to my mind...<br></div><div>Perhaps: <span style="font-family:monospace,monospace">session</span> instead of <span style="font-family:monospace,monospace">init</span>?<br><br></div><div>My final objective is to be able to do something like:<br><br></div><div><span style="font-family:monospace,monospace">```python<br></span></div><div><span style="font-family:monospace,monospace">import os<br></span></div><div><span style="font-family:monospace,monospace">import sys<br><br></span></div><div><span style="font-family:monospace,monospace"><b># Perhaps in GRASS8 we will be able to skip this! ;-)</b><br></span></div><div><span style="font-family:monospace,monospace">sys.append(os.environ.get('GISBASE', '/home/pietro/my/gisbase'))<br><br></span></div><div><span style="font-family:monospace,monospace">from grass.init import Session<br><br></span></div><div><span style="font-family:monospace,monospace"># open - close mode<br></span></div><div><span style="font-family:monospace,monospace">session = Session('mygisdbase/location/mapset')<br></span></div><div><span style="font-family:monospace,monospace">session.open()<br></span></div><div><span style="font-family:monospace,monospace"># do my stuff here...<br></span></div><div><span style="font-family:monospace,monospace">session.close()<br><br></span></div><div><span style="font-family:monospace,monospace"># with statement<br></span></div><div><span style="font-family:monospace,monospace">with Session('mygisdbase/location/mapset') as session:<br></span></div><div><span style="font-family:monospace,monospace">    # do my stuff here<br>```</span><br></div><div> <br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Also I think one reason for having them there was that grass.py works without a the G Python lib found.<br></div></blockquote><div><br></div><div>ok, but I don't see any advantage to have grass.py that works without loading the grass python libraries. and with the current status we have code duplication, that mean more code to read, test and maintain.<br></div><div>If you are afraid that the grass python libraries might be broken and therefore the user can have troubles, they will have troubles in any case (no gui, several important modules missing). So I will consider stopping the user <a href="http://earlier.as">earlier.as</a> a feature.<br><br></div><div>Let me know.<br><br></div><div>Pietro<br></div><div><br></div><div> </div></div></div></div></div>