From 68c4794918a59e19d351d0c16d802cf7e23eeedb Mon Sep 17 00:00:00 2001 From: Christophe Dumez <christophe@nexedi.com> Date: Mon, 10 Apr 2006 09:29:44 +0000 Subject: [PATCH] - keep on splitting HTML / python git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6503 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Subversion/SubversionClient.py | 18 ++++++++++++++++-- product/ERP5Subversion/Tool/SubversionTool.py | 16 ---------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/product/ERP5Subversion/SubversionClient.py b/product/ERP5Subversion/SubversionClient.py index 00ac99909e..0b989777b0 100644 --- a/product/ERP5Subversion/SubversionClient.py +++ b/product/ERP5Subversion/SubversionClient.py @@ -274,8 +274,22 @@ try: def info(self, path): self._getPreferences() - return self.client.info(path=path) - + try: + entry = self.client.info(path=path) + except pysvn.ClientError, error: + excep = self.getException() + if excep: + raise excep + else: + raise error + # transform entry to dict to make it more usable in zope + members_tuple=('url', 'uuid', 'revision', 'kind', 'commit_author', 'commit_revision', 'commit_time',) + entry_dict = dict([(member,getattr(entry,member)) for member in members_tuple]) + entry_dict['revision'] = entry_dict['revision'].number + entry_dict['commit_revision'] = entry_dict['commit_revision'].number + entry_dict['commit_time'] = time.ctime(entry_dict['commit_time']) + return entry_dict + def ls(self, path): self._getPreferences() try: diff --git a/product/ERP5Subversion/Tool/SubversionTool.py b/product/ERP5Subversion/Tool/SubversionTool.py index df6b507c53..69f761be7c 100644 --- a/product/ERP5Subversion/Tool/SubversionTool.py +++ b/product/ERP5Subversion/Tool/SubversionTool.py @@ -566,22 +566,6 @@ class SubversionTool(UniqueObject, Folder): client = self._getClient() return client.cleanup(working_copy) - security.declareProtected('Import/Export objects', 'infoHTML') - def infoHTML(self): - entry=self.info() - html='''<center><h1>Working Copy Informations</h1></center><br> - <center><table width='60%%' border='1'> - <tr height="18px"><td><b>Repository URL</b></td><td>%s</td></tr> - <tr height="18px"><td><b>Repository UUID</b></td><td>%s</td></tr> - <tr height="18px"><td><b>Revision</b></td><td>%s</td></tr> - <tr height="18px"><td><b>Node Type</b></td><td>%s</td></tr> - <tr height="18px"><td><b>Last Commit Author</b></td><td>%s</td></tr> - <tr height="18px"><td><b>Last Commit Revision</b></td><td>%s</td></tr> - <tr height="18px"><td><b>Last Commit Time</b></td><td>%s</td></tr> - </table></center>'''%(entry.url, entry.uuid, entry.revision.number, entry.kind, entry.commit_author, entry.commit_revision.number, time.ctime(entry.commit_time),) - return html - - security.declareProtected('Import/Export objects', 'remove') def remove(self, path): """Remove a file or a directory. -- 2.30.9