import groundstation.proto.channel_list_pb2

from groundstation import logger
log = logger.getLogger(__name__)


def handle_listallchannels(self):
    log.info("Handling LISTALLCHANNELS")
    payload = self.station.channels()
    log.info("Sending %i object descriptions" % (len(payload)))
    chunk = groundstation.proto.channel_list_pb2.ChannelList()
    for channel in payload:
        description = chunk.channels.add()
        grefs = self.station.grefs(channel)
        for gref in grefs:
            _gref = description.grefs.add()
            _gref.name = gref.identifier
            for tip in gref:
                _tip = _gref.tips.add()
                _tip.tip = tip
    response = self._Response(self.id, "DESCRIBECHANNELS",
            chunk.SerializeToString())
    self.stream.enqueue(response)
    self.TERMINATE()

@@ -374,16 +374,73 @@
 ayload:%0A
+        log.debug(%22serializing channel: %25s%22 %25 (channel))%0A
         
@@ -466,32 +466,32 @@
 .channels.add()%0A
-
         grefs = 
@@ -545,16 +545,73 @@
  grefs:%0A
+            log.debug(%22- serializing gref: %25s%22 %25 (gref))%0A
         
@@ -687,16 +687,16 @@
 ntifier%0A
-
         
@@ -716,16 +716,76 @@
 n gref:%0A
+                log.debug(%22-- serializing tip: %25s%22 %25 (tip))%0A
         

Add some debugging to listallchannels