[GRASS-SVN] r38172 - grass-addons/vector/v.in.postgis

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 2 13:16:31 EDT 2009


Author: mathieug
Date: 2009-07-02 13:16:31 -0400 (Thu, 02 Jul 2009)
New Revision: 38172

Modified:
   grass-addons/vector/v.in.postgis/v_in_postgis.py
Log:
python implementation - unit test module - renamed module

Modified: grass-addons/vector/v.in.postgis/v_in_postgis.py
===================================================================
--- grass-addons/vector/v.in.postgis/v_in_postgis.py	2009-07-02 16:13:59 UTC (rev 38171)
+++ grass-addons/vector/v.in.postgis/v_in_postgis.py	2009-07-02 17:16:31 UTC (rev 38172)
@@ -112,7 +112,7 @@
             host = grass.parse_key_val(dbElems[0], sep = '=')['host']
             db = grass.parse_key_val(dbElems[1], sep = '=')['dbname']
             loginLine = self.executeCommand('sed -n "/pg ' + dbElems[0] + ','\
-                                                + dbElems[1] + ' /p" ' + self.grassloginfile, shell = True)
+                                                + dbElems[1] + ' /p" ' + self.grassloginfile, redirect = False, shell = True)
             p = re.compile(' ')
             loginElems = p.split(loginLine)
             user = loginElems[-2].strip()
@@ -126,10 +126,11 @@
         """Command execution method using Popen in two modes : shell mode or not"""
         p = None
         shell = True if 'shell' in kwargs and kwargs['shell'] is True else False
+        redirection = True if 'redirect' in kwargs and kwargs['redirect'] is True else False
         command = args[0]
         if shell is True:
-            if self.logOutput is not False:
-                command = command + ' >> ' +  logFile
+            if redirection is True and self.logOutput is not False:
+                command = command + ' >> ' +  self.logfile
             ##use redirection on stdout only
             command = command + " 2>&1"
             p = Popen(command, shell = shell, stdout = PIPE)



More information about the grass-commit mailing list