mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 03:19:47 +03:00
args.cache: remove (MR 2136)
Replace "args.cache" with a global variable in order to avoid passing "args" to all functions. This is a step to get rid of this args-passed-to-all-functions pattern in pmbootstrap.
This commit is contained in:
parent
f30b1cc3f2
commit
ce0f1c2d4a
23 changed files with 127 additions and 115 deletions
|
@ -109,8 +109,8 @@ def parse_channels_cfg(args):
|
|||
...}} """
|
||||
# Cache during one pmbootstrap run
|
||||
cache_key = "pmb.helpers.git.parse_channels_cfg"
|
||||
if args.cache[cache_key]:
|
||||
return args.cache[cache_key]
|
||||
if pmb.helpers.other.cache[cache_key]:
|
||||
return pmb.helpers.other.cache[cache_key]
|
||||
|
||||
# Read with configparser
|
||||
cfg = configparser.ConfigParser()
|
||||
|
@ -147,7 +147,7 @@ def parse_channels_cfg(args):
|
|||
value = cfg.get(channel, key)
|
||||
ret["channels"][channel_new][key] = value
|
||||
|
||||
args.cache[cache_key] = ret
|
||||
pmb.helpers.other.cache[cache_key] = ret
|
||||
return ret
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue