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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikolaï Krol
erp5
Commits
0aa7b0f0
Commit
0aa7b0f0
authored
May 28, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forge: drop "diff" script
this code is invalid and does not seem used
parent
69329a4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
113 deletions
+0
-113
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/diff.py
...p5_forge/SkinTemplateItem/portal_skins/erp5_forge/diff.py
+0
-51
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/diff.xml
...5_forge/SkinTemplateItem/portal_skins/erp5_forge/diff.xml
+0
-62
No files found.
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/diff.py
deleted
100644 → 0
View file @
69329a4f
kw
.
update
(
context
.
REQUEST
.
form
)
def
getObjectFromArg
(
argument
):
"""
Return an object identified by argument.
If argument is a string, assume it's the path to the object.
Otherwise, assume it's the object itself.
"""
if
isinstance
(
argument
,
str
):
return
context
.
restrictedTraverse
(
argument
)
return
argument
kw_value_list
=
kw
.
values
()
kw_len
=
len
(
kw_value_list
)
if
kw_len
==
1
:
object_a
=
context
object_b
=
getObjectFromArg
(
kw_value_list
[
0
])
elif
kw_len
==
2
:
kw_value_list
=
kw
.
values
()
object_a
=
getObjectFromArg
(
kw_value_list
[
0
])
object_b
=
getObjectFromArg
(
kw_value_list
[
1
])
else
:
raise
ValueError
,
'%s is not a valid number of arguments for diff.'
%
(
kw_len
,
)
diff_dict
,
missing_in_a_dict
,
missing_in_b_dict
=
diff_recursive
(
object_a
,
object_b
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html; charset=utf-8'
)
print
'<html>'
print
'<head><title>Diff between %s and %s</title></head>'
%
(
object_a
.
id
,
object_b
.
id
)
print
'<body><pre>'
print
'--- <a href="%s">%s</a>'
%
(
object_a
.
absolute_url
(),
object_a
.
id
)
print
'+++ <a href="%s">%s</a>'
%
(
object_b
.
absolute_url
(),
object_b
.
id
)
print
'</pre><h1>Modified files</h1><ul>'
for
id
,
diff
in
diff_dict
.
items
():
print
'<li><b>%s</b><pre>'
%
(
id
,
)
for
line
in
diff
:
print
line
print
'</pre></li>'
print
'</ul>'
if
len
(
missing_in_a_dict
):
print
'<h1>Objects missing in first object</h1><ul>'
for
id
in
missing_in_a_dict
.
keys
():
print
'<li>%s</li>'
%
(
id
,
)
print
'</ul>'
if
len
(
missing_in_b_dict
):
print
'<h1>Objects missing in second object</h1><ul>'
for
id
in
missing_in_b_dict
.
keys
():
print
'<li>%s</li>'
%
(
id
,
)
print
'</ul>'
print
'</body></html>'
return
printed
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_forge/diff.xml
deleted
100644 → 0
View file @
69329a4f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
diff
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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