Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
1062ce4e
Commit
1062ce4e
authored
3 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
fix nested blacklisting
parent
2aaac044
No related branches found
No related tags found
1 merge request
!41
Topic/default/allow nesting blacklisting
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS.rst
+6
-1
6 additions, 1 deletion
NEWS.rst
odoo_scripts/config.py
+25
-2
25 additions, 2 deletions
odoo_scripts/config.py
with
31 additions
and
3 deletions
NEWS.rst
+
6
−
1
View file @
1062ce4e
...
...
@@ -2,6 +2,11 @@
History
=======
8.0.1
-----
Fix nested blacklisting.
8.0.0
-----
...
...
@@ -11,7 +16,7 @@
import_* follow symlinks.
✨ allow nested blacklistin:
✨ allow nested blacklistin
g
:
For example, allow ignoring odoo-mint/theme when expanding odoo-mint-hr.
🔨 Change list_modules command to output in the console when used.
...
...
This diff is collapsed.
Click to expand it.
odoo_scripts/config.py
+
25
−
2
View file @
1062ce4e
...
...
@@ -32,6 +32,10 @@
"""
def
__init__
(
self
,
path
:
str
=
None
,
blacklist
:
str
=
None
,
read
:
str
=
None
self
,
path
:
str
=
None
,
blacklist
:
str
=
None
,
read
:
str
=
None
,
parent_configuration
=
None
,
):
self
.
_expanded_configuration
=
dict
()
...
...
@@ -36,5 +40,6 @@
):
self
.
_expanded_configuration
=
dict
()
self
.
path
=
path
setup_path
=
"
setup.cfg
"
if
path
:
setup_path
=
os
.
path
.
join
(
path
,
setup_path
)
...
...
@@ -57,7 +62,8 @@
]
=
section
.
get
(
key
)
for
name
,
value
in
expanded_info
.
items
():
value
[
"
parent_configuration
"
]
=
self
if
"
path
"
not
in
value
:
_logger
.
error
(
"
Expansion without path for %s
"
,
name
)
raise
Exception
(
"
Expansion without path for %s
"
%
name
)
else
:
...
...
@@ -60,8 +66,25 @@
if
"
path
"
not
in
value
:
_logger
.
error
(
"
Expansion without path for %s
"
,
name
)
raise
Exception
(
"
Expansion without path for %s
"
%
name
)
else
:
if
blacklist
and
re
.
match
(
blacklist
,
value
[
"
path
"
]):
# put in relative_path the relative path between this and the
# parent.
# this allows blacklisting odoo-mint/theme when expanding
# mint hr.
if
parent_configuration
:
# difference between this path and the parents
relative_path
=
os
.
path
.
join
(
os
.
path
.
relpath
(
path
,
parent_configuration
.
path
if
parent_configuration
.
path
else
""
,
),
value
[
"
path
"
],
)
else
:
relative_path
=
value
[
"
path
"
]
if
blacklist
and
re
.
match
(
blacklist
,
relative_path
):
_logger
.
info
(
"
Ignoring directory
'
%s
'
due to blacklisting
"
,
os
.
path
.
join
(
path
,
value
[
"
path
"
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment