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
662eae0c6924
Commit
662eae0c6924
authored
3 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
fix reading other_sources key
parent
085983182fe6
No related branches found
No related tags found
1 merge request
!58
Topic/default/fix other sources
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS.rst
+5
-0
5 additions, 0 deletions
NEWS.rst
odoo_scripts/config.py
+9
-4
9 additions, 4 deletions
odoo_scripts/config.py
with
14 additions
and
4 deletions
NEWS.rst
+
5
−
0
View file @
662eae0c
...
...
@@ -2,6 +2,11 @@
History
=======
11.0.1
------
Fix reading other sources from setup, it was only accepting directories.
11.0.0
------
...
...
This diff is collapsed.
Click to expand it.
odoo_scripts/config.py
+
9
−
4
View file @
662eae0c
...
...
@@ -10,6 +10,7 @@
from
typing
import
List
,
Optional
SECTION
=
"
odoo_scripts
"
OTHER_SOURCES_KEY
=
"
other_sources
"
_logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -106,10 +107,10 @@
self
.
_expanded_configuration
[
name
]
=
Configuration
(
**
value
)
def
set_from_glob_values
(
base
:
Optional
[
str
],
glob_values
:
List
[
str
]
base
:
Optional
[
str
],
glob_values
:
List
[
str
]
,
only_directories
:
bool
)
->
set
:
result_set
=
set
()
for
glob_value
in
glob_values
:
if
base
:
glob_value
=
os
.
path
.
join
(
base
,
glob_value
)
for
file
in
glob
(
glob_value
):
...
...
@@ -110,10 +111,10 @@
)
->
set
:
result_set
=
set
()
for
glob_value
in
glob_values
:
if
base
:
glob_value
=
os
.
path
.
join
(
base
,
glob_value
)
for
file
in
glob
(
glob_value
):
if
os
.
path
.
isdir
(
file
):
if
not
only_directories
or
os
.
path
.
isdir
(
file
):
result_set
.
add
(
file
)
return
result_set
...
...
@@ -124,7 +125,7 @@
return
True
# those keys are path to files (glob compatible)
for
key
in
(
"
modules
"
,
"
dependencies
"
,
"
other_sources
"
):
for
key
in
(
"
modules
"
,
"
dependencies
"
,
OTHER_SOURCES_KEY
):
set_values
=
set
()
if
toread
(
key
):
# add any expanded values
...
...
@@ -133,7 +134,11 @@
# get the values from this configuration
values
=
section
.
get
(
key
,
""
).
split
()
# XXX eventually add option to not include path
set_values
.
update
(
set_from_glob_values
(
path
,
values
))
set_values
.
update
(
set_from_glob_values
(
path
,
values
,
key
!=
OTHER_SOURCES_KEY
)
)
setattr
(
self
,
key
,
list
(
set_values
))
def
key_format
(
a_key
:
str
)
->
str
:
...
...
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