jw.pkg.App: Remove .debug() and friends
Replace the jw.pkg.App.debug(), .warn() and .err() methods by the global log() function. There's no obvious benefit in having App know what's logged.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
aefe983920
commit
95fa2f0d06
8 changed files with 39 additions and 41 deletions
|
|
@ -3,6 +3,7 @@
|
|||
import os, re, sys, subprocess, datetime, time
|
||||
from argparse import Namespace, ArgumentParser
|
||||
|
||||
from ...lib.log import *
|
||||
from ..Cmd import Cmd
|
||||
|
||||
class CmdBuild(Cmd): # export
|
||||
|
|
@ -34,10 +35,10 @@ class CmdBuild(Cmd): # export
|
|||
|
||||
r = self.app.get_modules_from_project_txt([ cur ], ['pkg.requires.jw'],
|
||||
prereq_type, scope = 2, add_self=False, names_only=True)
|
||||
self.app.debug('prerequisites = ' + ' '.join(r))
|
||||
log(DEBUG, 'prerequisites = ' + ' '.join(r))
|
||||
if cur in r:
|
||||
r.remove(cur)
|
||||
self.app.debug('inserting', prereq_type, "prerequisites of", cur, ":", ' '.join(r))
|
||||
log(DEBUG, 'inserting', prereq_type, "prerequisites of", cur, ":", ' '.join(r))
|
||||
self.app.dep_cache[prereq_type][cur] = r
|
||||
return r
|
||||
|
||||
|
|
@ -45,14 +46,14 @@ class CmdBuild(Cmd): # export
|
|||
return self.app.res_cache.run(read_deps, [ cur, prereq_type ])
|
||||
|
||||
def add_dep_tree(cur, prereq_types, tree, all_deps):
|
||||
self.app.debug("adding prerequisites " + ' '.join(prereq_types) + " of module " + cur)
|
||||
log(DEBUG, "adding prerequisites " + ' '.join(prereq_types) + " of module " + cur)
|
||||
if cur in all_deps:
|
||||
self.app.debug('already handled module ' + cur)
|
||||
log(DEBUG, 'already handled module ' + cur)
|
||||
return 0
|
||||
deps = set()
|
||||
all_deps.add(cur)
|
||||
for t in prereq_types:
|
||||
self.app.debug("checking prereqisites of type " + t)
|
||||
log(DEBUG, "checking prereqisites of type " + t)
|
||||
deps.update(read_deps_cached(cur, t))
|
||||
for d in deps:
|
||||
add_dep_tree(d, prereq_types, tree, all_deps)
|
||||
|
|
@ -63,7 +64,7 @@ class CmdBuild(Cmd): # export
|
|||
all_deps = set()
|
||||
dep_tree = {}
|
||||
for m in modules:
|
||||
self.app.debug("--- adding dependency tree of module " + m)
|
||||
log(DEBUG, "--- adding dependency tree of module " + m)
|
||||
add_dep_tree(m, prereq_types, dep_tree, all_deps)
|
||||
while len(all_deps):
|
||||
# Find any leaf
|
||||
|
|
@ -128,7 +129,7 @@ class CmdBuild(Cmd): # export
|
|||
|
||||
def run(args):
|
||||
|
||||
self.app.debug("----------------------------------------- running ", ' '.join(sys.argv))
|
||||
log(DEBUG, "----------------------------------------- running ", ' '.join(sys.argv))
|
||||
|
||||
modules = args.modules
|
||||
exclude = args.exclude.split()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue