Skip to content

Instantly share code, notes, and snippets.

@ikeikeikeike
Created July 24, 2012 17:12
Show Gist options
  • Save ikeikeikeike/3171259 to your computer and use it in GitHub Desktop.
Save ikeikeikeike/3171259 to your computer and use it in GitHub Desktop.
callback
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