# Path: sshproxy/config.py
# class ConfigSection(object):
# class Config(object):
# class SSHproxyConfigSection(ConfigSection):
#     def __init__(self, config, section):
#     def init_section(self):
#     def get_default(self, option, default=None):
#     def __getitem__(self, option):
#     def __setitem__(self, option, value):
#     def __delitem__(self, option):
#     def keys(self):
#     def has_key(self, option):
#     def get(self, option, default=None, raw=False):
#     def set(self, option, value):
#     def pop(self, option):
#     def items(self):
#     def write(self):
#     def __str__(self):
#     def register(cls, force=False):
#     def register_handler(cls, name, handler, force=False):
#     def get_handler(cls, name):
#     def __init__(self, inifile):
#     def check_mode(self):
#     def __call__(self, section=None):
#     def __getitem__(self, section):
#     def __setitem__(self, section, options):
#     def __delitem__(self, section):
#     def pop(self, section):
#     def keys(self):
#     def has_key(self, section):
#     def defaults(self):
#     def touch(self):
#     def write(self, inifile=None):
#     def __str__(self):
# def path(path):


import os
import MySQLdb
from sshproxy.config import get_config
# 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



def Q(item):
    """Safe quote mysql values"""
    if item is None:
        return ''
    return str(item).replace("'", "\\'")

class MySQLDB(object):
    """
    This object is meant to be used as a mixin to open only the
    necessary number of connections to the database.

    It implements the open_db method, that should be called from __reginit__.
    """
    __db = {}
    def open_db(self):

# Path: sshproxy/config.py
# class ConfigSection(object):
# class Config(object):
# class SSHproxyConfigSection(ConfigSection):
#     def __init__(self, config, section):
#     def init_section(self):
#     def get_default(self, option, default=None):
#     def __getitem__(self, option):
#     def __setitem__(self, option, value):
#     def __delitem__(self, option):
#     def keys(self):
#     def has_key(self, option):
#     def get(self, option, default=None, raw=False):
#     def set(self, option, value):
#     def pop(self, option):
#     def items(self):
#     def write(self):
#     def __str__(self):
#     def register(cls, force=False):
#     def register_handler(cls, name, handler, force=False):
#     def get_handler(cls, name):
#     def __init__(self, inifile):
#     def check_mode(self):
#     def __call__(self, section=None):
#     def __getitem__(self, section):
#     def __setitem__(self, section, options):
#     def __delitem__(self, section):
#     def pop(self, section):
#     def keys(self):
#     def has_key(self, section):
#     def defaults(self):
#     def touch(self):
#     def write(self, inifile=None):
#     def __str__(self):
# def path(path):


# Path: lib/mysql_db/mysql.py
import os
import MySQLdb
from sshproxy.config import get_config

# 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



def Q(item):
    """Safe quote mysql values"""
    if item is None:
        return ''
    return str(item).replace("'", "\\'")

class MySQLDB(object):
    """
    This object is meant to be used as a mixin to open only the
    necessary number of connections to the database.

    It implements the open_db method, that should be called from __reginit__.
    """
    __db = {}
    def open_db(self):

        cfg = get_config('%s.mysql' % self._db_handler)