[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qgis-developer
Subject:    Re: [Qgis-developer] [GRASS-dev] no grass plugin in qgis installed from osgeo4w
From:       Pedro_VenĂ¢ncio <pedrongvenancio () gmail ! com>
Date:       2015-10-27 23:43:16
Message-ID: CAMCJChuDjYLUyrUj_wWT1v+HJsuOBKqJj80gQEB4THArWU1W2Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

Just forwarding this tip from Markus, about the problem I've found in
OSGeo4W:



> On Sunday I made an installation on Windows and I found a problem. GRASS
> > 7.0.2RC is already available on OSGeo4W. However, the .bat file that is
> > created for the use of GRASS7 with QGIS, does not work, because it
> points to
> > the folder structure of GRASS 7.0.1.
> 
> Hi Pedro:
> I'm not on the QGIS list, please forward to them that they would better
> use this approach to get the path rather than hardocing it:
> 
> grass70 --config path
> 
> If they need Python, they could use something like this:
> 
> 
> https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_7
>  
> # query GRASS 7 itself for its GISBASE
> startcmd = [grass7bin, '--config', 'path']
> 
> p = subprocess.Popen(startcmd, shell=False,
> stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> out, err = p.communicate()if p.returncode != 0:
> print >>sys.stderr, "ERROR: Cannot find GRASS GIS 7 start script (%s)" % startcmd
> sys.exit(-1)
> gisbase = out.strip('\n\r')
> # Set GISBASE environment variableos.environ['GISBASE'] = gisbase# the following \
> not needed with trunkos.environ['PATH'] += os.pathsep + os.path.join(gisbase, \
> 'extrabin')# add path to GRASS addons home = \
> os.path.expanduser("~")os.environ['PATH'] += os.pathsep + os.path.join(home, \
> '.grass7', 'addons', 'scripts') 
> 
> 
> Best
> Markus
> 


Best regards,
Pedro


[Attachment #5 (text/html)]

<div dir="ltr"><div><div>Hi,<br></div><div><br>Just forwarding this tip from Markus, \
about the problem I&#39;ve found in OSGeo4W:<br><br></div></div><div><div><div><div \
class="gmail_extra"><br><div class="gmail_quote"><br><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="">&gt; On Sunday I \
made an installation on Windows and I found a problem. GRASS<br>&gt; 7.0.2RC is \
already available on OSGeo4W. However, the .bat file that is<br>&gt; created for the \
use of GRASS7 with QGIS, does not work, because it points to<br>&gt; the folder \
structure of GRASS 7.0.1.<br><br></span>Hi Pedro:<br>I&#39;m not on the QGIS list, \
please forward to them that they would better use this approach to get the path \
rather than hardocing it:<br><br>grass70 --config path<br><br>If they need Python, \
they could use something like this:<br><br><a \
href="https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_7" \
target="_blank">https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_i \
t_explicitly#Python:_GRASS_GIS_7</a><span></span><span></span><br><br><pre><span># \
query GRASS 7 itself for its GISBASE</span> startcmd <span>=</span> \
<span>[</span>grass7bin<span>,</span> <span>&#39;--config&#39;</span><span>,</span> \
<span>&#39;path&#39;</span><span>]</span>  
p <span>=</span> <span>subprocess</span>.<span>Popen</span><span>(</span>startcmd<span>,</span> \
shell<span>=</span><span>False</span><span>,</span>  \
stdout<span>=</span><span>subprocess</span>.<span>PIPE</span><span>,</span> \
stderr<span>=</span><span>subprocess</span>.<span>PIPE</span><span>)</span> \
out<span>,</span> err <span>=</span> \
p.<span>communicate</span><span>(</span><span>)</span> <span>if</span> \
p.<span>returncode</span> <span>!=</span> <span>0</span>:  <span>print</span> \
<span>&gt;&gt;</span><span>sys</span>.<span>stderr</span><span>,</span> \
<span>&quot;ERROR: Cannot find GRASS GIS 7 start script (%s)&quot;</span>  % startcmd \
<span>sys</span>.<span>exit</span><span>(</span>-<span>1</span><span>)</span> gisbase \
<span>=</span> out.<span>strip</span><span>(</span><span>&#39;<span>\n</span><span>\r</span>&#39;</span><span>)</span>
  
<span># Set GISBASE environment variable</span>
<span>os</span>.<span>environ</span><span>[</span><span>&#39;GISBASE&#39;</span><span>]</span> \
<span>=</span> gisbase <span># the following not needed with trunk</span>
<span>os</span>.<span>environ</span><span>[</span><span>&#39;PATH&#39;</span><span>]</span> \
+<span>=</span> <span>os</span>.<span>pathsep</span> + \
<span>os</span>.<span>path</span>.<span>join</span><span>(</span>gisbase<span>,</span> \
<span>&#39;extrabin&#39;</span><span>)</span> <span># add path to GRASS addons</span>
home <span>=</span> <span>os</span>.<span>path</span>.<span>expanduser</span><span>(</span><span>&quot;~&quot;</span><span>)</span>
 <span>os</span>.<span>environ</span><span>[</span><span>&#39;PATH&#39;</span><span>]</span> \
+<span>=</span> <span>os</span>.<span>pathsep</span> + \
<span>os</span>.<span>path</span>.<span>join</span><span>(</span>home<span>,</span> \
<span>&#39;.grass7&#39;</span><span>,</span> \
<span>&#39;addons&#39;</span><span>,</span> \
<span>&#39;scripts&#39;</span><span>)</span> </pre><br><br>Best<span class=""><font \
color="#888888"><br>Markus</font></span></div> </blockquote></div><br><br>Best \
regards,<br>Pedro<br></div></div></div></div></div>


[Attachment #6 (text/plain)]

_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic