Commit fc861865 authored by Rafael Monnerat's avatar Rafael Monnerat

Added diffObjectAsHTML to render diffObject into HTML formats Like ERP5Subeversion does.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32335 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5053ae36
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
import fnmatch, imp, os, re, shutil, sys import fnmatch, imp, os, re, shutil, sys
from Shared.DC.ZRDB.Connection import Connection as RDBConnection from Shared.DC.ZRDB.Connection import Connection as RDBConnection
from Products.ERP5Type.DiffUtils import DiffFile
from Products.ERP5Type.Globals import Persistent, PersistentMapping from Products.ERP5Type.Globals import Persistent, PersistentMapping
from Acquisition import Implicit, aq_base from Acquisition import Implicit, aq_base
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
...@@ -5608,6 +5609,14 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5608,6 +5609,14 @@ Business Template is a set of definitions, such as skins, portal types and categ
if len(missing_dep_list) != 0: if len(missing_dep_list) != 0:
raise BusinessTemplateMissingDependency, 'Impossible to install, please install the following dependencies before: %s'%repr(missing_dep_list) 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): def diffObject(self, REQUEST, **kw):
""" """
Make a diff between an object in the Business Template Make a diff between an object in the Business Template
......
...@@ -36,6 +36,7 @@ import sys ...@@ -36,6 +36,7 @@ import sys
from Acquisition import Implicit from Acquisition import Implicit
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.DiffUtils import DiffFile
from Products.ERP5Type.Tool.BaseTool import BaseTool from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions, tarfile from Products.ERP5Type import Permissions, tarfile
from Products.ERP5.Document.BusinessTemplate import BusinessTemplateMissingDependency from Products.ERP5.Document.BusinessTemplate import BusinessTemplateMissingDependency
...@@ -488,6 +489,14 @@ class TemplateTool (BaseTool): ...@@ -488,6 +489,14 @@ class TemplateTool (BaseTool):
if hasattr(outfile, 'getvalue'): if hasattr(outfile, 'getvalue'):
return 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): def diffObject(self, REQUEST, **kw):
""" """
Make diff between two objects, whose paths are stored in values bt1 Make diff between two objects, whose paths are stored in values bt1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment