# Path: pygopherd/initialization.py
# def initconffile(conffile):
# def initlogger(config, conffile):
# def initexceptions(config):
# def initmimetypes(config):
#     def handle(self):
# def getserverobject(config):
#         def server_bind(self):
# def initsecurity(config):
# def initconditionaldetach(config):
# def initpidfile(config):
# def initpgrp(config):
# def initsighandlers(config, pgrp):
# def initeverything(conffile):
# class GopherRequestHandler(socketserver.StreamRequestHandler):
#     class MyServer(servertype):
# 
# Path: pygopherd/logger.py
# def log_file(message):
# def setlogfile(file):
# def log_syslog(message):
# def log_none(message):
# def init(config):


from pygopherd import initialization, logger
from pygopherd.protocols import ProtocolMultiplexer
from io import StringIO
import os
# Module: test utilities
# COPYRIGHT #
# Copyright (C) 2002 John Goerzen
#
#    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; version 2 of the License.
#
#    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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# END OF COPYRIGHT #



def getconfig():
    config = initialization.initconffile('conf/pygopherd.conf')
    config.set("pygopherd", "root", os.path.abspath('./testdata'))
    return config

def getstringlogger():
    config = getconfig()
    config.set('logger', 'logmethod', 'file')
    logger.init(config)
    stringfile = StringIO()

# Path: pygopherd/initialization.py
# def initconffile(conffile):
# def initlogger(config, conffile):
# def initexceptions(config):
# def initmimetypes(config):
#     def handle(self):
# def getserverobject(config):
#         def server_bind(self):
# def initsecurity(config):
# def initconditionaldetach(config):
# def initpidfile(config):
# def initpgrp(config):
# def initsighandlers(config, pgrp):
# def initeverything(conffile):
# class GopherRequestHandler(socketserver.StreamRequestHandler):
#     class MyServer(servertype):
# 
# Path: pygopherd/logger.py
# def log_file(message):
# def setlogfile(file):
# def log_syslog(message):
# def log_none(message):
# def init(config):


# Path: pygopherd/testutil.py
from pygopherd import initialization, logger
from pygopherd.protocols import ProtocolMultiplexer
from io import StringIO
import os

# Module: test utilities
# COPYRIGHT #
# Copyright (C) 2002 John Goerzen
#
#    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; version 2 of the License.
#
#    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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# END OF COPYRIGHT #



def getconfig():
    config = initialization.initconffile('conf/pygopherd.conf')
    config.set("pygopherd", "root", os.path.abspath('./testdata'))
    return config

def getstringlogger():
    config = getconfig()
    config.set('logger', 'logmethod', 'file')
    logger.init(config)
    stringfile = StringIO()

    logger.setlogfile(stringfile)