[GRASS-dev] Print in one line a `g.message` and a raster's processing % progress counter

Nikos Alexandris nik at nikosalexandris.net
Tue Nov 12 07:20:20 PST 2013


Nikos Alexandris:

> > A GRASSy shell script print's out, by using g.messave -i (or similar),
> > something like:

> > --%<---
> > [1] ...
> > [2] "Some message..."
> > 100%
> > [3] "Another message..."
> > 100%
> > [4] "And another message..."
> > 100%
> > [5] ...
> > --->%--

> > I would like to have the % progress counter right after the message, in
> > the same line and not printed in a new line. How is this to be achieved?

Markus Neteler:
 
> It might be an idea to add a new flag for this like "echo" offers:
> 
> echo - display a line of text
>        -n     do not output the trailing newline

That is a nice idea. I don't know of course if others consider this as necessary, but I'd like to 
be able to compress further and minimalise the extent of "g.message"s in the command line.


> > This is a bash shell question. Yet, what technique is there for a python
> > script?
> 
> Random link:
> http://stackoverflow.com/questions/275018/how-can-i-remove-chomp-a-newline-i
> n-python
> 
> I am not sure if a new flag should be added to g.message.
> 
> Note that there is also
> 
> GRASS_MESSAGE_FORMAT [various modules, wxGUI]
> it may be set to either
>  - standard - sets percentage output and message formatting style to
> standard formatting,
>  - gui - sets percentage output and message formatting style to GUI
> formatting, - silent - disables percentage output and error messages,
>  - plain - sets percentage output and message formatting style to
> ASCII output without rewinding control characters.
> http://grass.osgeo.org/grass70/manuals/variables.html

Thanks!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20131112/e53f6a7e/attachment-0001.html>


More information about the grass-dev mailing list