Merge branch 'master' of git://git.assembla.com/fpdb-sql

This commit is contained in:
Worros 2010-06-08 13:17:20 +08:00
commit 5f1308688b
10 changed files with 1092 additions and 1059 deletions

View File

@ -1056,7 +1056,7 @@ class Database:
key = "`" + inner[j][0] + "_" + m.group() + "`"
c.execute("ALTER TABLE " + inner[j][0] + " DROP FOREIGN KEY " + key)
self.commit()
#end drop_referential_inegrity
#end drop_referential_inegrity
def recreate_tables(self):
"""(Re-)creates the tables of the current DB"""

View File

@ -88,7 +88,7 @@ class Filters(threading.Thread):
if len(result) == 1:
self.siteid[site] = result[0][0]
else:
print "Either 0 or more than one site matched - EEK"
print "Either 0 or more than one site matched (%s) - EEK" % site
# For use in date ranges.
self.start_date = gtk.Entry(max=12)

View File

@ -199,10 +199,10 @@ class GuiAutoImport (threading.Thread):
bs = 0
elif os.name == 'nt':
path = sys.path[0].replace('\\','\\\\')
command = 'python "'+path+'\\HUD_main.py" ' + self.settings['cl_options']
command = 'pythonw "'+path+'\\HUD_main.pyw" ' + self.settings['cl_options']
bs = 0
else:
command = os.path.join(sys.path[0], 'HUD_main.py')
command = os.path.join(sys.path[0], 'HUD_main.pyw')
command = [command, ] + string.split(self.settings['cl_options'])
bs = 1
@ -210,7 +210,12 @@ class GuiAutoImport (threading.Thread):
print "opening pipe to HUD"
self.pipe_to_hud = subprocess.Popen(command, bufsize=bs,
stdin=subprocess.PIPE,
universal_newlines=True)
stdout=subprocess.PIPE, # only needed for py2exe
stderr=subprocess.PIPE, # only needed for py2exe
universal_newlines=True
)
self.pipe_to_hud.stdout.close()
self.pipe_to_hud.stderr.close()
except:
err = traceback.extract_tb(sys.exc_info()[2])[-1]
#self.addText( "\n*** GuiAutoImport Error opening pipe: " + err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1]))

View File

@ -55,11 +55,11 @@ class Sql:
# List indexes
################################
if db_server == 'mysql':
self.query['list_tables'] = """SHOW INDEXES"""
self.query['list_indexes'] = """SHOW INDEXES"""
elif db_server == 'postgresql':
self.query['list_tables'] = """SELECT tablename, indexname FROM PG_INDEXES"""
self.query['list_indexes'] = """SELECT tablename, indexname FROM PG_INDEXES"""
elif db_server == 'sqlite':
self.query['list_tables'] = """SELECT name FROM sqlite_master
self.query['list_indexes'] = """SELECT name FROM sqlite_master
WHERE type='index'
ORDER BY name;"""

File diff suppressed because it is too large Load Diff

1064
pyfpdb/fpdb.pyw Executable file

File diff suppressed because it is too large Load Diff

View File

@ -130,8 +130,8 @@ setup(
description = 'Free Poker DataBase',
version = '0.12',
console = [ {'script': 'fpdb.py', "icon_resources": [(1, "../gfx/fpdb_large_icon.ico")]},
{'script': 'HUD_main.py', },
windows = [ {'script': 'fpdb.pyw', "icon_resources": [(1, "../gfx/fpdb_large_icon.ico")]},
{'script': 'HUD_main.pyw', },
{'script': 'Configuration.py', }
],

View File

@ -3,5 +3,5 @@ rem .bat script to run fpdb
cd pyfpdb
fpdb.exe
start /b fpdb.exe >..\fpdb_output.txt

View File

@ -21,13 +21,10 @@ import sys
# sys.path[0] holds the directory run_fpdb.py is in
sys.path[0] = sys.path[0]+os.sep+"pyfpdb"
# cd to pyfpdb subdir
os.chdir(sys.path[0])
#print "sys.path[0] =", sys.path[0], "cwd =", os.getcwd()
import fpdb
if __name__ == "__main__":
me = fpdb.fpdb()
me.main()
exit()
os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ)
# first arg is ignored (name of program being run)