sord.base.webserve (version 2.0-pysqlite, 18 August 2010)
index
/home/jtsage/sord/sord/base/webserve.py

Saga of the Red Dragon
 
* A blatent rip off of Seth Able Robinson's BBS Door Masterpiece.  
* All attempts were made to be as close to the original as possible, 
* including some original artwork, the original fight equations, and 
* most especially the original spelling and punctuation mistakes.  Enjoy.
 
* Contains embedded webserver.
 
* (c) 2009 - 2011 J.T.Sage
* No Rights Reserved - but don't sell it please.

 
Modules
       
binascii
sqlite3

 
Classes
       
BaseHTTPServer.BaseHTTPRequestHandler(SocketServer.StreamRequestHandler)
sordWebserver

 
class sordWebserver(BaseHTTPServer.BaseHTTPRequestHandler)
    S.O.R.D. Embedded webserver
 
 
Method resolution order:
sordWebserver
BaseHTTPServer.BaseHTTPRequestHandler
SocketServer.StreamRequestHandler
SocketServer.BaseRequestHandler

Methods defined here:
__init__(self, config, *args, **kwargs)
Initialize new server based on BaseHTTPRequestHandler
conf(self)
Show current server configuration
do_GET(self)
Override typical GET behavior of server.
 
Note: this server does not support POST at all.  Very small subset of options
dragonimg(self)
Dragon Background Image (base64 encoded)
index(self)
Site Index
line(self)
Dark Green Horizontal Rule
padnumcol(self, text, col)
Pad a selection of text to be a specied number of columns wide.
padright(self, text, col)
Pad a selection of text to be a specied number of columns wide, right justified.
play(self)
Show instructions for connecting to the server
stats(self)
Show player standings

Methods inherited from BaseHTTPServer.BaseHTTPRequestHandler:
address_string(self)
Return the client address formatted for logging.
 
This version looks up the full hostname using gethostbyaddr(),
and tries to find a name that contains at least one dot.
date_time_string(self, timestamp=None)
Return the current date and time formatted for a message header.
end_headers(self)
Send the blank line ending the MIME headers.
handle(self)
Handle multiple requests if necessary.
handle_one_request(self)
Handle a single HTTP request.
 
You normally don't need to override this method; see the class
__doc__ string for information on how to handle specific HTTP
commands such as GET and POST.
log_date_time_string(self)
Return the current time formatted for logging.
log_error(self, format, *args)
Log an error.
 
This is called when a request cannot be fulfilled.  By
default it passes the message on to log_message().
 
Arguments are the same as for log_message().
 
XXX This should go to the separate error log.
log_message(self, format, *args)
Log an arbitrary message.
 
This is used by all other logging functions.  Override
it if you have specific logging wishes.
 
The first argument, FORMAT, is a format string for the
message to be logged.  If the format string contains
any % escapes requiring parameters, they should be
specified as subsequent arguments (it's just like
printf!).
 
The client host and current date/time are prefixed to
every message.
log_request(self, code='-', size='-')
Log an accepted request.
 
This is called by send_response().
parse_request(self)
Parse a request (internal).
 
The request should be stored in self.raw_requestline; the results
are in self.command, self.path, self.request_version and
self.headers.
 
Return True for success, False for failure; on failure, an
error is sent back.
send_error(self, code, message=None)
Send and log an error reply.
 
Arguments are the error code, and a detailed message.
The detailed message defaults to the short entry matching the
response code.
 
This sends an error response (so it must be called before any
output has been generated), logs the error, and finally sends
a piece of HTML explaining the error to the user.
send_header(self, keyword, value)
Send a MIME header.
send_response(self, code, message=None)
Send the response header and log the response code.
 
Also send two standard headers with the server software
version and the current date.
version_string(self)
Return the server software version string.

Data and other attributes inherited from BaseHTTPServer.BaseHTTPRequestHandler:
MessageClass = <class mimetools.Message>
default_request_version = 'HTTP/0.9'
error_content_type = 'text/html'
error_message_format = '<head>\n<title>Error response</title>\n</head>\n<bo...ode explanation: %(code)s = %(explain)s.\n</body>\n'
monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
protocol_version = 'HTTP/1.0'
responses = {100: ('Continue', 'Request received, please continue'), 101: ('Switching Protocols', 'Switching to new protocol; obey Upgrade header'), 200: ('OK', 'Request fulfilled, document follows'), 201: ('Created', 'Document created, URL follows'), 202: ('Accepted', 'Request accepted, processing continues off-line'), 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), 204: ('No Content', 'Request fulfilled, nothing follows'), 205: ('Reset Content', 'Clear input form for further input.'), 206: ('Partial Content', 'Partial content follows.'), 300: ('Multiple Choices', 'Object has several resources -- see URI list'), ...}
server_version = 'BaseHTTP/0.3'
sys_version = 'Python/2.6.5'
weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']

Methods inherited from SocketServer.StreamRequestHandler:
finish(self)
setup(self)

Data and other attributes inherited from SocketServer.StreamRequestHandler:
rbufsize = -1
wbufsize = 0

 
Data
        __author__ = 'Jonathan T. Sage <jtsage@gmail.com>'
__credits__ = 'Seth Able Robinson, original game concept'
__date__ = '18 August 2010'
__version__ = '2.0-pysqlite'

 
Author
        Jonathan T. Sage <jtsage@gmail.com>

 
Credits
        Seth Able Robinson, original game concept