Skip to content

Commit

Permalink
i take that back; allowNone now has to be specified in the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ssutch committed Feb 23, 2012
1 parent f8e8197 commit 92d31c7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pyapns/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,10 @@ def cancel_timeout(r):

class APNSServer(xmlrpc.XMLRPC):
def __init__(self):
# self.allowNone = True
# self.allow_none = True
self.app_ids = app_ids
self.use_date_time = True
self.useDateTime = True
xmlrpc.XMLRPC.__init__(self, allow_none=True)
xmlrpc.XMLRPC.__init__(self, allowNone=True)

def apns_service(self, app_id):
if app_id not in app_ids:
Expand Down Expand Up @@ -274,7 +272,6 @@ def xmlrpc_provision(self, app_id, path_to_cert_or_cert, environment, timeout=15
if not app_id in self.app_ids:
# log.msg('provisioning ' + app_id + ' environment ' + environment)
self.app_ids[app_id] = APNSService(path_to_cert_or_cert, environment, timeout)
return 'provisioned'

def xmlrpc_notify(self, app_id, token_or_token_list, aps_dict_or_list):
""" Sends push notifications to the Apple APNS server. Multiple
Expand All @@ -301,7 +298,7 @@ def _finish_err(r):
# that are made unsuccessfully, which twisted will try endlessly
# to reconnect to, we timeout and notifify the client
raise xmlrpc.Fault(500, 'Connection to the APNS server could not be made.')
return d.addCallbacks(lambda r: 'sent', _finish_err)
return d.addCallbacks(lambda r: None, _finish_err)

def xmlrpc_feedback(self, app_id):
""" Queries the Apple APNS feedback server for inactive app tokens. Returns
Expand Down

0 comments on commit 92d31c7

Please sign in to comment.