From 5e5b175315622741032dbc287b3271ef3770b56a Mon Sep 17 00:00:00 2001
From: Christophe Dumez <christophe@nexedi.com>
Date: Mon, 10 Apr 2006 11:14:31 +0000
Subject: [PATCH] - html / python splitting.. almost ok now

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6505 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Subversion/SubversionClient.py    | 16 ++++++++++++++--
 product/ERP5Subversion/Tool/SubversionTool.py | 15 ---------------
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/product/ERP5Subversion/SubversionClient.py b/product/ERP5Subversion/SubversionClient.py
index 0b989777b0..66998d2f60 100644
--- a/product/ERP5Subversion/SubversionClient.py
+++ b/product/ERP5Subversion/SubversionClient.py
@@ -266,8 +266,20 @@ try:
     
     def log(self, path):
       self._getPreferences()
-      return self.client.log(path)
-
+      try:
+        log_list = self.client.log(path)
+      except pysvn.ClientError, error:
+        excep = self.getException()
+        if excep:
+          raise excep
+        else:
+          raise error
+      # Edit list to make it more usable in zope
+      for rev_dict in log_list:
+        rev_dict['revision'] = rev_dict['revision'].number
+        rev_dict['date'] = time.ctime(rev_dict['date'])
+      return log_list
+        
     def add(self, path):
       self._getPreferences()
       return self.client.add(path=path, force=True)
diff --git a/product/ERP5Subversion/Tool/SubversionTool.py b/product/ERP5Subversion/Tool/SubversionTool.py
index 69f761be7c..dec1898c23 100644
--- a/product/ERP5Subversion/Tool/SubversionTool.py
+++ b/product/ERP5Subversion/Tool/SubversionTool.py
@@ -541,21 +541,6 @@ class SubversionTool(UniqueObject, Folder):
     client = self._getClient()
     return client.log(path)
   
-  def logHTML(self, bt, path):
-    log_list=self.log(path)
-    html='''<script>
-      function checkControl(){
-        alert("checked")
-      }
-    </script>
-    '''
-    html+="<br><b><a href='BusinessTemplate_viewSvnShowFile?file=%s'>%s File History</a></b>  <a href='%s'><img src='imgs/edit.png' border='0'></a><hr><br>"%(path, path, self.editPath(bt, path))
-    for rev_dict in log_list:
-      html+="<center><table border=1 width=60%%><tr><td rowspan='2'><input name='check%s' value='%s' type='checkbox'></td><td style='background-color: rgb(204, 204, 255);'><b>Revision:</b> %s </td><td style='background-color: rgb(204, 204, 255);'> <b>Author:</b> %s </td><td style='background-color: rgb(204, 204, 255);'> <b>Date:</b> %s</td></tr>"%(rev_dict['revision'].number,rev_dict['revision'].number, rev_dict['revision'].number,rev_dict['author'], time.ctime(rev_dict['date']))
-      html+="<tr><td style='background-color: white;' colspan='3'><i>"+'<br>'.join(rev_dict['message'].split('\n'))+'</i></td></tr></table></center>'
-      html+='<br><br>'
-    return html
-  
   security.declareProtected('Import/Export objects', 'cleanup')
   def cleanup(self):
     """remove svn locks in working copy
-- 
2.30.9