~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

Viewing changes to doc/howto/tutorial/listings/finger/finger19b.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-17 14:52:35 UTC
  • mfrom: (1.1.5 upstream) (2.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20070117145235-btmig6qfmqfen0om
Tags: 2.5.0-0ubuntu1
New upstream version, compatible with python2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Do everything properly, and componentize
2
2
from twisted.application import internet, service
3
3
from twisted.internet import protocol, reactor, defer, utils
4
 
from twisted.protocols import basic, irc
 
4
from twisted.words.protocols import irc
 
5
from twisted.protocols import basic
5
6
from twisted.python import components
6
7
from twisted.web import resource, server, static, xmlrpc
7
8
from zope.interface import Interface, implements
10
11
 
11
12
class IFingerService(Interface):
12
13
 
13
 
    def getUser(self, user):
 
14
    def getUser(user):
14
15
        """Return a deferred returning a string"""
15
16
 
16
 
    def getUsers(self):
 
17
    def getUsers():
17
18
        """Return a deferred returning a list of strings"""
18
19
 
19
20
class IFingerSetterService(Interface):
20
21
 
21
 
    def setUser(self, user, status):
 
22
    def setUser(user, status):
22
23
        """Set the user's status to something"""
23
24
 
24
25
class IFingerSetterService(Interface):
25
26
 
26
 
    def setUser(self, user, status):
 
27
    def setUser(user, status):
27
28
        """Set the user's status to something"""
28
29
 
29
30
def catchError(err):
42
43
 
43
44
class IFingerFactory(Interface):
44
45
 
45
 
    def getUser(self, user):
 
46
    def getUser(user):
46
47
        """Return a deferred returning a string"""
47
48
 
48
 
    def buildProtocol(self, addr):
 
49
    def buildProtocol(addr):
49
50
        """Return a protocol returning a string"""
50
51
 
51
52
 
80
81
 
81
82
class IFingerSetterFactory(Interface):
82
83
 
83
 
    def setUser(self, user, status):
 
84
    def setUser(user, status):
84
85
        """Return a deferred returning a string"""
85
86
 
86
 
    def buildProtocol(self, addr):
 
87
    def buildProtocol(addr):
87
88
        """Return a protocol returning a string"""
88
89
 
89
90
 
125
126
    @ivar nickname
126
127
    """
127
128
 
128
 
    def getUser(self, user):
 
129
    def getUser(user):
129
130
        """Return a deferred returning a string"""
130
131
 
131
 
    def buildProtocol(self, addr):
 
132
    def buildProtocol(addr):
132
133
        """Return a protocol"""
133
134
 
134
135