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,27 +188,28 @@ class App(Base):
|
|||
buf.append(spec)
|
||||
return
|
||||
visited.add(spec)
|
||||
deps = self.get_value(name, section, key)
|
||||
vals = self.get_value(name, section, key)
|
||||
log(
|
||||
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}'
|
||||
),
|
||||
)
|
||||
if deps and scope != Scope.Self:
|
||||
if scope == Scope.One:
|
||||
subscope = Scope.Self
|
||||
else:
|
||||
subscope = Scope.Subtree
|
||||
for dep in deps.split(','):
|
||||
dep = dep.strip()
|
||||
if not (len(dep)):
|
||||
vals_list = vals.split(',') if vals else []
|
||||
match scope:
|
||||
case Scope.Self:
|
||||
buf += vals_list
|
||||
case Scope.One | Scope.Subtree:
|
||||
subscope = scope.Self if scope == Scope.One else scope
|
||||
for val in vals_list:
|
||||
val = val.strip()
|
||||
if not (len(val)):
|
||||
continue
|
||||
self.__get_project_refs_cached(
|
||||
buf,
|
||||
visited,
|
||||
dep,
|
||||
val,
|
||||
section,
|
||||
key,
|
||||
add_self = True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue