From 7d2ff1d04e4da744307f2e69516f92930a8f8f7e Mon Sep 17 00:00:00 2001
From: valerio <valerio@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Fri, 16 Jul 2010 10:47:10 +0000
Subject: [PATCH] Fixes to allow use of TMtools with paths containing spaces

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2573 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 modules/bindings/pymod/tmtools.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/bindings/pymod/tmtools.py b/modules/bindings/pymod/tmtools.py
index 56fd10a8a..284006d6c 100644
--- a/modules/bindings/pymod/tmtools.py
+++ b/modules/bindings/pymod/tmtools.py
@@ -75,10 +75,10 @@ def _RunTmAlign(tmalign, tmp_dir):
   model2_filename=os.path.join(tmp_dir, 'model02.pdb')
   if platform.system() == "Windows":
     tmalign_path=settings.Locate('tmalign.exe', explicit_file_name=tmalign)
-    command="\"%s\" %s %s" %(os.path.normpath(tmalign_path), model1_filename, model2_filename)
+    command="\"%s\" \"%s\" \"%s\"" %(os.path.normpath(tmalign_path), model1_filename, model2_filename)
   else:
     tmalign_path=settings.Locate('tmalign', explicit_file_name=tmalign)  
-    command="%s '%s' '%s'" %(tmalign_path, model1_filename, model2_filename)
+    command="\"%s\" \"%s\" \"%s\"" %(tmalign_path, model1_filename, model2_filename)
   ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
   ps.wait()
   lines=ps.stdout.readlines()
@@ -120,10 +120,10 @@ def _RunTmScore(tmscore, tmp_dir):
   model2_filename=os.path.join(tmp_dir, 'model02.pdb')  
   if platform.system() == "Windows":
     tmscore_path=settings.Locate('tmscore.exe', explicit_file_name=tmscore)
-    command="\"%s\" %s %s" %(os.path.normpath(tmscore_path), model1_filename, model2_filename)
+    command="\"%s\" \"%s\" \"%s\"" %(os.path.normpath(tmscore_path), model1_filename, model2_filename)
   else:
     tmscore_path=settings.Locate('tmscore', explicit_file_name=tmscore)
-    command="%s '%s' '%s'" %(tmscore_path, model1_filename, model2_filename)
+    command="\"%s\" \"%s\" \"%s\"" %(tmscore_path, model1_filename, model2_filename)
   ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
   ps.wait()
   lines=ps.stdout.readlines()
-- 
GitLab