Browse Source

More space-related fixes

[SVN r37626]
Aleksey Gurtovoy 19 năm trước cách đây
mục cha
commit
32d6732dd5
1 tập tin đã thay đổi với 15 bổ sung2 xóa
  1. 15 2
      tools/regression/xsl_reports/utils/libxslt.py

+ 15 - 2
tools/regression/xsl_reports/utils/libxslt.py

@@ -1,13 +1,19 @@
 
+# Copyright (c) MetaCommunications, Inc. 2003-2007
+#
+# Distributed under the Boost Software License, Version 1.0. 
+# (See accompanying file LICENSE_1_0.txt or copy at 
+# http://www.boost.org/LICENSE_1_0.txt)
+
 import utils.makedirs
 import os.path
 import os
 import sys
 
 
-def xslt_param( path ):
+def xslt_param( path, replace_spaces = 1 ):
     path = path.replace( '\\', '/' )
-    if sys.platform == 'win32':
+    if sys.platform == 'win32' and replace_spaces:
         path = path.replace( ' ', '%20' )
     return path
 
@@ -35,3 +41,10 @@ def libxslt( log, xml_file, xsl_file, output_file, parameters = None ):
     if rc != 0:
         raise Exception( '"%s" failed with return code %d' % ( transform_command, rc ) )
 
+    output_file = xslt_param( output_file, 0 )
+    xlst_output_file = xslt_param( output_file )
+    if output_file != xlst_output_file:        
+        log( 'Renaming %s to %s' % ( xlst_output_file, output_file ) )
+        os.unlink( output_file )
+        os.rename( xlst_output_file, output_file )
+

粤ICP备19079148号