mail[Wesnoth-commits] r29061 - /trunk/data/tools/wesnoth/campaignserver_client.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by elias on August 28, 2008 - 19:44:
Author: elias
Date: Thu Aug 28 19:44:34 2008
New Revision: 29061

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29061&view=rev
Log:
Removed debug code I left in wesnoth_addon_manager before.

Modified:
    trunk/data/tools/wesnoth/campaignserver_client.py

Modified: trunk/data/tools/wesnoth/campaignserver_client.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/campaignserver_client.py?rev=29061&r1=29060&r2=29061&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/campaignserver_client.py (original)
+++ trunk/data/tools/wesnoth/campaignserver_client.py Thu Aug 28 19:44:34 2008
@@ -31,6 +31,7 @@
         self.name = None
         self.args = None
         self.cs = None
+        self.verbose = False
 
         if address != None:
             s = address.split(":")
@@ -126,31 +127,30 @@
         if self.canceled:
             return None
         
-        global dumpi
-        dumpi += 1
-        open("dump%d" % dumpi, "wb").write(packet)
-
         if packet.startswith("\x1F\x8B"):
-            sys.stderr.write("GZIP compression found...\n")
+            if self.verbose:
+                sys.stderr.write("GZIP compression found...\n")
             io = StringIO.StringIO(packet)
             z = gzip.GzipFile(fileobj = io)
             unzip = z.read()
             z.close()
-            print len(unzip)
             packet = unzip
 
         elif packet.startswith( '\x78\x9C' ):
-            sys.stderr.write("ZLIB compression found...\n")
+            if self.verbose:
+                sys.stderr.write("ZLIB compression found...\n")
             packet = zlib.decompres( packet )
 
         return packet
 
     def decode( self, data ):
         if self.isBWML(data):
-            sys.stderr.write("Decoding binary WML...\n")
+            if self.verbose:
+                sys.stderr.write("Decoding binary WML...\n")
             data = self.decode_BWML( data )
         else:
-            sys.stderr.write("Decoding text WML...\n")
+            if self.verbose:
+                sys.stderr.write("Decoding text WML...\n")
             data = self.decode_WML( data )
 
         return data




Related Messages


Powered by MHonArc, Updated Thu Aug 28 20:02:00 2008