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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
66cfe1e0
Commit
66cfe1e0
authored
Jun 21, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
administration: output md5sum of skin content in ERP5Site_dumpPortalSkinsContent
parent
57c4d812
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
4 deletions
+37
-4
bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/ERP5Site_dumpPortalSkinsContent.py
...ns/erp5_administration/ERP5Site_dumpPortalSkinsContent.py
+36
-3
bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/ERP5Site_dumpPortalSkinsContent.xml
...s/erp5_administration/ERP5Site_dumpPortalSkinsContent.xml
+1
-1
No files found.
bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/ERP5Site_dumpPortalSkinsContent.py
View file @
66cfe1e0
for
skin_folder
in
context
.
getPortalObject
().
portal_skins
.
objectValues
(
'Folder'
):
import
hashlib
portal
=
context
.
getPortalObject
()
def
getSkinHash
(
skin
,
skin_container
):
content
=
''
if
skin
.
meta_type
in
(
'Script (Python)'
,
'Z SQL Method'
,
):
content
=
skin
.
document_src
()
elif
skin
.
meta_type
in
(
'File'
,
):
content
=
str
(
skin
.
data
)
elif
skin
.
meta_type
in
(
'ERP5 Form'
,
):
try
:
content
=
skin
.
formXML
()
if
isinstance
(
content
,
unicode
):
content
=
content
.
encode
(
'utf8'
,
'repr'
)
except
AttributeError
,
e
:
# This can happen with dead proxy fields.
content
=
"broken form %s"
%
e
content
=
'ignore'
m
=
hashlib
.
md5
()
m
.
update
(
content
)
content_hash
=
m
.
hexdigest
()
return
";"
.
join
((
skin_container
.
getId
(),
skin
.
getId
(),
skin
.
meta_type
,
content_hash
))
for
skin_folder
in
portal
.
portal_skins
.
objectValues
(
'Folder'
):
if
ignore_custom
and
skin_folder
.
getId
()
==
'custom'
:
continue
for
skin
in
skin_folder
.
objectValues
():
for
skin
in
skin_folder
.
objectValues
():
print
";"
.
join
((
skin_folder
.
getId
(),
skin
.
getId
(),
skin
.
meta_type
))
print
getSkinHash
(
skin
,
skin_folder
)
if
include_workflow_scripts
:
for
workflow
in
portal
.
portal_workflow
.
objectValues
():
for
skin
in
workflow
.
scripts
.
objectValues
():
print
getSkinHash
(
skin
,
workflow
)
container
.
REQUEST
.
RESPONSE
.
setHeader
(
'content-type'
,
'text/plain'
)
return
'
\
n
'
.
join
(
sorted
(
printed
.
splitlines
()))
return
'
\
n
'
.
join
(
sorted
(
printed
.
splitlines
()))
bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/ERP5Site_dumpPortalSkinsContent.xml
View file @
66cfe1e0
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
ignore_custom=True, include_workflow_scripts=True
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
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