# Path: sshproxy/util.py
# class SortedDict(odict):
#     """
#     This class implements a dict with sorted keys.
#     This is less efficient than dict, but much nicer
#     to read for a human creature.
#     """
#     def values(self):
#         items = odict.items(self)
#         items.sort()
#         return [ odict.__getitem__(self, item) for item in items ]
# 
#     def items(self):
#         items = odict.items(self)
#         items.sort()
#         return items
# 
#     def keys(self):
#         keys = odict.keys(self)
#         keys.sort()
#         return keys
# 
#     def __iter__(self):
#         for key in self.keys():
#             yield key


from ConfigParser import NoSectionError, SafeConfigParser as BaseConfigParser
from sshproxy.util import SortedDict
    import ConfigParser as CP
# -*- coding: ISO-8859-15 -*-
#
# Copyright (C) 2005-2007 David Guerizec <david@guerizec.net>
#
# Last modified: 2006 Aug 31, 02:23:07 by david
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA




class FileConfigParser(BaseConfigParser):
    """
    This class is a wrapper to python's ConfigParser to avoid the
    automatic merge between a section and the DEFAULT section.
    It also forces ConfigParser to use SortedDict instead of builtin
    dict.
    """

# Path: sshproxy/util.py
# class SortedDict(odict):
#     """
#     This class implements a dict with sorted keys.
#     This is less efficient than dict, but much nicer
#     to read for a human creature.
#     """
#     def values(self):
#         items = odict.items(self)
#         items.sort()
#         return [ odict.__getitem__(self, item) for item in items ]
# 
#     def items(self):
#         items = odict.items(self)
#         items.sort()
#         return items
# 
#     def keys(self):
#         keys = odict.keys(self)
#         keys.sort()
#         return keys
# 
#     def __iter__(self):
#         for key in self.keys():
#             yield key


# Path: lib/ini_db/file.py
from ConfigParser import NoSectionError, SafeConfigParser as BaseConfigParser
from sshproxy.util import SortedDict
    import ConfigParser as CP

# -*- coding: ISO-8859-15 -*-
#
# Copyright (C) 2005-2007 David Guerizec <david@guerizec.net>
#
# Last modified: 2006 Aug 31, 02:23:07 by david
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA




class FileConfigParser(BaseConfigParser):
    """
    This class is a wrapper to python's ConfigParser to avoid the
    automatic merge between a section and the DEFAULT section.
    It also forces ConfigParser to use SortedDict instead of builtin
    dict.
    """

    CP.__builtins__['dict'] = SortedDict