fixed debug outputs

This commit is contained in:
Marcus Stoegbauer 2024-03-29 23:36:16 +01:00
parent d747df7aa4
commit 16020e8fbb

View File

@ -22,34 +22,34 @@ def main():
cfg.set_debug(debug) cfg.set_debug(debug)
uc = Userconfig(cfg) uc = Userconfig(cfg)
cfg.debug(f"Verbose level is {cfg.debug.get_verbose()}", 1) cfg.debug.stdout(f"Verbose level is {cfg.debug.get_verbose()}", 1)
cfg.debug("================ main ===============", 1) cfg.debug.stdout("================ main ===============", 1)
temp_classes = "" temp_classes = ""
for h in classes_for_host(): for h in classes_for_host():
temp_classes = temp_classes + str(h) + "," temp_classes = temp_classes + str(h) + ","
cfg.debug("+++ Current host is in classes %s" % temp_classes, 1) cfg.debug.stdout("+++ Current host is in classes %s" % temp_classes, 1)
configdir = cfg.get("configdir") configdir = cfg.get("configdir")
for d in os.listdir(configdir): for d in os.listdir(configdir):
name = configdir+"/"+d name = configdir+"/"+d
cfg.debug("+++ Working in %s" % name, 1) cfg.debug.stdout("+++ Working in %s" % name, 1)
if not os.path.isdir(name): if not os.path.isdir(name):
cfg.debug("--- %s is not a directory, skipping." % name, 3) cfg.debug.stdout("--- %s is not a directory, skipping." % name, 3)
continue continue
elif d.startswith(".svn") or d.startswith(".git"): elif d.startswith(".svn") or d.startswith(".git"):
cfg.debug("--- %s is .svn or .git, skipping." % name, 3) cfg.debug.stdout("--- %s is .svn or .git, skipping." % name, 3)
continue continue
elif os.path.isfile(name+"/.ignore"): elif os.path.isfile(name+"/.ignore"):
cfg.debug("--- %s contains file .ignore, skipping." % name, 3) cfg.debug.stdout("--- %s contains file .ignore, skipping." % name, 3)
continue continue
else: else:
cfg.debug("+++ Processing files in %s" % name, 2) cfg.debug.stdout("+++ Processing files in %s" % name, 2)
(destfiles, dirConfig) = uc.workdir(name) (destfiles, dirConfig) = uc.workdir(name)
if isinstance(destfiles, dict): if isinstance(destfiles, dict):
if len(destfiles.keys()) > 0: if len(destfiles.keys()) > 0:
cfg.debug("+++ Building %d files: %s" % (len(destfiles.keys()), destfiles.keys()), 3) cfg.debug.stdout("+++ Building %d files: %s" % (len(destfiles.keys()), destfiles.keys()), 3)
uc.process_all_files(destfiles, dirConfig) uc.process_all_files(destfiles, dirConfig)
else: else:
cfg.debug("--- No files found for %s, skipping." % name, 1) cfg.debug.stdout("--- No files found for %s, skipping." % name, 1)
if __name__ == '__main__': if __name__ == '__main__':