Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Sebastien Robin
slapos
Commits
84afd096
Commit
84afd096
authored
Jul 26, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Set() instead lists to simplify the code.
parent
799fe78e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
slapos/recipe/erp5/erp5.py
slapos/recipe/erp5/erp5.py
+5
-8
No files found.
slapos/recipe/erp5/erp5.py
View file @
84afd096
...
...
@@ -147,14 +147,12 @@ class ERP5Updater(object):
return
[
i
for
i
in
self
.
business_template_repository_list
if
i
not
in
found_list
]
def
getMissingBusinessTemplateList
(
self
):
bt5_dict
=
self
.
getSystemSignatureDict
(
"business_template_dict"
,
{})
found_bt5_list
=
bt5_dict
.
keys
()
return
[
bt
for
bt
in
self
.
business_template_list
\
if
bt
not
in
found_bt5_list
]
def
getMissingBusinessTemplateSet
(
self
):
found_dict
=
self
.
getSystemSignatureDict
(
"business_template_dict"
,
{})
return
set
(
self
.
business_template_list
).
difference
(
found_dict
)
def
isBusinessTemplateUpdated
(
self
):
return
len
(
self
.
getMissingBusinessTemplate
Lis
t
())
==
0
return
len
(
self
.
getMissingBusinessTemplate
Se
t
())
==
0
def
isBusinessTemplateRepositoryUpdated
(
self
):
return
len
(
self
.
getMissingBusinessTemplateRepositoryList
())
==
0
...
...
@@ -173,8 +171,7 @@ class ERP5Updater(object):
self
.
_setRepositoryList
(
repository_list
)
# Require to update Business template
for
bt
in
self
.
getMissingBusinessTemplateList
():
self
.
_installBusinessTemplateList
([
bt
])
self
.
_installBusinessTemplateList
(
list
(
self
.
getMissingBusinessTemplateSet
()))
return
True
return
False
...
...
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