From 1de35b2f01eeea86c6eb51780425cda89d8f3f3e Mon Sep 17 00:00:00 2001 From: eblade Date: Sat, 28 Mar 2009 12:30:57 -0400 Subject: [PATCH 1/3] merge error indentation fix --- pyfpdb/fpdb_simple.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index 4020c430..b931e46b 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -1412,11 +1412,11 @@ def recognisePlayerIDs(cursor, names, site_id): ids = dict(cursor.fetchall()) # convert to dict if len(ids) != len(names): notfound = [n for n in names if n not in ids] # make list of names not in database - if notfound: # insert them into database - cursor.executemany("INSERT INTO Players (name, siteId) VALUES (%s, "+str(site_id)+")", (notfound)) - q2 = "SELECT name,id FROM Players WHERE name=%s" % " OR name=".join(["%s" for n in notfound]) - cursor.execute(q2, notfound) # get their new ids - tmp = dict(cursor.fetchall()) + if notfound: # insert them into database + cursor.executemany("INSERT INTO Players (name, siteId) VALUES (%s, "+str(site_id)+")", (notfound)) + q2 = "SELECT name,id FROM Players WHERE name=%s" % " OR name=".join(["%s" for n in notfound]) + cursor.execute(q2, notfound) # get their new ids + tmp = dict(cursor.fetchall()) for n in tmp: # put them all into the same dict ids[n] = tmp[n] # return them in the SAME ORDER that they came in in the names argument, rather than the order they came out of the DB From 2b97b4e6357d896db7345ed59ad6a120e1b65a49 Mon Sep 17 00:00:00 2001 From: eblade Date: Sat, 28 Mar 2009 12:47:46 -0400 Subject: [PATCH 2/3] i'm apparently retarded today --- pyfpdb/fpdb_simple.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index b931e46b..b9d914b2 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -1417,8 +1417,8 @@ def recognisePlayerIDs(cursor, names, site_id): q2 = "SELECT name,id FROM Players WHERE name=%s" % " OR name=".join(["%s" for n in notfound]) cursor.execute(q2, notfound) # get their new ids tmp = dict(cursor.fetchall()) - for n in tmp: # put them all into the same dict - ids[n] = tmp[n] + for n in tmp: # put them all into the same dict + ids[n] = tmp[n] # return them in the SAME ORDER that they came in in the names argument, rather than the order they came out of the DB return [ids[n] for n in names] #end def recognisePlayerIDs From e99badf69d5754156abdd1e604337c0e0f24222d Mon Sep 17 00:00:00 2001 From: eblade Date: Sat, 28 Mar 2009 14:31:44 -0400 Subject: [PATCH 3/3] add one to seat adjustment index in update_table_position --- pyfpdb/Hud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 804d8ed2..b2266213 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -176,7 +176,7 @@ class Hud: loc = self.config.get_locations(self.table.site, self.max) # TODO: is stat_windows getting converted somewhere from a list to a dict, for no good reason? for i, w in enumerate(self.stat_windows.itervalues()): - (x, y) = loc[adj[i]] + (x, y) = loc[adj[i+1]] w.relocate(x, y) return True