Update of /cvsroot/boost/boost/tools/regression/xsl_reports/utils
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27815/utils

Modified Files:
        __init__.py libxslt.py 
Added Files:
        rename.py 
Log Message:
Factor out rename into a function

--- NEW FILE: rename.py ---

# 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 os.path
import os


def rename( log, src, dst ):
    log( 'Renaming %s to %s' % ( src, dst ) )
    if os.path.exists( dst ):
        os.unlink( dst )

    os.rename( src, dst )

Index: __init__.py
===================================================================
RCS file: /cvsroot/boost/boost/tools/regression/xsl_reports/utils/__init__.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- __init__.py 8 Mar 2005 12:17:59 -0000       1.7
+++ __init__.py 8 May 2007 11:40:34 -0000       1.8
@@ -6,6 +6,7 @@
 from libxslt import *
 from log import *
 from makedirs import *
+from rename import *
 from tar import *
 from zip import *
 

Index: libxslt.py
===================================================================
RCS file: /cvsroot/boost/boost/tools/regression/xsl_reports/utils/libxslt.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- libxslt.py  8 May 2007 11:27:27 -0000       1.7
+++ libxslt.py  8 May 2007 11:40:34 -0000       1.8
@@ -6,6 +6,7 @@
 # http://www.boost.org/LICENSE_1_0.txt)
 
 import utils.makedirs
+import utils.rename
 import os.path
 import os
 import sys
@@ -43,8 +44,6 @@
 
     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 )
+    if output_file != xlst_output_file:
+        utils.rename( log, xlst_output_file, output_file )
 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to