[Supervisor-checkins] r863 - in supervisor/trunk/src: medusa supervisor supervisor/medusa supervisor/medusa/demo supervisor/medusa/test supervisor/medusa/thread supervisor/tests
Mike Naberezny
mike at maintainable.com
Sun May 24 14:56:04 EDT 2009
Author: Mike Naberezny <mike at maintainable.com>
Date: Sun May 24 14:56:03 2009
New Revision: 863
Log:
Moved bundled medusa under the supervisor package.
Added:
supervisor/trunk/src/supervisor/medusa/
- copied from r862, /supervisor/trunk/src/medusa/
Removed:
supervisor/trunk/src/medusa/
Modified:
supervisor/trunk/src/supervisor/dispatchers.py
supervisor/trunk/src/supervisor/http.py
supervisor/trunk/src/supervisor/http_client.py
supervisor/trunk/src/supervisor/medusa/CHANGES.txt
supervisor/trunk/src/supervisor/medusa/asynchat_25.py
supervisor/trunk/src/supervisor/medusa/demo/publish.py
supervisor/trunk/src/supervisor/medusa/demo/script_server.py
supervisor/trunk/src/supervisor/medusa/demo/simple_anon_ftpd.py
supervisor/trunk/src/supervisor/medusa/demo/start_medusa.py
supervisor/trunk/src/supervisor/medusa/demo/winFTPserver.py
supervisor/trunk/src/supervisor/medusa/ftp_server.py
supervisor/trunk/src/supervisor/medusa/test/test_11.py
supervisor/trunk/src/supervisor/medusa/test/test_lb.py
supervisor/trunk/src/supervisor/medusa/test/test_medusa.py
supervisor/trunk/src/supervisor/medusa/test/test_producers.py
supervisor/trunk/src/supervisor/medusa/thread/thread_handler.py
supervisor/trunk/src/supervisor/options.py
supervisor/trunk/src/supervisor/process.py
supervisor/trunk/src/supervisor/supervisorctl.py
supervisor/trunk/src/supervisor/supervisord.py
supervisor/trunk/src/supervisor/tests/test_http.py
supervisor/trunk/src/supervisor/tests/test_supervisord.py
supervisor/trunk/src/supervisor/web.py
supervisor/trunk/src/supervisor/xmlrpc.py
Modified: supervisor/trunk/src/supervisor/dispatchers.py
==============================================================================
--- supervisor/trunk/src/supervisor/dispatchers.py (original)
+++ supervisor/trunk/src/supervisor/dispatchers.py Sun May 24 14:56:03 2009
@@ -13,7 +13,7 @@
##############################################################################
import errno
-from asyncore import compact_traceback
+from supervisor.medusa.asyncore_25 import compact_traceback
from supervisor.events import notify
from supervisor.events import EventRejectedEvent
Modified: supervisor/trunk/src/supervisor/http.py
==============================================================================
--- supervisor/trunk/src/supervisor/http.py (original)
+++ supervisor/trunk/src/supervisor/http.py Sun May 24 14:56:03 2009
@@ -21,14 +21,14 @@
import pwd
import urllib
-from medusa import asyncore_25 as asyncore
-from medusa import http_date
-from medusa import http_server
-from medusa import producers
-from medusa import filesys
-from medusa import default_handler
+from supervisor.medusa import asyncore_25 as asyncore
+from supervisor.medusa import http_date
+from supervisor.medusa import http_server
+from supervisor.medusa import producers
+from supervisor.medusa import filesys
+from supervisor.medusa import default_handler
-from medusa.auth_handler import auth_handler
+from supervisor.medusa.auth_handler import auth_handler
class NOT_DONE_YET:
pass
@@ -483,7 +483,7 @@
def prebind(self, sock, logger_object):
""" Override __init__ to do logger setup earlier so it can
go to our logger object instead of stdout """
- from medusa import logger
+ from supervisor.medusa import logger
if not logger_object:
logger_object = logger.file_logger(sys.stdout)
@@ -500,8 +500,8 @@
self.set_reuse_addr()
def postbind(self):
- from medusa.counter import counter
- from medusa.http_server import VERSION_STRING
+ from supervisor.medusa.counter import counter
+ from supervisor.medusa.http_server import VERSION_STRING
self.listen(1024)
Modified: supervisor/trunk/src/supervisor/http_client.py
==============================================================================
--- supervisor/trunk/src/supervisor/http_client.py (original)
+++ supervisor/trunk/src/supervisor/http_client.py Sun May 24 14:56:03 2009
@@ -5,8 +5,8 @@
import base64
from urlparse import urlparse
-from medusa import asyncore_25 as aysncore
-from medusa import asynchat_25 as asynchat
+from supervisor.medusa import asyncore_25 as aysncore
+from supervisor.medusa import asynchat_25 as asynchat
CR="\x0d"
LF="\x0a"
Modified: supervisor/trunk/src/supervisor/medusa/CHANGES.txt
==============================================================================
--- /supervisor/trunk/src/medusa/CHANGES.txt (original)
+++ supervisor/trunk/src/supervisor/medusa/CHANGES.txt Sun May 24 14:56:03 2009
@@ -2,6 +2,7 @@
* Re-added asyncore.py as asyncore_25.py and asynchat.py as asynchat_25.py
and updated Medusa throughout to use these. The Python 2.6 stdlib version
of these modules introduced backward-incompatible changes.
+* Changed imports throughout from "medusa" to "supervisor.medusa".
Version 0.5.5:
Modified: supervisor/trunk/src/supervisor/medusa/asynchat_25.py
==============================================================================
--- /supervisor/trunk/src/medusa/asynchat_25.py (original)
+++ supervisor/trunk/src/supervisor/medusa/asynchat_25.py Sun May 24 14:56:03 2009
@@ -47,7 +47,7 @@
"""
import socket
-from medusa import asyncore_25 as asyncore
+from supervisor.medusa import asyncore_25 as asyncore
from collections import deque
class async_chat (asyncore.dispatcher):
Modified: supervisor/trunk/src/supervisor/medusa/demo/publish.py
==============================================================================
--- /supervisor/trunk/src/medusa/demo/publish.py (original)
+++ supervisor/trunk/src/supervisor/medusa/demo/publish.py Sun May 24 14:56:03 2009
@@ -12,12 +12,12 @@
# base64-encodes the username and password). The 'Digest' scheme is
# much more secure, but not widely supported yet. <sigh>
-from medusa import asyncore_25 as asyncore
-from medusa import default_handler
-from medusa import http_server
-from medusa import put_handler
-from medusa import auth_handler
-from medusa import filesys
+from supervisor.medusa import asyncore_25 as asyncore
+from supervisor.medusa import default_handler
+from supervisor.medusa import http_server
+from supervisor.medusa import put_handler
+from supervisor.medusa import auth_handler
+from supervisor.medusa import filesys
# For this demo, we'll just use a dictionary of usernames/passwords.
# You can of course use anything that supports the mapping interface,
Modified: supervisor/trunk/src/supervisor/medusa/demo/script_server.py
==============================================================================
--- /supervisor/trunk/src/medusa/demo/script_server.py (original)
+++ supervisor/trunk/src/supervisor/medusa/demo/script_server.py Sun May 24 14:56:03 2009
@@ -1,12 +1,12 @@
# -*- Mode: Python -*-
import re, sys
-from medusa import asyncore_25 as asyncore
-from medusa import http_server
-from medusa import default_handler
-from medusa import logger
-from medusa import script_handler
-from medusa import filesys
+from supervisor.medusa import asyncore_25 as asyncore
+from supervisor.medusa import http_server
+from supervisor.medusa import default_handler
+from supervisor.medusa import logger
+from supervisor.medusa import script_handler
+from supervisor.medusa import filesys
PUBLISHING_ROOT='/home/medusa'
CONTENT_LENGTH = re.compile ('Content-Length: ([0-9]+)', re.IGNORECASE)
Modified: supervisor/trunk/src/supervisor/medusa/demo/simple_anon_ftpd.py
==============================================================================
--- /supervisor/trunk/src/medusa/demo/simple_anon_ftpd.py (original)
+++ supervisor/trunk/src/supervisor/medusa/demo/simple_anon_ftpd.py Sun May 24 14:56:03 2009
@@ -1,7 +1,7 @@
# -*- Mode: Python -*-
-from medusa import asyncore_25 as asyncore
-from medusa import ftp_server
+from supervisor.medusa import asyncore_25 as asyncore
+from supervisor.medusa import ftp_server
# create a 'dummy' authorizer (one that lets everyone in) that returns
# a read-only filesystem rooted at '/home/ftp'
Modified: supervisor/trunk/src/supervisor/medusa/demo/start_medusa.py
==============================================================================
--- /supervisor/trunk/src/medusa/demo/start_medusa.py (original)
+++ supervisor/trunk/src/supervisor/medusa/demo/start_medusa.py Sun May 24 14:56:03 2009
@@ -14,16 +14,16 @@
import os
import sys
-from medusa import asyncore_25 as asyncore
-from medusa import http_server
-from medusa import ftp_server
-from medusa import chat_server
-from medusa import monitor
-from medusa import filesys
-from medusa import default_handler
-from medusa import status_handler
-from medusa import resolver
-from medusa import logger
+from supervisor.medusa import asyncore_25 as asyncore
+from supervisor.medusa import http_server
+from supervisor.medusa import ftp_server
+from supervisor.medusa import chat_server
+from supervisor.medusa import monitor
+from supervisor.medusa import filesys
+from supervisor.medusa import default_handler
+from supervisor.medusa import status_handler
+from supervisor.medusa import resolver
+from supervisor.medusa import logger
if len(sys.argv) > 1:
# process a few convenient arguments
@@ -111,7 +111,7 @@
# Unix user `public_html' directory support
# ===========================================================================
if os.name == 'posix':
- from medusa import unix_user_handler
+ from supervisor.medusa import unix_user_handler
uh = unix_user_handler.unix_user_handler ('public_html')
hs.install_handler (uh)
Modified: supervisor/trunk/src/supervisor/medusa/demo/winFTPserver.py
==============================================================================
--- /supervisor/trunk/src/medusa/demo/winFTPserver.py (original)
+++ supervisor/trunk/src/supervisor/medusa/demo/winFTPserver.py Sun May 24 14:56:03 2009
@@ -11,8 +11,8 @@
import win32security, win32con, win32api, win32net
import ntsecuritycon, pywintypes
-from medusa import asyncore_25 as asyncore
-from medusa import ftp_server, filesys
+from supervisor.medusa import asyncore_25 as asyncore
+from supervisor.medusa import ftp_server, filesys
class Win32Authorizer:
Modified: supervisor/trunk/src/supervisor/medusa/ftp_server.py
==============================================================================
--- /supervisor/trunk/src/medusa/ftp_server.py (original)
+++ supervisor/trunk/src/supervisor/medusa/ftp_server.py Sun May 24 14:56:03 2009
@@ -29,7 +29,7 @@
import sys
import time
-from medusa.producers import file_producer
+from supervisor.medusa.producers import file_producer
# TODO: implement a directory listing cache. On very-high-load
# servers this could save a lot of disk abuse, and possibly the
Modified: supervisor/trunk/src/supervisor/medusa/test/test_11.py
==============================================================================
--- /supervisor/trunk/src/medusa/test/test_11.py (original)
+++ supervisor/trunk/src/supervisor/medusa/test/test_11.py Sun May 24 14:56:03 2009
@@ -2,8 +2,8 @@
import socket
import string
-from medusa import asyncore_25 as asyncore
-from medusa import asynchat_25 as asynchat
+from supervisor.medusa import asyncore_25 as asyncore
+from supervisor.medusa import asynchat_25 as asynchat
# get some performance figures for an HTTP/1.1 server.
# use pipelining.
Modified: supervisor/trunk/src/supervisor/medusa/test/test_lb.py
==============================================================================
--- /supervisor/trunk/src/medusa/test/test_lb.py (original)
+++ supervisor/trunk/src/supervisor/medusa/test/test_lb.py Sun May 24 14:56:03 2009
@@ -13,8 +13,8 @@
# server
# ==================================================
-from medusa import asyncore_25 as asyncore
-from medusa import asynchat_25 as asynchat
+from supervisor.medusa import asyncore_25 as asyncore
+from supervisor.medusa import asynchat_25 as asynchat
class test_channel (asynchat.async_chat):
Modified: supervisor/trunk/src/supervisor/medusa/test/test_medusa.py
==============================================================================
--- /supervisor/trunk/src/medusa/test/test_medusa.py (original)
+++ supervisor/trunk/src/supervisor/medusa/test/test_medusa.py Sun May 24 14:56:03 2009
@@ -3,7 +3,7 @@
import socket
import string
import time
-from medusa import http_date
+from supervisor.medusa import http_date
now = http_date.build_http_date (time.time())
Modified: supervisor/trunk/src/supervisor/medusa/test/test_producers.py
==============================================================================
--- /supervisor/trunk/src/medusa/test/test_producers.py (original)
+++ supervisor/trunk/src/supervisor/medusa/test/test_producers.py Sun May 24 14:56:03 2009
@@ -9,10 +9,10 @@
import StringIO, zlib
from sancho.unittest import TestScenario, parse_args, run_scenarios
-tested_modules = ["medusa.producers"]
+tested_modules = ["supervisor.medusa.producers"]
-from medusa import producers
+from supervisor.medusa import producers
test_string = ''
for i in range(16385):
Modified: supervisor/trunk/src/supervisor/medusa/thread/thread_handler.py
==============================================================================
--- /supervisor/trunk/src/medusa/thread/thread_handler.py (original)
+++ supervisor/trunk/src/supervisor/medusa/thread/thread_handler.py Sun May 24 14:56:03 2009
@@ -10,10 +10,10 @@
import time
import select_trigger
-from medusa import counter
-from medusa import producers
+from supervisor.medusa import counter
+from supervisor.medusa import producers
-from medusa.default_handler import unquote, get_header
+from supervisor.medusa.default_handler import unquote, get_header
import threading
@@ -332,7 +332,7 @@
nthreads = string.atoi (sys.argv[1])
import asyncore_25 as asyncore
- from medusa import http_server
+ from supervisor.medusa import http_server
# create a generic web server
hs = http_server.http_server ('', 7080)
Modified: supervisor/trunk/src/supervisor/options.py
==============================================================================
--- supervisor/trunk/src/supervisor/options.py (original)
+++ supervisor/trunk/src/supervisor/options.py Sun May 24 14:56:03 2009
@@ -33,7 +33,7 @@
from fcntl import fcntl
from fcntl import F_SETFL, F_GETFL
-from medusa import asyncore_25 as asyncore
+from supervisor.medusa import asyncore_25 as asyncore
from supervisor.datatypes import boolean
from supervisor.datatypes import integer
Modified: supervisor/trunk/src/supervisor/process.py
==============================================================================
--- supervisor/trunk/src/supervisor/process.py (original)
+++ supervisor/trunk/src/supervisor/process.py Sun May 24 14:56:03 2009
@@ -21,7 +21,7 @@
import traceback
import signal
-from medusa import asyncore_25 as asyncore
+from supervisor.medusa import asyncore_25 as asyncore
from supervisor.states import ProcessStates
from supervisor.states import SupervisorStates
Modified: supervisor/trunk/src/supervisor/supervisorctl.py
==============================================================================
--- supervisor/trunk/src/supervisor/supervisorctl.py (original)
+++ supervisor/trunk/src/supervisor/supervisorctl.py Sun May 24 14:56:03 2009
@@ -43,7 +43,7 @@
import urlparse
import threading
-from medusa import asyncore_25 as asyncore
+from supervisor.medusa import asyncore_25 as asyncore
from supervisor.options import ClientOptions
from supervisor.options import split_namespec
Modified: supervisor/trunk/src/supervisor/supervisord.py
==============================================================================
--- supervisor/trunk/src/supervisor/supervisord.py (original)
+++ supervisor/trunk/src/supervisor/supervisord.py Sun May 24 14:56:03 2009
@@ -47,7 +47,7 @@
import select
import signal
-from medusa import asyncore_25 as asyncore
+from supervisor.medusa import asyncore_25 as asyncore
from supervisor.options import ServerOptions
from supervisor.options import signame
Modified: supervisor/trunk/src/supervisor/tests/test_http.py
==============================================================================
--- supervisor/trunk/src/supervisor/tests/test_http.py (original)
+++ supervisor/trunk/src/supervisor/tests/test_http.py Sun May 24 14:56:03 2009
@@ -64,7 +64,7 @@
request = DummyRequest('/logtail/foo', None, None, None)
handler.handle_request(request)
self.assertEqual(request._error, None)
- from medusa import http_date
+ from supervisor.medusa import http_date
self.assertEqual(request.headers['Last-Modified'],
http_date.build_http_date(os.stat(t)[stat.ST_MTIME]))
self.assertEqual(request.headers['Content-Type'], 'text/plain')
@@ -103,7 +103,7 @@
request = DummyRequest('/mainlogtail', None, None, None)
handler.handle_request(request)
self.assertEqual(request._error, None)
- from medusa import http_date
+ from supervisor.medusa import http_date
self.assertEqual(request.headers['Last-Modified'],
http_date.build_http_date(os.stat(t)[stat.ST_MTIME]))
self.assertEqual(request.headers['Content-Type'], 'text/plain')
Modified: supervisor/trunk/src/supervisor/tests/test_supervisord.py
==============================================================================
--- supervisor/trunk/src/supervisor/tests/test_supervisord.py (original)
+++ supervisor/trunk/src/supervisor/tests/test_supervisord.py Sun May 24 14:56:03 2009
@@ -390,7 +390,7 @@
process = DummyProcess(pconfig)
gconfig = DummyPGroupConfig(options, pconfigs=[pconfig])
pgroup = DummyProcessGroup(gconfig)
- from medusa import asyncore_25 as asyncore
+ from supervisor.medusa import asyncore_25 as asyncore
exitnow = DummyDispatcher(readable=True, error=asyncore.ExitNow)
pgroup.dispatchers = {6:exitnow}
supervisord.process_groups = {'foo': pgroup}
@@ -410,7 +410,7 @@
L.append(event)
from supervisor import events
events.subscribe(events.SupervisorStateChangeEvent, callback)
- from medusa import asyncore_25 as asyncore
+ from supervisor.medusa import asyncore_25 as asyncore
options.test = True
self.assertRaises(asyncore.ExitNow, supervisord.runforever)
self.assertTrue(pgroup.all_stopped)
@@ -432,7 +432,7 @@
supervisord.process_groups = {'foo': pgroup}
supervisord.options.mood = 0
supervisord.options.test = True
- from medusa import asyncore_25 as asyncore
+ from supervisor.medusa import asyncore_25 as asyncore
self.assertRaises(asyncore.ExitNow, supervisord.runforever)
self.assertEqual(pgroup.all_stopped, True)
Modified: supervisor/trunk/src/supervisor/web.py
==============================================================================
--- supervisor/trunk/src/supervisor/web.py (original)
+++ supervisor/trunk/src/supervisor/web.py Sun May 24 14:56:03 2009
@@ -21,10 +21,10 @@
import datetime
import StringIO
-from medusa import producers
-from medusa.http_server import http_date
-from medusa.http_server import get_header
-from medusa.xmlrpc_handler import collector
+from supervisor.medusa import producers
+from supervisor.medusa.http_server import http_date
+from supervisor.medusa.http_server import get_header
+from supervisor.medusa.xmlrpc_handler import collector
import meld3
Modified: supervisor/trunk/src/supervisor/xmlrpc.py
==============================================================================
--- supervisor/trunk/src/supervisor/xmlrpc.py (original)
+++ supervisor/trunk/src/supervisor/xmlrpc.py Sun May 24 14:56:03 2009
@@ -22,9 +22,9 @@
import traceback
import sys
-from medusa.http_server import get_header
-from medusa.xmlrpc_handler import xmlrpc_handler
-from medusa import producers
+from supervisor.medusa.http_server import get_header
+from supervisor.medusa.xmlrpc_handler import xmlrpc_handler
+from supervisor.medusa import producers
from supervisor.http import NOT_DONE_YET
More information about the Supervisor-checkins
mailing list