silence some verbose output

the verbose setting of the WML parser could be turned into an int
for better granularity if wanted
This commit is contained in:
Gunter Labes 2009-05-27 00:19:14 +00:00
parent c5c513df80
commit 52bc5141cd
2 changed files with 6 additions and 3 deletions

View file

@ -67,6 +67,7 @@ class ImageCollector:
self.datadir = datadir
self.userdir = userdir
self.id = 0
self.verbose = 0
def add_binary_pathes_from_WML(self, campaign, WML):
self.pathes_per_campaign[campaign] = self.pathes_per_campaign.get(
@ -135,8 +136,9 @@ class ImageCollector:
else:
sys.stderr.write(
"Warning: Required image %s: \"%s\" does not exist.\n" % (c, i))
sys.stderr.write("Warning: Looked at the following locations:\n")
sys.stderr.write("\n".join(bases) + "\n")
if self.verbose:
sys.stderr.write("Warning: Looked at the following locations:\n")
sys.stderr.write("\n".join(bases) + "\n")
blah = 1
class WesnothList:

View file

@ -496,7 +496,8 @@ class Parser:
if self.macro_not_found_callback:
keep_macro = self.macro_not_found_callback(self, name, params)
if keep_macro: return keep_macro
sys.stderr.write("No macro %s.\n" % name.encode("utf8"))
if self.verbose:
sys.stderr.write("No macro %s.\n" % name.encode("utf8"))
if self.verbose:
sys.stderr.write(" (%s:%d)\n" % (self.filename, self.line))
return name