1474
by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon |
1 |
#!/usr/bin/python
|
2 |
||
3 |
from canonical.poppy.server import run_server |
|
2627
by Canonical.com Patch Queue Manager
[trivial] rename uploader.py to poppyinterface.py in canonical.archivepublisher |
4 |
from canonical.lucille.poppyinterface import PoppyInterface |
1474
by Canonical.com Patch Queue Manager
GPGV movement, initial poppy-upload and clean up ftpserver signon |
5 |
|
6 |
import sys |
|
7 |
import logging |
|
8 |
||
9 |
def main(): |
|
10 |
args = sys.argv[1:] |
|
11 |
if len(args) != 2: |
|
12 |
print "usage: poppy-upload.py rootuploaddirectory port" |
|
13 |
return 1 |
|
14 |
root, port = args |
|
15 |
host = "127.0.0.1" |
|
16 |
ident = "lucille upload server" |
|
17 |
numthreads = 4 |
|
18 |
||
19 |
logger = logging.getLogger('Server') |
|
20 |
hdlr = logging.FileHandler('++lucilleupload.log') |
|
21 |
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') |
|
22 |
hdlr.setFormatter(formatter) |
|
23 |
logger.addHandler(hdlr) |
|
24 |
logger.setLevel(logging.DEBUG) |
|
25 |
||
26 |
iface = PoppyInterface(logger) |
|
27 |
||
28 |
||
29 |
run_server(root, host, int(port), ident, numthreads, |
|
30 |
iface.new_client_hook, iface.client_done_hook, |
|
31 |
iface.auth_verify_hook) |
|
32 |
return 0 |
|
33 |
||
34 |
if __name__ == '__main__': |
|
35 |
sys.exit(main()) |