tools/mpp: extract vars initialization
Move the initialization for manifest vars out of `__init__`.
This commit is contained in:
parent
4c3c7d7851
commit
fdb0faca86
1 changed files with 9 additions and 3 deletions
|
|
@ -538,9 +538,15 @@ class ManifestFile:
|
|||
self.source_urls = {}
|
||||
|
||||
self.vars = {}
|
||||
if "mpp-vars" in root:
|
||||
self.vars = root["mpp-vars"]
|
||||
del root["mpp-vars"]
|
||||
self.init_vars()
|
||||
|
||||
def init_vars(self):
|
||||
variables = self.root.get("mpp-vars")
|
||||
if not variables:
|
||||
return
|
||||
|
||||
self.vars.update(variables)
|
||||
del self.root["mpp-vars"]
|
||||
|
||||
def set_vars(self, args):
|
||||
for arg in args:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue