<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi,<br>
I was wandering: does exist a python::core function capable to
mogrigy the inputs of a run_command()?<br>
<br>
The mogrify function for psycopg2 is defined as follows: <br>
"<i>Return a query string after arguments binding. The string
returned is exactly the one that would be sent to the database
running the execute() method or similar.</i>"<br>
>>> cur.mogrify("INSERT INTO test (num, data) VALUES (%s,
%s)", (42, 'bar'))<br>
"INSERT INTO test (num, data) VALUES (42, E'bar')"<br>
<br>
...so for GRASS it could be:<br>
>>> grass.mogrify_command("r.univar",flags="g",map="test")<br>
"r.univar -g map=test"<br>
<br>
This could be helpful in debugging....<br>
<br>
Maxi<br>
<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Dr. Eng. Massimiliano Cannata
Responsabile Area Geomatica
Istituto Scienze della Terra
Scuola Universitaria Professionale della Svizzera Italiana
Via Trevano, c.p. 72
CH-6952 Canobbio-Lugano
Tel: +41 (0)58 666 62 14
Fax +41 (0)58 666 62 09
</pre>
</body>
</html>