# Path: ravel/log.py
# LEVELS = { "debug" : logging.DEBUG,
#            "info" : logging.INFO,
#            "warning" : logging.WARNING,
#            "error" : logging.ERROR,
#            "critical" : logging.CRITICAL
#        }
# DEFAULT_LEVEL = logging.ERROR
# MSG_FORMAT = "%(levelname)s:%(funcName)s: %(message)s"
# class Singleton(type):
# class RavelLogger(Logger, object):
#     def __init__(cls, name, bases, dict_):
#     def __call__(cls, *args, **kw):
#     def __init__(self):
#     def setLogLevel(self, levelname=None):


import os
import pickle
import re
import tempfile
import threading
import time
import mininet.clean
import sysv_ipc
import ravel.messaging
from functools import partial
from mininet.cli import CLI
from mininet.net import macColonHex, netParse, ipAdd
from mininet.net import Mininet
from mininet.node import RemoteController
from ravel.log import logger
                            len(sw))

        swname = str(sw[0])
        swobj = self.net.get(swname)
        swport = self.net.topo.port(swname, msg.name)[0]
        intf = str(swobj.intfList()[swport])
        swobj.detach(intf)
        del swobj.nameToIntf[intf]
        del swobj.intfs[swport]
        del self.cache_name[msg.name]
        del self.cache_id[msg.hid]

    def getNodeByName(self, node):
        """Find a node by its name
           node: a node name
           returns: the node object"""
        return self.net.getNodeByName(node)

    def start(self):
        "Start the Mininet network"
        self.receiver.start()
        self.net.start()

    def stop(self):
        "Stop the Mininet network"
        self.receiver.stop()
        self.net.stop()
        if self.controller is not None:
            self.controller.stop()


# Path: ravel/log.py
# LEVELS = { "debug" : logging.DEBUG,
#            "info" : logging.INFO,
#            "warning" : logging.WARNING,
#            "error" : logging.ERROR,
#            "critical" : logging.CRITICAL
#        }
# DEFAULT_LEVEL = logging.ERROR
# MSG_FORMAT = "%(levelname)s:%(funcName)s: %(message)s"
# class Singleton(type):
# class RavelLogger(Logger, object):
#     def __init__(cls, name, bases, dict_):
#     def __call__(cls, *args, **kw):
#     def __init__(self):
#     def setLogLevel(self, levelname=None):


# Path: ravel/network.py
import os
import pickle
import re
import tempfile
import threading
import time
import mininet.clean
import sysv_ipc
import ravel.messaging
from functools import partial
from mininet.cli import CLI
from mininet.net import macColonHex, netParse, ipAdd
from mininet.net import Mininet
from mininet.node import RemoteController
from ravel.log import logger

                            len(sw))

        swname = str(sw[0])
        swobj = self.net.get(swname)
        swport = self.net.topo.port(swname, msg.name)[0]
        intf = str(swobj.intfList()[swport])
        swobj.detach(intf)
        del swobj.nameToIntf[intf]
        del swobj.intfs[swport]
        del self.cache_name[msg.name]
        del self.cache_id[msg.hid]

    def getNodeByName(self, node):
        """Find a node by its name
           node: a node name
           returns: the node object"""
        return self.net.getNodeByName(node)

    def start(self):
        "Start the Mininet network"
        self.receiver.start()
        self.net.start()

    def stop(self):
        "Stop the Mininet network"
        self.receiver.stop()
        self.net.stop()
        if self.controller is not None:
            self.controller.stop()


        logger.debug("cleaning up mininet")