Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/twisted_8_1/twisted/tap/ftp.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
2 # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
3 # See LICENSE for details.
4
5
6 """
7 I am the support module for making a ftp server with mktap.
8 """
9
10 from twisted.protocols import ftp
11 from twisted.python import usage
12 from twisted.application import internet
13 from twisted.cred import error, portal, checkers, credentials
14
15 import os.path
16
17
18 class Options(usage.Options):
19 synopsis = """Usage: mktap ftp [options].
20 WARNING: This FTP server is probably INSECURE do not use it.
21 """
22 optParameters = [
23 ["port", "p", "2121", "set the port number"],
24 ["root", "r", "/usr/local/ftp", "define the root of the ftp-site." ],
25 ["userAnonymous", "", "anonymous", "Name of the anonymous user."],
26 ["password-file", "", None, "username:password-style credentia ls database"],
27 ]
28
29 longdesc = ''
30
31
32 def makeService(config):
33 f = ftp.FTPFactory()
34
35 r = ftp.FTPRealm(config['root'])
36 p = portal.Portal(r)
37 p.registerChecker(checkers.AllowAnonymousAccess(), credentials.IAnonymous)
38
39 if config['password-file'] is not None:
40 p.registerChecker(checkers.FilePasswordDB(config['password-file'], cache =True))
41
42 f.tld = config['root']
43 f.userAnonymous = config['userAnonymous']
44 f.portal = p
45 f.protocol = ftp.FTP
46
47 try:
48 portno = int(config['port'])
49 except KeyError:
50 portno = 2121
51 return internet.TCPServer(portno, f)
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/tap/__init__.py ('k') | third_party/twisted_8_1/twisted/tap/manhole.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698