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

Side by Side Diff: third_party/twisted_8_1/twisted/tap/manhole.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 manhole server with mktap.
8 """
9
10 from twisted.manhole import service
11 from twisted.spread import pb
12 from twisted.python import usage, util
13 from twisted.cred import portal, checkers
14 from twisted.application import strports
15 import os, sys
16
17 class Options(usage.Options):
18 synopsis = "mktap manhole [options]"
19 optParameters = [
20 ["user", "u", "admin", "Name of user to allow to log in"],
21 ["port", "p", str(pb.portno), "Port to listen on"],
22 ]
23
24 optFlags = [
25 ["tracebacks", "T", "Allow tracebacks to be sent over the network"],
26 ]
27 zsh_actions = {"user" : "_users"}
28
29 def opt_password(self, password):
30 """Required. '-' will prompt or read a password from stdin.
31 """
32 # If standard input is a terminal, I prompt for a password and
33 # confirm it. Otherwise, I use the first line from standard
34 # input, stripping off a trailing newline if there is one.
35 if password in ('', '-'):
36 self['password'] = util.getPassword(confirm=1)
37 else:
38 self['password'] = password
39 opt_w = opt_password
40
41 def postOptions(self):
42 if not self.has_key('password'):
43 self.opt_password('-')
44
45 def makeService(config):
46 port, user, password = config['port'], config['user'], config['password']
47 p = portal.Portal(
48 service.Realm(service.Service(config["tracebacks"], config.get('namespac e'))),
49 [checkers.InMemoryUsernamePasswordDatabaseDontUse(**{user: password})]
50 )
51 return strports.service(port, pb.PBServerFactory(p, config["tracebacks"]))
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/tap/ftp.py ('k') | third_party/twisted_8_1/twisted/tap/portforward.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698