p116 - fixed bug in fpdb_import.py that prevented it from running directly

This commit is contained in:
steffen123 2008-10-05 05:33:22 +01:00
parent 1cd9eb898f
commit 2ab942128b
2 changed files with 9 additions and 10 deletions

View File

@ -1,11 +1,10 @@
Everything is subject to change and the order does not indicate priority. Patches for any of these or other features are very welcome, see readme-overview.txt for contacts.
Please also see db-todo.txt
alpha6 (release 3Oct-10Oct)
alpha7 (release 11Oct-17Oct)
======
pgsql recreate doesnt work, and it may not store version field on creation if using sql file with pgadmin.
(carl i think) pgsql recreate doesnt work, and it may not store version field on creation if using sql file with pgadmin.
check we're reading mucked cards from PS
ebuild: support pgsql
fix HUD config location and update release script accordingly
(michael) update website for windows installer
@ -30,15 +29,15 @@ debian/ubuntu package http://www.debian.org/doc/maint-guide/ch-start.en.html
howto remote DB
move all user docs to webpage
(steffen) contributor list on webpage
finish bringing back tourney
stud/razz tourneys,
No river stats for stud games?
hole/board cards are not correctly stored in the db for stud games
HORSE (and presumably other mixed games) hand history files not handled correctly
Some MTTs won't import (rebuys??)
Many STTs won't import
rebuy/addon tourney support
before beta
===========
ebuild: support pgsql
autoimport doesnt seem to work with just one hand in the file
make Database.py display error if wrong or missing db lib
Import draw (maybe without HudCache for a start)

View File

@ -56,17 +56,17 @@ def import_file_dict(options, settings, callHud=False):
inputFile=open(options.inputFile, "rU")
#connect to DB
if options.settings['db-backend'] == 2:
if settings['db-backend'] == 2:
if not mysqlLibFound:
raise fpdb_simple.FpdbError("interface library MySQLdb not found but MySQL selected as backend - please install the library or change the config file")
db = MySQLdb.connect(host = options.server, user = options.user,
passwd = options.password, db = options.database)
elif options.settings['db-backend'] == 3:
elif settings['db-backend'] == 3:
if not pgsqlLibFound:
raise fpdb_simple.FpdbError("interface library psycopg2 not found but PostgreSQL selected as backend - please install the library or change the config file")
db = psycopg2.connect(host = options.server, user = options.user,
password = options.password, database = options.database)
elif options.settings['db-backend'] == 4:
elif settings['db-backend'] == 4:
pass
else:
pass
@ -224,5 +224,5 @@ if __name__ == "__main__":
(options, sys.argv) = parser.parse_args()
settings={'imp-callFpdbHud':False}
settings={'imp-callFpdbHud':False, 'db-backend':2}
import_file_dict(options, settings, False)