{ "info": { "author": "Zope Corporation and Contributors", "author_email": "zope-dev@zope.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "This package integrates the Twisted HTTP and FTP server into a Zope 3\napplication setup. It also defines the script skeleton for a classic Zope 3\napplication.\n\n\nDetailed Documentation\n======================\n\n\n=================================\nZope 3 Application Server Support\n=================================\n\nThis package is responsible for initializing and starting the servers that\nwill provide access to the Zope 3 application. This package is heavily\ntwisted-depedent, though some pieces can be reused to bring up the Zope 3\napplication server in other environemnts.\n\n\nServer Types\n------------\n\nZope 3 needs to support many server types -- HTTP, FTP, HTTP with postmortem\ndebugging, etc. All of them are registered as ``IServerType`` utilities in\nZCML. This allows developers to easily develop and register new servers for\nZope 3.\n\n``ServerType`` is an implementation of ``IServerType`` that is specific to the\nstandard Twisted servers.. The constructor of ``ServerType`` takes three\narguments: the factory that will create a Twisted ``IServerFactory`` object\nand the default port and IP to which to bind the server.\n\nThe ``factory`` argument should be a callable expecting one argument, the ZODB\ninstance. It is up to the factory, to implement the necessary glue between the\nserver and the application:\n\n >>> class TwistedServerFactoryStub(object):\n ... def doStart(self): pass\n\n >>> def factory(db):\n ... print 'ZODB: %s' %db\n ... return TwistedServerFactoryStub()\n\nFor the other two constructor arguments of ``ServerType``, the ``defaultPort``\nargument specifies the default TCP port number for the server. The\n``defaultIP`` argument specifies the network interface for listening on. You\ncan specify the network interface IP address, or an empty string if you want\nto listen on all interfaces.\n\nWe are now ready to instantiate the server type:\n\n >>> from zope.app.twisted.server import ServerType\n >>> st = ServerType(factory, defaultPort=8080)\n\nand let's make sure it really implements the promised interface:\n\n >>> from zope.interface.verify import verifyObject\n >>> from zope.app.twisted.interfaces import IServerType\n >>> verifyObject(IServerType, st)\n True\n\nA server type is then registered as a named utility. These utilities are used\nwhile interpreting ```` sections of `zope.conf` to create instances of\nservers listening on a specific port.\n\nWhen you create an instance of a server using the ``create()`` method of the\nserver type, you need to tell it an identifying name and a the ZODB database\nobject. The IP address, port and backlog count can be optionally passed to the\nmethod.\n\n >>> db = 'my database'\n >>> server = st.create('Example-HTTP', db, port=0)\n ZODB: my database\n >>> server #doctest:+ELLIPSIS\n \n\nAs you can see the server type creates a Zope-specific TCP server, which is\nsimply a standard ``twisted.internet.TCPServer`` that creates a log entry upon\nstartup.\n\n >>> server.startService()\n >>> print log.getvalue()\n -- Example-HTTP Server started.\n Hostname: localhost\n Port: 0\n\nYou can, of course, create multiple instances of the same server type, and\nbind them to different ports.\n\n >>> server2 = st.create('Example-HTTP-2', db, port=0)\n ZODB: my database\n\n >>> server2.startService()\n >>> print log.getvalue()\n -- Example-HTTP Server started.\n Hostname: localhost\n Port: 0\n -- Example-HTTP-2 Server started.\n Hostname: localhost\n Port: 0\n\nA special type of server type is the SSL server type; it requires some\nadditional information (private key path, certificate path, and TLS flag) to\nstart up the server. The setup will only work, if OpenSSL is installed:\n\n # >>> from zope.app.twisted.server import SSLServerType\n # >>> ssl_st = SSLServerType(factory, defaultPort=8443)\n #\n # >>> ssl_server = ssl_st.create('Example-HTTPS', db,\n # ... 'server.pem', 'server.pem')\n # ZODB: my database\n # >>> ssl_server #doctest:+ELLIPSIS\n # \n\n\nServer Factories\n----------------\n\nNow, of course we do not hardwire the setup of actual servers in\nPython. Instead, we are using ZConfig to setup the servers. Unfortunately that\nmeans that we need yet another abstraction layer to setup the\nservers. ZConfig-based configuration code creates so called ``ServerFactory``\nand ``SSLServerFactory`` objects that then use the server types to create the\nservers.\n\n >>> from zope.interface import implements\n >>> from zope.app.twisted.interfaces import IServerType\n >>> class MyServerType:\n ... implements(IServerType)\n ... def create(self, name, db,\n ... port='unknown', ip='', backlog=50):\n ... if not ip:\n ... ip = '*' # listen on all interfaces\n ... return ('%s server on %s:%d, registered with %s, backlog %d'\n ... % (name, ip, port, db, backlog))\n\n >>> from zope.app.testing import ztapi\n >>> ztapi.provideUtility(IServerType, MyServerType(), name='HTTP')\n >>> ztapi.provideUtility(IServerType, MyServerType(), name='FTP')\n\n``ServerFactory`` is used to hook into ZConfig and create instances of servers\nspecified in `zope.conf`. It gets a `section` argument that contains settings\nspecified in a ZConfig ```` section.\n\n >>> class ServerSectionStub:\n ... type = 'HTTP'\n ... address = ('', 8080)\n ... backlog = 30\n >>> my_section = ServerSectionStub()\n\n >>> from zope.app.twisted.server import ServerFactory\n >>> sf = ServerFactory(my_section)\n\nThe server factory object knows how to create a server, given a ZODB database\nobject. The name is a combination of type, ip, and port, so that the Twisted\ncode can distinguish between the different HTTP servers.\n\n >>> db = 'my db'\n >>> print sf.create(db)\n HTTP:localhost:8080 server on *:8080, registered with my db, backlog 30\n\nIt can create more than one, using different ports.\n\n >>> my_section.address = ('', 8081)\n >>> sf = ServerFactory(my_section)\n >>> print sf.create(db)\n HTTP:localhost:8081 server on *:8081, registered with my db, backlog 30\n\nThe settings should actually work with FTP as well.\n\n >>> my_section.type = 'FTP'\n >>> my_section.address = ('127.0.0.1', 8021)\n >>> sf = ServerFactory(my_section)\n >>> print sf.create(db)\n FTP:127.0.0.1:8021 server on 127.0.0.1:8021, registered with my db, backlog 30\n\n\n\n=======\nCHANGES\n=======\n\n3.5.0 (2009-07-24)\n------------------\n\n- Update tests to work with latest packages.\n\n3.4.2 (2009-01-27)\n------------------\n\n- Fix tests. Remove unused code.\n\n- Add zope.testbrowser to testing dependencies for ZEO tests.\n\n- Remove unneeded dependency on ZODB3.\n\n- Remove dependency on zope.app.zapi, substituting its uses with direct\n imports.\n\n- Change \"cheeseshop\" to \"pypi\" in the package homepage.\n\n3.4.1 (2008-02-02)\n------------------\n\n- Fix of 599 error on conflict error in request\n see: http://mail.zope.org/pipermail/zope-dev/2008-January/030844.html\n\n3.4.0 (2007-10-27)\n------------------\n\n- Initial release independent of the main Zope tree.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/zope.app.twisted", "keywords": "zope3 twisted server http ftp wsgi", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "zope.app.twisted", "package_url": "https://pypi.org/project/zope.app.twisted/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zope.app.twisted/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/zope.app.twisted" }, "release_url": "https://pypi.org/project/zope.app.twisted/3.5.0/", "requires_dist": null, "requires_python": null, "summary": "Twisted Integration for Zope 3 Applications", "version": "3.5.0" }, "last_serial": 805241, "releases": { "3.4.0": [ { "comment_text": "", "digests": { "md5": "497254c2c5e598f4ad08a55e98425298", "sha256": "74cfec616113b46c35b241b26637bdf5779db282ee24c0130c9cc3cbc9fa3a1c" }, "downloads": -1, "filename": "zope.app.twisted-3.4.0.tar.gz", "has_sig": false, "md5_digest": "497254c2c5e598f4ad08a55e98425298", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1716156, "upload_time": "2007-10-30T00:01:10", "url": "https://files.pythonhosted.org/packages/f2/6f/3dc31cb41f63fe8c743bd4308b842679abdad80f46faa413d33d4ed63d09/zope.app.twisted-3.4.0.tar.gz" } ], "3.4.0a1": [ { "comment_text": "", "digests": { "md5": "a35d4dde2c3dc3d46f9d34431d544434", "sha256": "4b7e14397b55d02cacaca05f0453c681331d560c9147c426e8bda69aade97f08" }, "downloads": -1, "filename": "zope.app.twisted-3.4.0a1.tar.gz", "has_sig": false, "md5_digest": "a35d4dde2c3dc3d46f9d34431d544434", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1724983, "upload_time": "2007-04-23T13:33:22", "url": "https://files.pythonhosted.org/packages/04/d2/a160dea5e34dea1eea349552ae7755d24a2796d05f9dc91e89d7f277586c/zope.app.twisted-3.4.0a1.tar.gz" } ], "3.4.1": [ { "comment_text": "", "digests": { "md5": "609fed7465db4930a7507991208d2033", "sha256": "d4d650e7e14e7278f489ece49279302e8044344c1b9cef48e17133047d7604f6" }, "downloads": -1, "filename": "zope.app.twisted-3.4.1.tar.gz", "has_sig": false, "md5_digest": "609fed7465db4930a7507991208d2033", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1716631, "upload_time": "2008-02-02T11:49:05", "url": "https://files.pythonhosted.org/packages/23/98/103106c40f78a4ef3769d87601eca92dcd26696c038f253c652f002f64f9/zope.app.twisted-3.4.1.tar.gz" } ], "3.4.2": [ { "comment_text": "", "digests": { "md5": "effe14253244004a8973f8012a7c05ec", "sha256": "4e30effb266dc281cc84d0c2b8ecf841232af70544197331a214c55b782664c9" }, "downloads": -1, "filename": "zope.app.twisted-3.4.2.tar.gz", "has_sig": false, "md5_digest": "effe14253244004a8973f8012a7c05ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1714167, "upload_time": "2009-01-27T10:38:47", "url": "https://files.pythonhosted.org/packages/58/4e/708873994b58beab01942b516db324015971101aca10e6ad347a27f0e951/zope.app.twisted-3.4.2.tar.gz" } ], "3.5.0": [ { "comment_text": "", "digests": { "md5": "9e98868b8be8a0c4f720036366364a67", "sha256": "82fc7dd7a3745d1dce2d0f29056efea8ac9df53eb9107e20e511f787923d6b5d" }, "downloads": -1, "filename": "zope.app.twisted-3.5.0.tar.gz", "has_sig": false, "md5_digest": "9e98868b8be8a0c4f720036366364a67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1730007, "upload_time": "2009-07-24T10:08:01", "url": "https://files.pythonhosted.org/packages/11/0c/b2b24353d95a897c8739ef21297082af95950f1c79e5e4b08d86010a533f/zope.app.twisted-3.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e98868b8be8a0c4f720036366364a67", "sha256": "82fc7dd7a3745d1dce2d0f29056efea8ac9df53eb9107e20e511f787923d6b5d" }, "downloads": -1, "filename": "zope.app.twisted-3.5.0.tar.gz", "has_sig": false, "md5_digest": "9e98868b8be8a0c4f720036366364a67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1730007, "upload_time": "2009-07-24T10:08:01", "url": "https://files.pythonhosted.org/packages/11/0c/b2b24353d95a897c8739ef21297082af95950f1c79e5e4b08d86010a533f/zope.app.twisted-3.5.0.tar.gz" } ] }