Created
July 24, 2012 17:12
-
-
Save ikeikeikeike/3171259 to your computer and use it in GitHub Desktop.
callback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Callback(object): | |
""" for callback """ | |
def __init__(self, app, tokens, notifications): | |
self._app = app | |
self._tokens = tokens | |
self._notifications = notifications | |
def errback(self, err): | |
""" err | |
:param object err: Exception or xmlrpclib.Fault object | |
""" | |
# str(err) | |
# traceback.format_exc(sys.exc_info()[2])) | |
def success(self, *args, **kwargs): | |
pass | |
def callback(self, *args, **kwargs): | |
""" notify! """ | |
notify(self._app, self._tokens, self._notifications, | |
async=True, callback=self.success, errback=self.errback) | |
c = Callback(app=app, tokens=tokens, notifications=notifications) | |
provision(app, cert, env, async=True, callback=c.callback, errback=c.errback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment