From 11709b21bd6b74250e9920eab6a4b937a34bde12 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 22 May 2013 05:51:33 -0700 Subject: [PATCH] remove redundant parameters --- xwords4/relay/scripts/gcm_loop.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/xwords4/relay/scripts/gcm_loop.py b/xwords4/relay/scripts/gcm_loop.py index 22f2c5e3d..e16f0eadc 100755 --- a/xwords4/relay/scripts/gcm_loop.py +++ b/xwords4/relay/scripts/gcm_loop.py @@ -109,12 +109,12 @@ def asGCMIds(con, devids, typ): cur.execute( query ) return [elem[0] for elem in cur.fetchall()] -def notifyGCM( target, devids, typ, msg, connname, hid ): +def notifyGCM( devids, typ, target ): success = False if typ == DEVTYPE_GCM: if 3 <= target['clntVers']: - connname = "%s/%d" % (connname, hid) - data = { 'msg64': msg, + connname = "%s/%d" % (target['connname'], target['hid']) + data = { 'msg64': target['msg64'], 'connname': connname, } else: @@ -235,12 +235,8 @@ def main(): toDelete = [] for devid in targets.keys(): target = targets[devid] - connname = target['connname'] - hid = target['hid'] - msg = target['msg64'] - if notifyGCM( target, asGCMIds( g_con, [devid], typ ), \ - typ, msg, connname, hid ) \ - and 3 <= target['clntVers']: + if notifyGCM( asGCMIds(g_con, [devid], typ), typ, target )\ + and 3 <= target['clntVers']: toDelete.append( str(target['id']) ) pruneSent( devids ) deleteMsgs( g_con, toDelete )