mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 09:35:54 +02:00
CmdBuild: Don't use App.dep_cache
App.dep_cache is only used by CmdBuild, prepare for removing it from App. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
95fa2f0d06
commit
eafed6434b
1 changed files with 13 additions and 11 deletions
|
|
@ -27,20 +27,20 @@ class CmdBuild(Cmd): # export
|
|||
|
||||
def read_deps(cur, prereq_type):
|
||||
# dep cache doesn't make a difference at all
|
||||
if prereq_type in self.app.dep_cache:
|
||||
if cur in self.app.dep_cache[prereq_type]:
|
||||
return self.app.dep_cache[prereq_type][cur]
|
||||
if prereq_type in dep_cache:
|
||||
if cur in dep_cache[prereq_type]:
|
||||
return dep_cache[prereq_type][cur]
|
||||
else:
|
||||
self.app.dep_cache[prereq_type] = {}
|
||||
dep_cache[prereq_type]: dict[str, str] = {}
|
||||
|
||||
r = self.app.get_modules_from_project_txt([ cur ], ['pkg.requires.jw'],
|
||||
ret = self.app.get_modules_from_project_txt([ cur ], ['pkg.requires.jw'],
|
||||
prereq_type, scope = 2, add_self=False, names_only=True)
|
||||
log(DEBUG, 'prerequisites = ' + ' '.join(r))
|
||||
if cur in r:
|
||||
r.remove(cur)
|
||||
log(DEBUG, 'inserting', prereq_type, "prerequisites of", cur, ":", ' '.join(r))
|
||||
self.app.dep_cache[prereq_type][cur] = r
|
||||
return r
|
||||
log(DEBUG, 'prerequisites = ' + ' '.join(ret))
|
||||
if cur in ret:
|
||||
ret.remove(cur)
|
||||
log(DEBUG, 'inserting', prereq_type, "prerequisites of", cur, ":", ' '.join(ret))
|
||||
dep_cache[prereq_type][cur] = ret
|
||||
return ret
|
||||
|
||||
def read_deps_cached(cur, prereq_type):
|
||||
return self.app.res_cache.run(read_deps, [ cur, prereq_type ])
|
||||
|
|
@ -172,4 +172,6 @@ class CmdBuild(Cmd): # export
|
|||
|
||||
print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
||||
|
||||
dep_cache: dict[dict[str, str]] = {}
|
||||
|
||||
run(args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue