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

« back to all changes in this revision

Viewing changes to twisted/spread/ui/gtkutil.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2004-06-21 22:01:11 UTC
  • mto: (2.2.3 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040621220111-vkf909euqnyrp3nr
Tags: upstream-1.3.0
ImportĀ upstreamĀ versionĀ 1.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import string
20
20
 
21
21
from twisted.spread import pb
22
 
from twisted.internet import tcp
23
22
from twisted import copyright
24
23
from twisted.python import reflect
 
24
from twisted.cred.credentials import UsernamePassword
25
25
 
26
26
normalFont = gtk.load_font("-adobe-courier-medium-r-normal-*-*-120-*-*-m-*-iso8859-1")
27
27
boldFont = gtk.load_font("-adobe-courier-bold-r-normal-*-*-120-*-*-m-*-iso8859-1")
186
186
        self.service_tx = service
187
187
        self.perspective_tx = perspective or user
188
188
        afterOneTimeout(10, self.__actuallyConnect)
 
189
    
189
190
    def __actuallyConnect(self):
190
 
        pb.connect(self.host_tx, self.port_tx, self.user_tx, self.pswd_tx,
191
 
                   self.service_tx, self.perspective_tx, self.pbReferenceable, 30).addCallbacks(
192
 
            self.pbCallback, self.couldNotConnect)
 
191
        from twisted.application import internet
 
192
 
 
193
        f = pb.PBClientFactory()
 
194
        internet.TCPClient(self.host_tx, self.port_tx, f)
 
195
        creds = UsernamePassword(self.user_tx, self.pswd_tx)
 
196
        f.login(creds, self.pbReferenceable
 
197
            ).addCallbacks(self.pbCallback, self.couldNotConnect
 
198
            ).setTimeout(30
 
199
            )
193
200
 
194
201
    def couldNotConnect(self, msg):
195
202
        self.loginReport("couldn't connect: %s" % str(msg))