[Erp5-report] r32335 rafael - in /erp5/trunk/products/ERP5: Document/ Tool/
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Feb 8 22:22:21 CET 2010
Author: rafael
Date: Mon Feb 8 22:22:21 2010
New Revision: 32335
URL: http://svn.erp5.org?rev=32335&view=rev
Log:
Added diffObjectAsHTML to render diffObject into HTML formats Like ERP5Subeversion does.
Modified:
erp5/trunk/products/ERP5/Document/BusinessTemplate.py
erp5/trunk/products/ERP5/Tool/TemplateTool.py
Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=32335&r1=32334&r2=32335&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Mon Feb 8 22:22:21 2010
@@ -29,6 +29,7 @@
import fnmatch, imp, os, re, shutil, sys
from Shared.DC.ZRDB.Connection import Connection as RDBConnection
+from Products.ERP5Type.DiffUtils import DiffFile
from Products.ERP5Type.Globals import Persistent, PersistentMapping
from Acquisition import Implicit, aq_base
from AccessControl import ClassSecurityInfo
@@ -5608,6 +5609,14 @@
if len(missing_dep_list) != 0:
raise BusinessTemplateMissingDependency, 'Impossible to install, please install the following dependencies before: %s'%repr(missing_dep_list)
+ def diffObjectAsHTML(self, REQUEST, **kw):
+ """
+ Convert diff into a HTML format before reply
+ This is compatible with ERP5Subversion look and feel but
+ it is preferred in future we use more difflib python library.
+ """
+ return DiffFile(self.diffObject(REQUEST, **kw)).toHTML()
+
def diffObject(self, REQUEST, **kw):
"""
Make a diff between an object in the Business Template
Modified: erp5/trunk/products/ERP5/Tool/TemplateTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/TemplateTool.py?rev=32335&r1=32334&r2=32335&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/TemplateTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/TemplateTool.py [utf8] Mon Feb 8 22:22:21 2010
@@ -36,6 +36,7 @@
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
+from Products.ERP5Type.DiffUtils import DiffFile
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions, tarfile
from Products.ERP5.Document.BusinessTemplate import BusinessTemplateMissingDependency
@@ -487,6 +488,14 @@
if hasattr(outfile, 'getvalue'):
return outfile.getvalue()
+
+ def diffObjectAsHTML(self, REQUEST, **kw):
+ """
+ Convert diff into a HTML format before reply
+ This is compatible with ERP5Subversion look and feel but
+ it is preferred in future we use more difflib python library.
+ """
+ return DiffFile(self.diffObject(REQUEST, **kw)).toHTML()
def diffObject(self, REQUEST, **kw):
"""
More information about the Erp5-report
mailing list