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
Merge requests
!41
Topic/default/allow nesting blacklisting
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Topic/default/allow nesting blacklisting
topic/default/allow-nesting-blacklisting
into
branch/default
Overview
0
Commits
3
Pipelines
0
Changes
2
Merged
Vincent Hatakeyama
requested to merge
topic/default/allow-nesting-blacklisting
into
branch/default
3 years ago
Overview
0
Commits
3
Pipelines
0
Changes
2
Expand
TG-214
Edited
3 years ago
by
Vincent Hatakeyama
0
0
Merge request reports
Viewing commit
1062ce4e
Prev
Next
Show latest version
2 files
+
31
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
1062ce4e
fix nested blacklisting
· 1062ce4e
Vincent Hatakeyama
authored
3 years ago
odoo_scripts/config.py
+
25
−
2
Options
@@ -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
"
])
Loading