~lifeless/ubuntu/lucid/apt/bug-22354

« back to all changes in this revision

Viewing changes to mirror-failure.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2007-02-06 11:38:06 UTC
  • Revision ID: james.westby@ubuntu.com-20070206113806-kjteipw5hw61lbn6
Tags: 0.6.46.4ubuntu7
* Merged the apt--mirror branch. This means that a new 'mirror' 
  method is available that will allow dynamic mirror updates.
  The sources.list entry looks something like this:
  "deb mirror://mirrors.lp.net/get_mirror feisty main restricted"

  It also supports error reporting to a configurable url for mirror
  problems/failures.
* Bump ABI version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# File: cgihttpserver-example-1.py
 
2
 
 
3
import CGIHTTPServer
 
4
import BaseHTTPServer
 
5
 
 
6
class Handler(CGIHTTPServer.CGIHTTPRequestHandler):
 
7
    #cgi_directories = ["/cgi"]
 
8
    def do_POST(self):
 
9
        print "do_POST"
 
10
        #print self.command
 
11
        #print self.path
 
12
        #print self.headers
 
13
        print self.client_address
 
14
        data = self.rfile.read(int(self.headers["content-length"]))
 
15
        print data
 
16
        self.wfile.write("200 Ok\n");
 
17
 
 
18
PORT = 8000
 
19
 
 
20
httpd = BaseHTTPServer.HTTPServer(("", PORT), Handler)
 
21
print "serving at port", PORT
 
22
httpd.serve_forever()
 
23