Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
140
Merge Requests
140
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
a8d640fc
Commit
a8d640fc
authored
Jul 01, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: Migrate Products.ERP5Type.DiffUtils from filesystem.
parent
c45773cd
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
126 additions
and
12 deletions
+126
-12
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.Git.py
...omponentTemplateItem/portal_components/module.erp5.Git.py
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/Base_formatDiffObjectListToHTML.py
...tal_skins/erp5_toolbox/Base_formatDiffObjectListToHTML.py
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsDiff.py
...eItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsDiff.py
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsMultiDiff.py
.../portal_skins/erp5_vcs/BusinessTemplate_doVcsMultiDiff.py
+1
-1
bt5/erp5_syncml/ExtensionTemplateItem/portal_components/extension.erp5.SyncMLTool.py
...mplateItem/portal_components/extension.erp5.SyncMLTool.py
+1
-1
bt5/erp5_tiosafe_core/ExtensionTemplateItem/portal_components/extension.erp5.TioSafeTool.py
...plateItem/portal_components/extension.erp5.TioSafeTool.py
+1
-1
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+1
-1
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+2
-1
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.DiffUtils.py
...ntTemplateItem/portal_components/module.erp5.DiffUtils.py
+6
-3
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.DiffUtils.xml
...tTemplateItem/portal_components/module.erp5.DiffUtils.xml
+110
-0
product/ERP5/bootstrap/erp5_core/bt/template_module_component_id_list
.../bootstrap/erp5_core/bt/template_module_component_id_list
+1
-0
product/ERP5Type/__init__.py
product/ERP5Type/__init__.py
+0
-1
No files found.
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.Git.py
View file @
a8d640fc
...
...
@@ -214,7 +214,7 @@ class Git(WorkingCopy):
for
stat
in
out
.
next
().
splitlines
():
stat
,
path
=
stat
.
split
()[
4
:]
stat_dict
[
path
]
=
stat
# Emulate svn output for compatibility with
Products.ERP5Typ
e.DiffUtils
# Emulate svn output for compatibility with
erp5.component.modul
e.DiffUtils
template
=
'Index: %%s
\
n
%s%%s
\
n
'
%
(
'='
*
67
)
for
diff
in
out
:
path
=
diff
[:
diff
.
index
(
' '
)]
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/Base_formatDiffObjectListToHTML.py
View file @
a8d640fc
from
Products.ERP5Typ
e.DiffUtils
import
DiffFile
from
erp5.component.modul
e.DiffUtils
import
DiffFile
from
Products.PythonScripts.standard
import
html_quote
def
sortDiffObjectList
(
diff_object_list
):
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsDiff.py
View file @
a8d640fc
...
...
@@ -3,7 +3,7 @@ template_tool = context.getPortalObject().portal_templates
if
template_tool
.
getDiffFilterScriptList
():
DiffFile
=
template_tool
.
getFilteredDiff
else
:
from
Products.ERP5Typ
e.DiffUtils
import
DiffFile
from
erp5.component.modul
e.DiffUtils
import
DiffFile
print
'<div style="color: black">'
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsMultiDiff.py
View file @
a8d640fc
...
...
@@ -4,7 +4,7 @@
# TODO: handle Svn SSL/login exceptions, preferably reusing vcs_dialog(_error)
# TODO: Git support
from
Products.ERP5Typ
e.DiffUtils
import
DiffFile
from
erp5.component.modul
e.DiffUtils
import
DiffFile
request
=
context
.
REQUEST
try
:
...
...
bt5/erp5_syncml/ExtensionTemplateItem/portal_components/extension.erp5.SyncMLTool.py
View file @
a8d640fc
...
...
@@ -27,7 +27,7 @@
import
base64
from
lxml
import
etree
from
difflib
import
unified_diff
from
Products.ERP5Typ
e.DiffUtils
import
DiffFile
from
erp5.component.modul
e.DiffUtils
import
DiffFile
def
diffXML
(
xml_plugin
=
""
,
xml_erp5
=
""
,
gid
=
""
,
html
=
True
):
if
isinstance
(
xml_erp5
,
unicode
):
...
...
bt5/erp5_tiosafe_core/ExtensionTemplateItem/portal_components/extension.erp5.TioSafeTool.py
View file @
a8d640fc
...
...
@@ -28,7 +28,7 @@
from
lxml
import
etree
from
erp5.component.module.XMLSyncUtils
import
getConduitByName
from
difflib
import
unified_diff
from
Products.ERP5Typ
e.DiffUtils
import
DiffFile
from
erp5.component.modul
e.DiffUtils
import
DiffFile
def
callAddNodeOnConduit
(
self
,
conduit_id
,
uid
):
...
...
product/ERP5/Document/BusinessTemplate.py
View file @
a8d640fc
...
...
@@ -31,7 +31,6 @@ import fnmatch, gc, glob, imp, os, re, shutil, sys, time, tarfile
from
collections
import
defaultdict
from
Shared.DC.ZRDB
import
Aqueduct
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
,
aq_inner
,
aq_parent
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
,
getSecurityManager
...
...
@@ -6024,6 +6023,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
This is compatible with ERP5VCS look and feel but
it is preferred in future we use more difflib python library.
"""
from
erp5.component.module.DiffUtils
import
DiffFile
return
DiffFile
(
self
.
diffObject
(
REQUEST
,
**
kw
)).
toHTML
()
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'diffObject'
)
...
...
product/ERP5/Tool/TemplateTool.py
View file @
a8d640fc
...
...
@@ -39,7 +39,6 @@ from AccessControl import ClassSecurityInfo
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
from
Products.CMFActivity.ActiveResult
import
ActiveResult
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
,
PersistentMapping
from
Products.ERP5Type.DiffUtils
import
DiffFile
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ERP5Type.Cache
import
transactional_cached
from
Products.ERP5Type
import
Permissions
...
...
@@ -543,6 +542,7 @@ class TemplateTool (BaseTool):
"""
Filter the diff using python scripts
"""
from erp5.component.module.DiffUtils import DiffFile
diff_file_object = DiffFile(diff)
diff_block_list = diff_file_object.getModifiedBlockList()
if diff_block_list:
...
...
@@ -563,6 +563,7 @@ class TemplateTool (BaseTool):
This is compatible with ERP5VCS look and feel but
it is preferred in future we use more difflib python library.
"""
from erp5.component.module.DiffUtils import DiffFile
return DiffFile(self.diffObject(REQUEST, **kw)).toHTML()
security.declareProtected(Permissions.ManagePortal, '
diffObject
')
...
...
product/ERP5
Type/
DiffUtils.py
→
product/ERP5
/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.
DiffUtils.py
View file @
a8d640fc
...
...
@@ -81,7 +81,7 @@ class DiffFile(object):
# Splitting the body from the header
self
.
body
=
os
.
linesep
.
join
(
raw_diff
.
strip
().
splitlines
()[
3
:])
if
not
self
.
body
.
startswith
(
'@@'
):
self
.
body
=
os
.
linesep
.
join
(
raw_diff
.
strip
().
splitlines
()[
4
:])
self
.
body
=
os
.
linesep
.
join
(
raw_diff
.
strip
().
splitlines
()[
4
:])
# Now splitting modifications
first
=
True
tmp
=
[]
...
...
@@ -192,9 +192,9 @@ class CodeBlock:
self
.
body
=
os
.
linesep
.
join
(
raw_diff
.
splitlines
()[
1
:])
self
.
header
=
raw_diff
.
splitlines
()[
0
]
# Getting modifications lines
tmp
=
re
.
search
(
'^@@ -
\
d+
'
, self.header)
tmp
=
re
.
search
(
r
'^@@ -\
d+
', self.header)
self.old_line = tmp.string[tmp.start():tmp.end()][4:]
tmp = re.search('
\
+
\
d
+
', self.header)
tmp = re.search(
r
'
\
+
\
d
+
', self.header)
self.new_line = tmp.string[tmp.start():tmp.end()][1:]
# Splitting modifications in SubCodeBlocks
in_modif = False
...
...
@@ -340,3 +340,6 @@ class SubCodeBlock:
if line.startswith('
+
'):
return ('
' + line[1:], self.color)
return (line, self.color)
from AccessControl.SecurityInfo import ModuleSecurityInfo
ModuleSecurityInfo(__name__).declarePublic('
DiffFile
')
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.DiffUtils.xml
0 → 100644
View file @
a8d640fc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Module Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
DiffUtils
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5Type.DiffUtils
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
module.erp5.DiffUtils
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Module Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/bt/template_module_component_id_list
View file @
a8d640fc
module.erp5.DateUtils
module.erp5.DiffUtils
module.erp5.ExpandPolicy
module.erp5.GeneratedAmountList
module.erp5.MovementCollectionDiff
...
...
product/ERP5Type/__init__.py
View file @
a8d640fc
...
...
@@ -183,7 +183,6 @@ allow_module('Products.ERP5Type.Log')
allow_module
(
'Products.ERP5Type.ImmediateReindexContextManager'
)
ModuleSecurityInfo
(
'Products.ERP5Type.JSON'
).
declarePublic
(
'dumps'
,
'loads'
)
ModuleSecurityInfo
(
'Products.ERP5Type.Constraint'
).
declarePublic
(
'PropertyTypeValidity'
)
ModuleSecurityInfo
(
'Products.ERP5Type.DiffUtils'
).
declarePublic
(
'DiffFile'
)
ModuleSecurityInfo
(
'pprint'
).
declarePublic
(
'pformat'
,
'pprint'
)
ModuleSecurityInfo
(
'Products.ERP5Type.XMLUtils'
).
declarePublic
(
'parseStream'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment