| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Twisted
Revision: 24674
Author: therve
Date: 02 Sep 2008 11:57:09
Diff at Trac: http://twistedmatrix.com/trac/changeset/24674
Changes:Revert changes to tap files
Files:| ... | ...@@ -1,6 +1,7 @@ | |
| 1 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories. | |
| 1 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
| 2 | 2 | # See LICENSE for details. |
| 3 | 3 | |
| 4 | ||
| 4 | 5 | """ |
| 5 | 6 | Domain Name Server |
| 6 | 7 | """ |
| ... | ...@@ -15,8 +16,6 @@ | |
| 15 | 16 | from twisted.names import authority |
| 16 | 17 | from twisted.names import secondary |
| 17 | 18 | |
| 18 | ||
| 19 | ||
| 20 | 19 | class Options(usage.Options): |
| 21 | 20 | optParameters = [ |
| 22 | 21 | ["interface", "i", "", "The interface to which to bind"], |
| ... | ...@@ -1,8 +1,14 @@ | |
| 1 | 1 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories. |
| 2 | 2 | # See LICENSE for details. |
| 3 | 3 | |
| 4 | # | |
| 5 | # Twisted, the Framework of Your Internet | |
| 6 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
| 7 | # See LICENSE for details. | |
| 8 | ||
| 9 | ||
| 4 | 10 | """ |
| 5 | Support module for making SSH servers with mktap. | |
| 11 | I am a support module for making SSH servers with mktap. | |
| 6 | 12 | """ |
| 7 | 13 | |
| 8 | 14 | from twisted.conch import checkers, unix |
| ... | ...@@ -12,7 +18,6 @@ | |
| 12 | 18 | from twisted.application import strports |
| 13 | 19 | |
| 14 | 20 | |
| 15 | ||
| 16 | 21 | class Options(usage.Options): |
| 17 | 22 | synopsis = "Usage: mktap conch [-i <interface>] [-p <port>] [-d <dir>] " |
| 18 | 23 | longdesc = "Makes a Conch SSH server.." |
| ... | ...@@ -7,14 +7,14 @@ | |
| 7 | 7 | |
| 8 | 8 | import os |
| 9 | 9 | |
| 10 | from twisted.web import server, static, twcgi, script, demo, distrib, trp | |
| 11 | from twisted.internet import interfaces | |
| 12 | from twisted.python import usage, reflect | |
| 10 | # Twisted Imports | |
| 11 | from twisted.web import server, static, twcgi, script, demo, distrib, trp, wsgi | |
| 12 | from twisted.internet import interfaces, reactor | |
| 13 | from twisted.python import usage, reflect, threadpool | |
| 13 | 14 | from twisted.spread import pb |
| 14 | 15 | from twisted.application import internet, service, strports |
| 15 | 16 | |
| 16 | 17 | |
| 17 | ||
| 18 | 18 | class Options(usage.Options): |
| 19 | 19 | synopsis = "Usage: mktap web [options]" |
| 20 | 20 | optParameters = [["port", "p", "8080","Port to start the server on."], |
| ... | ...@@ -61,10 +61,11 @@ | |
| 61 | 61 | opt_u = opt_user |
| 62 | 62 | |
| 63 | 63 | def opt_path(self, path): |
| 64 | """<path> is either a specific file or a directory to | |
| 65 | be set as the root of the web server. Use this if you | |
| 66 | have a directory full of HTML, cgi, php3, epy, or rpy files or | |
| 67 | any other files that you want to be served up raw. | |
| 64 | """ | |
| 65 | <path> is either a specific file or a directory to be set as the root | |
| 66 | of the web server. Use this if you have a directory full of HTML, cgi, | |
| 67 | php3, epy, or rpy files or any other files that you want to be served | |
| 68 | up raw. | |
| 68 | 69 | """ |
| 69 | 70 | |
| 70 | 71 | self['root'] = static.File(os.path.abspath(path)) |
| ... | ...@@ -106,6 +107,21 @@ | |
| 106 | 107 | self['root'] = script.ResourceScriptWrapper(name) |
| 107 | 108 | |
| 108 | 109 | |
| 110 | def opt_wsgi(self, name): | |
| 111 | """ | |
| 112 | The FQPN of a WSGI application object to serve as the root resource of | |
| 113 | the webserver. | |
| 114 | """ | |
| 115 | pool = threadpool.ThreadPool() | |
| 116 | reactor.callWhenRunning(pool.start) | |
| 117 | reactor.addSystemEventTrigger('after', 'shutdown', pool.stop) | |
| 118 | try: | |
| 119 | application = reflect.namedAny(name) | |
| 120 | except (AttributeError, ValueError): | |
| 121 | raise usage.UsageError("No such WSGI application: %r" % (name,)) | |
| 122 | self['root'] = wsgi.WSGIResource(reactor, pool, application) | |
| 123 | ||
| 124 | ||
| 109 | 125 | def opt_mime_type(self, defaultType): |
| 110 | 126 | """Specify the default mime-type for static files.""" |
| 111 | 127 | if not isinstance(self['root'], static.File): |
| ... | ...@@ -1,12 +1,13 @@ | |
| 1 | 1 | # -*- test-case-name: twisted.mail.test.test_options -*- |
| 2 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories. | |
| 2 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
| 3 | 3 | # See LICENSE for details. |
| 4 | 4 | |
| 5 | """ | |
| 6 | Support module for creating mail servers with 'mktap' | |
| 5 | ||
| 6 | """I am the support module for creating mail servers with 'mktap' | |
| 7 | 7 | """ |
| 8 | 8 | |
| 9 | 9 | import os |
| 10 | import sys | |
| 10 | 11 | |
| 11 | 12 | from twisted.mail import mail |
| 12 | 13 | from twisted.mail import maildir |
| ... | ...@@ -20,7 +21,6 @@ | |
| 20 | 21 | from twisted.application import internet |
| 21 | 22 | |
| 22 | 23 | |
| 23 | ||
| 24 | 24 | class Options(usage.Options): |
| 25 | 25 | synopsis = "Usage: mktap mail [options]" |
| 26 | 26 |