Merge branch 'master' of git://git.assembla.com/free_poker_tools
This commit is contained in:
@@ -213,7 +213,7 @@ class Import:
|
||||
self.callFpdbHud = node.getAttribute("callFpdbHud")
|
||||
self.hhArchiveBase = node.getAttribute("hhArchiveBase")
|
||||
self.saveActions = fix_tf(node.getAttribute("saveActions"), True)
|
||||
self.fastStoreHudCache = fix_tf(node.getAttribute("fastStoreHudCache"), True)
|
||||
self.fastStoreHudCache = fix_tf(node.getAttribute("fastStoreHudCache"), False)
|
||||
|
||||
def __str__(self):
|
||||
return " interval = %s\n callFpdbHud = %s\n hhArchiveBase = %s\n saveActions = %s\n fastStoreHudCache = %s\n" \
|
||||
|
||||
Executable → Regular
+2
-4
@@ -208,9 +208,7 @@ class GuiBulkImport():
|
||||
self.lab_drop.set_sensitive(False)
|
||||
|
||||
def main(argv=None):
|
||||
"""main can also be called in the python interpreter, by supplying the command line as the argument.
|
||||
>>>import GuiBulkImport
|
||||
>>>GuiBulkImport.main(['-f'.'~/data/hands'])"""
|
||||
"""main can also be called in the python interpreter, by supplying the command line as the argument."""
|
||||
if argv is None:
|
||||
argv = sys.argv[1:]
|
||||
|
||||
@@ -244,7 +242,7 @@ def main(argv=None):
|
||||
settings.update(config.get_default_paths())
|
||||
|
||||
if not options.gui:
|
||||
print """-q is deprecated. Just use "-f filename" instead"""
|
||||
print '-q is deprecated. Just use "-f filename" instead'
|
||||
# This is because -q on its own causes an error, so -f is necessary and sufficient for cmd line use
|
||||
if not options.filename:
|
||||
i = GuiBulkImport(db, settings, config)
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
+16
-3
@@ -163,9 +163,9 @@ def prepareBulkImport(fdb):
|
||||
# DON'T FORGET TO RECREATE THEM!!
|
||||
#print "dropping pg fk", fk['fktab'], fk['fkcol']
|
||||
try:
|
||||
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
||||
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
|
||||
fdb.cursor.execute("alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']))
|
||||
print "dropped pg fk pg fk %s_%s_fkey" % (fk['fktab'], fk['fkcol'])
|
||||
print "dropped pg fk pg fk %s_%s_fkey" % (fk['fktab'], fk['fkcol'])
|
||||
except:
|
||||
print "! failed drop pg fk %s_%s_fkey" % (fk['fktab'], fk['fkcol'])
|
||||
else:
|
||||
@@ -1392,6 +1392,20 @@ def recogniseTourneyTypeId(cursor, siteId, buyin, fee, knockout, rebuyOrAddon):
|
||||
# { playername: id } instead of depending on it's relation to the positions list
|
||||
# then this can be reduced in complexity a bit
|
||||
|
||||
#def recognisePlayerIDs(cursor, names, site_id):
|
||||
# result = []
|
||||
# for i in xrange(len(names)):
|
||||
# cursor.execute ("SELECT id FROM Players WHERE name=%s", (names[i],))
|
||||
# tmp=cursor.fetchall()
|
||||
# if (len(tmp)==0): #new player
|
||||
# cursor.execute ("INSERT INTO Players (name, siteId) VALUES (%s, %s)", (names[i], site_id))
|
||||
# #print "Number of players rows inserted: %d" % cursor.rowcount
|
||||
# cursor.execute ("SELECT id FROM Players WHERE name=%s", (names[i],))
|
||||
# tmp=cursor.fetchall()
|
||||
# #print "recognisePlayerIDs, names[i]:",names[i],"tmp:",tmp
|
||||
# result.append(tmp[0][0])
|
||||
# return result
|
||||
|
||||
def recognisePlayerIDs(cursor, names, site_id):
|
||||
q = "SELECT name,id FROM Players WHERE name=%s" % " OR name=".join(["%s" for n in names])
|
||||
cursor.execute(q, names) # get all playerids by the names passed in
|
||||
@@ -1405,7 +1419,6 @@ def recognisePlayerIDs(cursor, names, site_id):
|
||||
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
|
||||
return [ids[n] for n in names]
|
||||
#end def recognisePlayerIDs
|
||||
|
||||
Reference in New Issue
Block a user