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
Yusei Tahara
erp5
Commits
581bdde6
Commit
581bdde6
authored
Jun 01, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Sort before exporting or building BM
parent
e1133f21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
12 deletions
+56
-12
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+56
-12
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
581bdde6
...
...
@@ -752,14 +752,6 @@ class TemplateTool (BaseTool):
removable_property
=
{}
removable_sub_object_path
=
[]
# For catalog method, add paths
template_catalog_method_id_list
=
import_template
.
getTemplateCatalogMethodIdList
()
catalog_method_path_list
=
[]
for
method_id
in
template_catalog_method_id_list
:
method_path
=
'portal_catalog/%s | 1 | 1'
%
method_id
catalog_method_path_list
.
append
(
method_path
)
template_path_list
.
extend
(
catalog_method_path_list
)
if
is_property_added
:
if
catalog_method_path_list
:
catalog_path
=
catalog_method_path_list
[
0
].
rsplit
(
'/'
,
1
)[
0
]
...
...
@@ -793,6 +785,7 @@ class TemplateTool (BaseTool):
template_path_list
.
extend
(
property_path_list
)
template_path_list
.
extend
(
selection_list
)
template_path_list
=
self
.
cleanTemplatePathList
(
template_path_list
)
template_path_list
=
self
.
sortPathList
(
template_path_list
)
migrated_bm
.
setProperty
(
'template_path_list'
,
template_path_list
)
kw
[
'removable_property'
]
=
removable_property
...
...
@@ -828,9 +821,11 @@ class TemplateTool (BaseTool):
# Join the path list
a2
=
[(
'/'
).
join
(
l
)
for
l
in
a2
]
# Remove the redundant paths
a2
=
list
(
set
(
a2
))
seen
=
set
()
seen_add
=
seen
.
add
a2
=
[
x
for
x
in
a2
if
not
(
x
in
seen
or
seen_add
(
x
))]
# Sort the path list
a2
.
sort
()
#
a2.sort()
# Add the layer and signs, for now all 1
a2
=
[
l
+
' | 1 | 1'
for
l
in
a2
]
...
...
@@ -1007,7 +1002,7 @@ class TemplateTool (BaseTool):
f
.
close
()
#XXX: Hardcoding 'erp5_core_proxy_field_legacy' BP in the list
bp_dict
=
{
bp_dict
_1
=
{
'copyright_list'
:
[
'Copyright (c) 2001-2017 Nexedi SA'
],
'dependency_list'
:
[],
'description'
:
''
,
...
...
@@ -1019,8 +1014,24 @@ class TemplateTool (BaseTool):
'provision_list'
:
[],
'title'
:
'erp5_core_proxy_field_legacy'
,
'version'
:
'1.0'
}
bp_dict_2
=
{
'copyright_list'
:
[
'Copyright (c) 2001-2017 Nexedi SA'
],
'dependency_list'
:
[
'erp5_base >= 0.8.3'
,
'erp5_core >= 1.0rc13'
],
'description'
:
''
,
'force_install'
:
0
,
'id'
:
'erp5_accounting'
,
'license'
:
'GPL'
,
'revision'
:
''
,
'test_dependency_list'
:
[],
'provision_list'
:
[],
'title'
:
'erp5_accounting'
,
'version'
:
'1.0'
}
if
repository
.
endswith
(
'/bt5'
):
property_dict_list
.
append
(
bp_dict
)
property_dict_list
.
append
(
bp_dict_1
)
#property_dict_list.append(bp_dict_2)
bm_dict_1
=
{
'copyright_list'
:
[
'Copyright (c) 2001-2017 Nexedi SA'
],
...
...
@@ -1074,11 +1085,25 @@ class TemplateTool (BaseTool):
'title'
:
'erp5_jquery'
,
'version'
:
'1.0'
}
bm_dict_5
=
{
'copyright_list'
:
[
'Copyright (c) 2001-2017 Nexedi SA'
],
'dependency_list'
:
[],
'description'
:
''
,
'force_install'
:
0
,
'id'
:
'erp5_property_sheets'
,
'license'
:
'GPL'
,
'revision'
:
''
,
'test_dependency_list'
:
[],
'provision_list'
:
[],
'title'
:
'erp5_property_sheets'
,
'version'
:
'1.0'
}
if
repository
.
endswith
(
'/bootstrap'
):
property_dict_list
.
append
(
bm_dict_1
)
property_dict_list
.
append
(
bm_dict_2
)
property_dict_list
.
append
(
bm_dict_3
)
property_dict_list
.
append
(
bm_dict_4
)
#property_dict_list.append(bm_dict_5)
self
.
repository_dict
[
repository
]
=
tuple
(
property_dict_list
)
...
...
@@ -1809,6 +1834,7 @@ class TemplateTool (BaseTool):
6. If conflict while comaprison at 3, raise the error
7. In all other case, install the BM List
"""
# Create old installation state from Installed Business Manager
installed_bm_list
=
self
.
getInstalledBusinessManagerList
()
combined_installed_path_item
=
[
item
for
bm
...
...
@@ -1984,6 +2010,22 @@ class TemplateTool (BaseTool):
obj_sha
=
hash
(
pprint
.
pformat
(
obj_dict
))
return
obj_sha
def
sortPathList
(
self
,
path_list
):
"""
Custom sort for path_list according to the priorities of paths
"""
def
comparePath
(
path
):
if
len
(
path
.
split
(
'/'
))
==
1
:
return
10
elif
len
(
path
.
split
(
'/'
))
>
2
:
return
9
elif
path
.
split
(
'/'
)[
0
]
in
(
'portal_types'
,
'portal_categories'
):
return
-
10
else
:
return
0
return
sorted
(
path_list
,
key
=
comparePath
)
def
compareOldStateToOFS
(
self
,
installation_process
,
old_state
):
# Get the paths about which we are concerned about
...
...
@@ -1992,6 +2034,8 @@ class TemplateTool (BaseTool):
error_list
=
[]
to_update_path_list
=
self
.
sortPathList
(
to_update_path_list
)
for
path
in
to_update_path_list
:
try
:
if
'#'
in
str
(
path
):
...
...
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