/usr/bin/al-httpd is in python-albatross-common 1.36-5.5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #! /usr/bin/python
#
# Copyright 2003 by Object Craft P/L, Melbourne, Australia.
#
# LICENCE - see LICENCE file distributed with this software for details.
#
# AUTHOR(S)
# Matt Goodall <matt AT pollenation DOT net>
import os
import sys
from albatross import httpdapp
def usage():
sys.exit('usage: %s main-module.app-object port [static-url file-path] ...'
% os.path.basename(sys.argv[0]))
if __name__ == '__main__':
# Append the current working directory to the path.
sys.path.append(os.getcwd())
# Parse the command line.
try:
app_module, app_object = sys.argv[1].split('.')
port = int(sys.argv[2])
except:
usage()
static_resources = []
pairs = sys.argv[3:]
while pairs:
try:
uri, fs = pairs[:2]
except ValueError:
usage()
pairs = pairs[2:]
static_resources.append((uri, fs))
# Load the application's module and get application instance.
module = __import__(app_module)
app = getattr(module, app_object)
app._Application__base_url = '/'
# Create the HTTP server and serve requests.
httpd = httpdapp.HTTPServer(app, port, static_resources)
httpd.serve_forever()
|