def whenReady(d):
 d2 = defer.Deferred()
 d.addCallbacks(_pubReady, d2.errback, callbackArgs=(d2,))
 return d2

def whenReady ( d ) : d2 = defer . Deferred ( ) d . addCallbacks ( _pubReady , d2 . errback , callbackArgs = ( d2 , ) ) return d2
wrap a deferred returned from a pb method in another deferred that expects a remotepublished as a result .