Differences between version dated 2005-04-15 20:21:07 and 2007-03-26 18:24:48
(spanning 4 versions)
Deletions are marked like this.
Additions are marked like this.
method tells the reactor to listen with the given server object and
port number.
If saved in a file called ``twist_it.py``, this code can be run as
If saved in a file called ``twistedpeak.py``, this code can be run as
follows (on Unix/Linux systems)::
PYTHONPATH=. peak import:twist_it.App
PYTHONPATH=. peak import:twistedpeak.App
The example client code from the HOWTO works exactly the same::
This code can be used as a starting point for any kind of Twisted
application.
Configuration
-------------
Configuration and Binding
-------------------------
TODO
The code above is slightly longer than the example shown in the HOWTO,
but because of PEAK's component-oriented features, especially its
configuration and binding facilities, it is much more flexible. Since
``commands.EventDriven`` is a descendent of PEAK's base component
class, the ``App`` class is also a component class. This primarily
means two things:
- instances of it can be located in a hierarchy of other components;
components can find each other in various ways without needing to
know anything about the structure of the application as a
whole. This promotes loose coupling, which can lead to more flexible
applications and more reusable code. Components can optionally
"offer" their properties for use by other components in the system.
- component objects are easily configurable by various means,
including external configuration files (.ini-style, ZConfig),
internally via "property names", and through keyword parameters when
directly instantiated.
A component hierarchy always has a "root" object. In our example the
root object is created by the ``peak`` script, which is installed to
an executable directory by PEAK's ``setup.py`` installer script. The
``peak`` script is a simple launcher which takes a URL-like recipe for
finding a "runnable" object to load and run.
...
Notes
-----
code, config files, and shell scripts, the page was no longer usable.
-- John Landahl, March 2005.
{{{