Author: soliton
Date: Wed May 27 02:18:22 2009
New Revision: 35905

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35905&view=rev
Log:
silence some verbose output

the verbose setting of the WML parser could be turned into an int
for better granularity if wanted

Modified:
    branches/1.6/data/tools/unit_tree/helpers.py
    branches/1.6/data/tools/wesnoth/wmlparser.py

Modified: branches/1.6/data/tools/unit_tree/helpers.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/data/tools/unit_tree/helpers.py?rev=35905&r1=35904&r2=35905&view=diff
==============================================================================
--- branches/1.6/data/tools/unit_tree/helpers.py (original)
+++ branches/1.6/data/tools/unit_tree/helpers.py Wed May 27 02:18:22 2009
@@ -72,6 +72,7 @@
         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(
@@ -140,8 +141,9 @@
             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:

Modified: branches/1.6/data/tools/wesnoth/wmlparser.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/data/tools/wesnoth/wmlparser.py?rev=35905&r1=35904&r2=35905&view=diff
==============================================================================
--- branches/1.6/data/tools/wesnoth/wmlparser.py (original)
+++ branches/1.6/data/tools/wesnoth/wmlparser.py Wed May 27 02:18:22 2009
@@ -508,7 +508,8 @@
             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


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to