From 35878952acacf903e5baae2a6605a2e1bde2305d Mon Sep 17 00:00:00 2001
From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl>
Date: Tue, 10 Jan 2017 03:54:45 +0100
Subject: [PATCH] prints removed

---
 coolamqp/attaches/agroup.py                      |  2 --
 coolamqp/attaches/channeler.py                   |  1 -
 coolamqp/attaches/publisher.py                   |  3 ---
 coolamqp/attaches/utils.py                       |  2 --
 coolamqp/framing/compilation/content_property.py |  2 +-
 coolamqp/uplink/connection/connection.py         | 11 +----------
 coolamqp/uplink/handshake.py                     |  1 -
 coolamqp/uplink/listener/socket.py               |  1 -
 8 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/coolamqp/attaches/agroup.py b/coolamqp/attaches/agroup.py
index 2e3f344..3ccc032 100644
--- a/coolamqp/attaches/agroup.py
+++ b/coolamqp/attaches/agroup.py
@@ -65,10 +65,8 @@ class AttacheGroup(Attache):
 
         for attache in self.attaches:
             if not attache.cancelled:
-                print('Attaching', attache)
                 attache.attach(connection)
             else:
-                print('lol wut')
                 raise Exception
 
 
diff --git a/coolamqp/attaches/channeler.py b/coolamqp/attaches/channeler.py
index a892b75..74fb96d 100644
--- a/coolamqp/attaches/channeler.py
+++ b/coolamqp/attaches/channeler.py
@@ -138,7 +138,6 @@ class Channeler(Attache):
 
         self.connection = None
         self.channel_id = None
-        print(self, 'pwned with', payload)
 
         if isinstance(payload, ChannelClose):
             logger.debug('Channel closed: %s %s', payload.reply_code, payload.reply_text)
diff --git a/coolamqp/attaches/publisher.py b/coolamqp/attaches/publisher.py
index 147df0f..5266e2e 100644
--- a/coolamqp/attaches/publisher.py
+++ b/coolamqp/attaches/publisher.py
@@ -98,7 +98,6 @@ class Publisher(Channeler, Synchronized):
     @Synchronized.synchronized
     def on_fail(self):
         self.state = ST_OFFLINE
-        print('Publisher is FAILED')
 
     def _pub(self, message, exchange_name, routing_key):
         """
@@ -156,8 +155,6 @@ class Publisher(Channeler, Synchronized):
         """
         assert self.mode == Publisher.MODE_CNPUB
 
-        print('Got %s with dt=%s' % (payload, payload.delivery_tag))
-
         if isinstance(payload, BasicAck):
             self.tagger.ack(payload.delivery_tag, payload.multiple)
         elif isinstance(payload, BasicNack):
diff --git a/coolamqp/attaches/utils.py b/coolamqp/attaches/utils.py
index 9989ca7..74d0aaa 100644
--- a/coolamqp/attaches/utils.py
+++ b/coolamqp/attaches/utils.py
@@ -155,8 +155,6 @@ class AtomicTagger(object):
                 # Oh, I know the range!
                 stop = len(self.tags)
 
-            print('Range computed of %s:%s' % (start, stop))
-
             items = self.tags[start:stop]
             del self.tags[start:stop]
 
diff --git a/coolamqp/framing/compilation/content_property.py b/coolamqp/framing/compilation/content_property.py
index 73732e4..9551695 100644
--- a/coolamqp/framing/compilation/content_property.py
+++ b/coolamqp/framing/compilation/content_property.py
@@ -89,7 +89,7 @@ def _compile_particular_content_property_list_class(zpf, fields):
     mod.append(u'\n    def write_to(self, buf):\n')
     mod.append(u'        buf.write(')
     repred_zpf = repr(zpf)
-    if not zpf.startswith('b'):
+    if not zpf.startswith(b'b'):
         repred_zpf = 'b' + repred_zpf
     mod.append(repred_zpf)
     mod.append(u')\n')
diff --git a/coolamqp/uplink/connection/connection.py b/coolamqp/uplink/connection/connection.py
index 4268042..98aa3e7 100644
--- a/coolamqp/uplink/connection/connection.py
+++ b/coolamqp/uplink/connection/connection.py
@@ -84,7 +84,6 @@ class Connection(object):
 
     def on_connected(self):
         """Called by handshaker upon reception of final connection.open-ok"""
-        print(self.free_channels)
         self.state = ST_ONLINE
 
         while len(self.callables_on_connected) > 0:
@@ -104,7 +103,6 @@ class Connection(object):
             try:
                 sock.connect((self.node_definition.host, self.node_definition.port))
             except socket.error as e:
-                print(e)
                 time.sleep(0.5) # Connection refused? Very bad things?
             else:
                 break
@@ -170,11 +168,9 @@ class Connection(object):
 
         Called by ListenerThread.
         """
-        print('We are GOING DOOOWN')
         self.on_fail()      # it does not make sense to prolong the agony
 
         if isinstance(payload, ConnectionClose):
-            print(payload.reply_code, payload.reply_text)
             self.send([AMQPMethodFrame(0, ConnectionCloseOk())])
         elif isinstance(payload, ConnectionCloseOk):
             self.send(None)
@@ -206,11 +202,6 @@ class Connection(object):
 
         :param frame: AMQPFrame that was received
         """
-        if isinstance(frame, AMQPMethodFrame):      # temporary, for debugging
-            print('RECEIVED', frame.payload.NAME)
-        else:
-            print('RECEIVED ', frame)
-
         watch_handled = False   # True if ANY watch handled this
 
         # ==================== process per-channel watches
@@ -249,7 +240,7 @@ class Connection(object):
             self.any_watches.append(watch)
 
         if not watch_handled:
-            logger.critical('Unhandled frame %s', frame)
+            logger.warn('Unhandled frame %s', frame)
 
     def watchdog(self, delay, callback):
         """
diff --git a/coolamqp/uplink/handshake.py b/coolamqp/uplink/handshake.py
index 4c8bf1e..18edb52 100644
--- a/coolamqp/uplink/handshake.py
+++ b/coolamqp/uplink/handshake.py
@@ -94,7 +94,6 @@ class Handshaker(object):
     def on_connection_tune(self, payload):
         self.connection.frame_max = payload.frame_max
         self.connection.heartbeat = min(payload.heartbeat, self.heartbeat)
-        print('Selected', payload.channel_max, 'channels')
         for channel in six.moves.xrange(1, (65535 if payload.channel_max == 0 else payload.channel_max)+1):
             self.connection.free_channels.append(channel)
 
diff --git a/coolamqp/uplink/listener/socket.py b/coolamqp/uplink/listener/socket.py
index ffd5637..e2fd2a8 100644
--- a/coolamqp/uplink/listener/socket.py
+++ b/coolamqp/uplink/listener/socket.py
@@ -133,7 +133,6 @@ class BaseSocket(object):
 
                 if len(self.priority_queue) > 0:
                     # We can send a priority pack
-                    print('Deploying priority data')
                     self.data_to_send.appendleft(self.priority_queue.popleft())
 
     def fileno(self):
-- 
GitLab