mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
get postgres port from config; send connname only if present
This commit is contained in:
parent
8fa5e3e4bd
commit
2cad611ec4
1 changed files with 4 additions and 5 deletions
|
@ -39,7 +39,7 @@ LINE_LEN = 76
|
|||
def init():
|
||||
global g_sent
|
||||
try:
|
||||
con = psycopg2.connect(database='xwgames', user=getpass.getuser())
|
||||
con = psycopg2.connect(port=mykey.psqlPort, database='xwgames', user=getpass.getuser())
|
||||
except psycopg2.DatabaseError, e:
|
||||
print 'Error %s' % e
|
||||
sys.exit(1)
|
||||
|
@ -113,10 +113,9 @@ def notifyGCM( devids, typ, target ):
|
|||
success = False
|
||||
if typ == DEVTYPE_GCM:
|
||||
if 3 <= target['clntVers'] and target['msg64']:
|
||||
connname = "%s/%d" % (target['connname'], target['hid'])
|
||||
data = { 'msgs64': [ target['msg64'] ],
|
||||
'connname': connname,
|
||||
}
|
||||
data = { 'msgs64': [ target['msg64'] ] }
|
||||
if target['connname'] and target['hid']:
|
||||
data['connname'] = "%s/%d" % (target['connname'], target['hid'])
|
||||
else:
|
||||
data = { 'getMoves': True, }
|
||||
values = {
|
||||
|
|
Loading…
Add table
Reference in a new issue