# Path: groundstation/logger.py
#     LEVEL = getattr(logging, os.getenv("GROUNDSTATION_DEBUG"))
#     LEVEL = logging.DEBUG
# CONSOLE_FORMATTER = _get_formatter()
# CONSOLE_HANDLER = _get_console_handler()
# LOGGERS = {}  # Cache for instanciated loggers
# def fix_oid(oid):
# def _get_formatter():
# def _get_console_handler():
# def getLogger(name):  # Not threadsafe
# 
# Path: groundstation/gref.py
# def valid_path(path):
#     def __init__(self, store, channel, identifier):
#     def __str__(self):
#     def exists(self):
#     def tips(self):
#     def node_path(self):
#     def write_tip(self, tip, signature):
#     def tip_path(self, tip):
#     def __iter__(self):
#     def get_signature(self, tip):
#     def remove_tip(self, tip, silent=False):
#     def direct_parents(self, tip):
#     def parents(self, tips=None):
#     def marshall(self, crypto_adaptor=None):
#         def _process(node):
#     def as_dict(self):
# class Gref(object):


import groundstation.proto.channel_list_pb2
from groundstation import logger
from groundstation.gref import Gref, Tip

log = logger.getLogger(__name__)



def handle_describechannels(self):
    if not self.payload:
        log.info("station %s sent empty DESCRIBECHANNELS payload - new database?" % (str(self.origin)))
        return
    proto_channels = groundstation.proto.channel_list_pb2.ChannelList()
    proto_channels.ParseFromString(self.payload)
    for channel in proto_channels.channels:

# Path: groundstation/logger.py
#     LEVEL = getattr(logging, os.getenv("GROUNDSTATION_DEBUG"))
#     LEVEL = logging.DEBUG
# CONSOLE_FORMATTER = _get_formatter()
# CONSOLE_HANDLER = _get_console_handler()
# LOGGERS = {}  # Cache for instanciated loggers
# def fix_oid(oid):
# def _get_formatter():
# def _get_console_handler():
# def getLogger(name):  # Not threadsafe
# 
# Path: groundstation/gref.py
# def valid_path(path):
#     def __init__(self, store, channel, identifier):
#     def __str__(self):
#     def exists(self):
#     def tips(self):
#     def node_path(self):
#     def write_tip(self, tip, signature):
#     def tip_path(self, tip):
#     def __iter__(self):
#     def get_signature(self, tip):
#     def remove_tip(self, tip, silent=False):
#     def direct_parents(self, tip):
#     def parents(self, tips=None):
#     def marshall(self, crypto_adaptor=None):
#         def _process(node):
#     def as_dict(self):
# class Gref(object):


# Path: groundstation/transfer/response_handlers/describechannels.py
import groundstation.proto.channel_list_pb2
from groundstation import logger
from groundstation.gref import Gref, Tip


log = logger.getLogger(__name__)



def handle_describechannels(self):
    if not self.payload:
        log.info("station %s sent empty DESCRIBECHANNELS payload - new database?" % (str(self.origin)))
        return
    proto_channels = groundstation.proto.channel_list_pb2.ChannelList()
    proto_channels.ParseFromString(self.payload)
    for channel in proto_channels.channels:

        for gref in channel.grefs: