Author: johnnyg
Revision: 5549
Log:
Use the deferred returned by getPage in test_listen_port.
Diff:
Modified: trunk/deluge/core/core.py
===================================================================
--- trunk/deluge/core/core.py 2009-07-25 00:41:20 UTC (rev 5548)
+++ trunk/deluge/core/core.py 2009-07-25 00:54:56 UTC (rev 5549)
@@ -774,16 +774,13 @@
"""
from twisted.web.client import getPage
- d = defer.Deferred()
- gp = getPage("http://deluge-torrent.org/test_port.php?port=%s" %
self.get_listen_port())
+ d = getPage("http://deluge-torrent.org/test_port.php?port=%s" %
self.get_listen_port())
def on_get_page(result):
- d.callback(bool(int(result)))
- def on_get_page_failure(result):
- d.errback(result)
+ return bool(int(result))
- gp.addCallbacks(on_get_page, on_get_page_failure)
+ d.addCallback(on_get_page)
return d
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---