[GRASS-dev] [GRASS GIS] #2127: Python implementation of g.message
GRASS GIS
trac at osgeo.org
Sun Nov 10 16:46:20 PST 2013
#2127: Python implementation of g.message
-------------------------+--------------------------------------------------
Reporter: huhabla | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Keywords: | Platform: Unspecified
Cpu: All |
-------------------------+--------------------------------------------------
Comment(by huhabla):
I have implementation GRASS messenger interface prototype. The file is
attached in the ticket. It uses the Python multiprocessing interface. The
IPC is handled via pipes. Here a usage example:
{{{
msgr = Messenger()
msgr.message("message")
msgr.verbose("verbose message")
msgr.important("important message")
msgr.test_fatal_error()
msgr.percent(1, 1, 1)
msgr.debug(0, "debug 0")
msgr.warning("Ohh")
msgr.debug(1, "debug 1")
msgr.error("Ohh no")
msgr.stop()
# This should result in:
"""
message
important message
ERROR: this is a fatal error
WARNING: Needed to restart the messenger server
100%
D0/0: debug 0
WARNING: Ohh
ERROR: Ohh no
"""
# Test of the percentage creation
msgr = Messenger()
num = 100000
for i in range(num):
msgr.percent(i, num, 10)
msgr.stop()
}}}
What are you thinking, any improvement suggestions, enhancement requests?
:)
I would like to put the attached file {{{__init__.py}}} into a new pygrass
directory "lib/python/pygrass/messenger", if there are no objections
against it.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2127#comment:4>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list