App.get_libname(): Don't use get_proj_refs() #7
1 changed files with 22 additions and 21 deletions
App.__get_project_refs(): Code beautification
In __get_project_refs():
- Rename variable dep and deps to val and vals, respectively, because that's more what they are values of key-value pairs. In some cases that can represent dependencies, in some case other things.- Make a scope case distinction a little clearer by mentioning all possible cases in a match / case blockSigned-off-by: Jan Lindemann <jan@janware.com>
commit
c538447cc5
|
|
@ -188,33 +188,34 @@ class App(Base):
|
||||||
buf.append(spec)
|
buf.append(spec)
|
||||||
return
|
return
|
||||||
visited.add(spec)
|
visited.add(spec)
|
||||||
deps = self.get_value(name, section, key)
|
vals = self.get_value(name, section, key)
|
||||||
log(
|
log(
|
||||||
DEBUG,
|
DEBUG,
|
||||||
(
|
(
|
||||||
f'name={name}, section={section}, key={key}, deps={deps}, '
|
f'name={name}, section={section}, key={key}, deps={vals}, '
|
||||||
f'scope={scope.name}, visited={visited}'
|
f'scope={scope.name}, visited={visited}'
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
if deps and scope != Scope.Self:
|
vals_list = vals.split(',') if vals else []
|
||||||
if scope == Scope.One:
|
match scope:
|
||||||
subscope = Scope.Self
|
case Scope.Self:
|
||||||
else:
|
buf += vals_list
|
||||||
subscope = Scope.Subtree
|
case Scope.One | Scope.Subtree:
|
||||||
for dep in deps.split(','):
|
subscope = scope.Self if scope == Scope.One else scope
|
||||||
dep = dep.strip()
|
for val in vals_list:
|
||||||
if not (len(dep)):
|
val = val.strip()
|
||||||
continue
|
if not (len(val)):
|
||||||
self.__get_project_refs_cached(
|
continue
|
||||||
buf,
|
self.__get_project_refs_cached(
|
||||||
visited,
|
buf,
|
||||||
dep,
|
visited,
|
||||||
section,
|
val,
|
||||||
key,
|
section,
|
||||||
add_self = True,
|
key,
|
||||||
scope = subscope,
|
add_self = True,
|
||||||
names_only = names_only,
|
scope = subscope,
|
||||||
)
|
names_only = names_only,
|
||||||
|
)
|
||||||
if add_self:
|
if add_self:
|
||||||
buf.append(spec)
|
buf.append(spec)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue