[Erp5-report] r7405 - /erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon May 22 16:49:31 CEST 2006


Author: chris
Date: Mon May 22 16:49:28 2006
New Revision: 7405

URL: http://svn.erp5.org?rev=7405&view=rev
Log:
- fixed bug when file doesn't not exist (in show file content)

Modified:
    erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py

Modified: erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py?rev=7405&r1=7404&r2=7405&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py (original)
+++ erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py Mon May 22 16:49:28 2006
@@ -673,16 +673,17 @@
     """ Display a file content in HTML with syntax highlighting
     """
     file_path = self.relativeToAbsolute(file_path, business_template)
-    input_file = open(file_path, 'r')
     if os.path.exists(file_path):
       if os.path.isdir(file_path):
         text = "<b>"+file_path+"</b><hr>"
         text += file_path +" is a folder!"
       else:
+        input_file = open(file_path, 'r')
         head = "<b>"+file_path+"</b>  <a href='" + \
         self.editPath(business_template, file_path) + \
         "'><img src='imgs/edit.png' border='0'></a><hr>"
         text = head + colorize(input_file.read())
+        input_file.close()
     else:
       # see if tmp file is here (svn deleted file)
       if file_path[-1] == os.sep:
@@ -692,12 +693,13 @@
       tmp_path = os.path.join(tmp_path, '.svn', 'text-base', \
       filename+'.svn-base')
       if os.path.exists(tmp_path):
+        input_file = open(tmp_path, 'r')
         head = "<b>"+tmp_path+"</b> (svn temporary file)<hr>"
         text = head + colorize(input_file.read())
+        input_file.close()
       else : # does not exist
         text = "<b>"+file_path+"</b><hr>"
         text += file_path +" does not exist!"
-    input_file.close()
     return text
       
   security.declareProtected(Permissions.ManagePortal, 'acceptSSLServer')




More information about the Erp5-report mailing list