X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=nagixsc%2F__init__.py;h=030b86da2805ddf724cf9892fb49d4e6a5a2d280;hb=700904cb0a254d0230fb829f7c0dacfe84676f6d;hp=74c11fffc4690f3c15047f3f2ba431b5bf2a9581;hpb=f31463596fd7379c42c6b746919f3e3bd88e4baa;p=nagixsc.git diff --git a/nagixsc/__init__.py b/nagixsc/__init__.py index 74c11ff..030b86d 100644 --- a/nagixsc/__init__.py +++ b/nagixsc/__init__.py @@ -1,3 +1,20 @@ +# Nag(ix)SC -- __init__.py +# +# Copyright (C) 2009-2010 Sven Velt +# +# 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; only version 2 of the License is applicable. +# +# 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 St, Fifth Floor, Boston, MA 02110-1301 USA + import BaseHTTPServer import ConfigParser import SocketServer @@ -572,7 +589,12 @@ def daemonize(pidfile=None, stdin='/dev/null', stdout='/dev/null', stderr='/dev/ ############################################################################## -class MyHTTPServer(SocketServer.ForkingMixIn, BaseHTTPServer.HTTPServer): +if 'ForkingMixIn' in SocketServer.__dict__: + MixInClass = SocketServer.ForkingMixIn +else: + MixInClass = SocketServer.ThreadingMixIn + +class MyHTTPServer(MixInClass, BaseHTTPServer.HTTPServer): def __init__(self, server_address, HandlerClass, ssl=False, sslpemfile=None): SocketServer.BaseServer.__init__(self, server_address, HandlerClass)