<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Oct 9, 2017 3:17 AM, "Nikos Alexandris" <<a href="mailto:nik@nikosalexandris.net">nik@nikosalexandris.net</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* Moritz Lennert <<a href="mailto:moritz.lennert@ulb.ac.be" target="_blank">moritz.lennert@ulb.ac.be</a>> [2017-10-09 10:59:25 +0200]:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">
On 07/10/17 10:39, Nikos Alexandris wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In a grassy script, how can I force verbosity, i.e. --v whenever a flag<br>
-l is instructed? Which will lead to<br>
<br>
env['GRASS_VERBOSE'] = '3'<br>
<br>
?<br>
<br>
<br>
i.some.module input=some_input -l<br>
<br>
should be identical to<br>
<br>
i.some.module input=some_input -l --v<br>
<br>
<br>
The following is, of course, not working:<br>
<br>
#%rules<br>
#% requires_all: -l,--v<br>
#%end<br>
<br>
</blockquote>
<br></div>
I don't think the -- flags are covered by the rules, so I think you have to do this in the code, i.e. something like this:<br>
<br>
if flags['l']:<br>
        env['GRASS_VERBOSE'] = '3'<br>
</blockquote>
<br>
Merci Moritz,<br>
<br>
I tested already (before asking)<br>
<br>
env = os.environ.copy()<br>
if list_only:<br>
   env['GRASS_VERBOSE'] = '3'<br>
<br>
but it does not work.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">It shouldn't, you copied the environment, you didn't change the environment used. You would have to take the copied env and pass it to run_command, then it would work. Or of course, modify the actual environment, not the copied one. Hope this clarifies it a bit.</div><div dir="auto"><br></div><div dir="auto">Anna</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Aren't there other ways?<br>
<br>
Thank you again, N<br>
<br>______________________________<wbr>_________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/grass-dev</a><br></blockquote></div><br></div></div></div>