# Path: pyfire/logger.py
# class Logger(logbook.Logger):
#     def __init__(self, name):
#         classname = name.replace('.', '_').lower()
#         if classname.startswith("pyfire_"):
#             classname = classname[7:]
# 
#         try:
#             level = config.get('logging', classname).upper()
#         except config.NoOptionError:
#             level = ''
# 
#         if not level:
#             level = config.get('logging', 'global_level').upper()
# 
#         if level not in frozenset(['CRITICAL', 'ERROR', 'WARNING',
#                                    'INFO', 'DEBUG', 'NOTSET']):
#             warnings.warn("No such loglevel %s" % level, RuntimeWarning)
#             level = 'ERROR'
#         super(Logger, self).__init__(classname, getattr(logbook, level))
#         self.handlers.append(logbook.more.ColorizedStderrHandler())
#         self._disabled = False
# 
#     def _set_disabled(self, value):
#         self._disabled = value
# 
#     def _get_disabled(self):
#         return global_disable or self._disabled
# 
#     disabled = property(_get_disabled, _set_disabled)
# 
# Path: pyfire/stream/errors.py
# class BadFormatError(StreamError):
#     """XML Format error"""
# 
#     def __init__(self):
#         StreamError.__init__(self, "bad-format")
# 
# class InvalidXMLError(StreamError):
#     """Stream contains XML data that cannot be processed."""
# 
#     def __init__(self):
#         StreamError.__init__(self, "invalid-xml")


    from collections import OrderedDict
    from sqlalchemy.util import OrderedDict
from xml.sax import make_parser as sax_make_parser, SAXParseException
from xml.sax.handler import ContentHandler
from pyfire.logger import Logger
from pyfire.stream.errors import BadFormatError, InvalidXMLError
import xml.etree.ElementTree as ET
# -*- coding: utf-8 -*-
"""
    pyfire.stream.processor
    ~~~~~~~~~~~~~~~~~~~~~~~

    Implementation of XMPP Stream processing

    :copyright: 2011 by the pyfire Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""

try:
except ImportError:




# Path: pyfire/logger.py
# class Logger(logbook.Logger):
#     def __init__(self, name):
#         classname = name.replace('.', '_').lower()
#         if classname.startswith("pyfire_"):
#             classname = classname[7:]
# 
#         try:
#             level = config.get('logging', classname).upper()
#         except config.NoOptionError:
#             level = ''
# 
#         if not level:
#             level = config.get('logging', 'global_level').upper()
# 
#         if level not in frozenset(['CRITICAL', 'ERROR', 'WARNING',
#                                    'INFO', 'DEBUG', 'NOTSET']):
#             warnings.warn("No such loglevel %s" % level, RuntimeWarning)
#             level = 'ERROR'
#         super(Logger, self).__init__(classname, getattr(logbook, level))
#         self.handlers.append(logbook.more.ColorizedStderrHandler())
#         self._disabled = False
# 
#     def _set_disabled(self, value):
#         self._disabled = value
# 
#     def _get_disabled(self):
#         return global_disable or self._disabled
# 
#     disabled = property(_get_disabled, _set_disabled)
# 
# Path: pyfire/stream/errors.py
# class BadFormatError(StreamError):
#     """XML Format error"""
# 
#     def __init__(self):
#         StreamError.__init__(self, "bad-format")
# 
# class InvalidXMLError(StreamError):
#     """Stream contains XML data that cannot be processed."""
# 
#     def __init__(self):
#         StreamError.__init__(self, "invalid-xml")


# Path: pyfire/stream/processor.py
    from collections import OrderedDict
    from sqlalchemy.util import OrderedDict
from xml.sax import make_parser as sax_make_parser, SAXParseException
from xml.sax.handler import ContentHandler
from pyfire.logger import Logger
from pyfire.stream.errors import BadFormatError, InvalidXMLError
import xml.etree.ElementTree as ET

# -*- coding: utf-8 -*-
"""
    pyfire.stream.processor
    ~~~~~~~~~~~~~~~~~~~~~~~

    Implementation of XMPP Stream processing

    :copyright: 2011 by the pyfire Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""

try:
except ImportError:




log = Logger(__name__)