meld r1237 - trunk/vc



Author: vincele
Date: Mon Mar  9 09:10:38 2009
New Revision: 1237
URL: http://svn.gnome.org/viewvc/meld?rev=1237&view=rev

Log:
Remove the use of subprocess module, for the sake of
python 2.3 compatibility, use os.popen() instead.


Modified:
   trunk/vc/svn.py

Modified: trunk/vc/svn.py
==============================================================================
--- trunk/vc/svn.py	(original)
+++ trunk/vc/svn.py	Mon Mar  9 09:10:38 2009
@@ -23,7 +23,6 @@
 
 import os
 import errno
-import subprocess
 import _vc
 
 class Vc(_vc.Vc):
@@ -55,8 +54,7 @@
 
         while 1:
             try:
-                entries = subprocess.Popen(["svn","status","-Nv",directory],
-                    shell=False, stdout=subprocess.PIPE).stdout.read()
+                entries = os.popen("%s status -Nv %s" % (self.CMD, directory))
                 break
             except OSError, e:
                 if e.errno != errno.EAGAIN:
@@ -65,7 +63,8 @@
         retfiles = []
         retdirs = []
         matches = []
-        for line in entries.split("\n"):
+        for line in entries:
+            line = line.strip("\n")
             if len(line) > 40:
                 matches.append( (line[40:], line[0], line[17:26].strip()))
         matches.sort()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]