fix call to storeHudCache in Database to use handStartTime rather than the undefined hand_start_time; stub out store_hands_players_stud_tourney as it looks like it was never updated to use current database setup. result: hud works, no longer crashes import, presumably does not store any hand info though.
HHC base guessMaxSeats returns existing value of maxseats if some prior code has set it somewhere already
Affected files:
* Configuration.py
* Database.py
* HandHistoryConverter.py
* fpdb_import.py
and setup.py to a lesser extent.
Logging requires a configuration file when initialising the class. If we
are executing from outside the source tree, this file is not present.
Catch config parser's error and try to provide the logging config file
from debian package path.
Update symlink target to match python-support from latest Debian and the
oncoming Ubuntu versions.
Cleaned up storeHandsPlayers and added storeHudCacheNew
Haven't decided on the data structures to be passed in as yet so the functions only insert the bare minimum and have a list of commented out variables
Conflicts:
pyfpdb/Database.py
Resolve by reverting to sqlcoder's version; it uses the nice insert in
fillDefaultData for each case now and having the DB backends separate
might be good for the foreseeable future.
Database.py : fillDefaultData()
Remove manual 'id' from INSERT command. In database schema,
TourneyTypes.id is a primary key and thus autoincrement. In postgres,
autoincrements are implemented as sequences - inserting a value
"manually" bypasses the sequence generation, which resulted in a
remarkably weird error.
Namely, upon the first hand to import, the insert fails due to primary
key violation. The default value from an unused sequence is 1, but a
row with such an id already exists.
The solution is to create the single row of default data values with
unspecified TourneyTypes.id, hence allowing postgres to generate the
correct id from the sequence. This way the import works again.
Database.py : fillDefaultData()
Sql-coder had fixed the default data insert, and in the process changed
the default type ID. Since his works in general case, I can remove my
modifications.
* Database.py : fillDefaultData()
PostgreSQL has a rather annoying (mis)feature when dealing with boolean
data types: raw 1/0 input as integer is not automatically cast to
boolean values. Instead, one must use one of several other ways of
signifying true/false.
http://www.postgresql.org/docs/8.4/static/datatype-boolean.html
documents the available and understood formatting.
Fix by special-casing PostgreSQL and making all boolean values fed as
strings, '1' for true and '0' for false.
modified: Database.py
* correct the HandsPlayers.tourneyTypeId entry (null for omaha/he ring games, correct value instead of 1 or null for omaha/he & stud tourneys)
* add prototypes and description of new methods to store Tourneys info
modified: Tourney.py
* add calls to new methods in Tourney.insert
modified: Database.py
* fillDefaultData : queries that inserts the default line into TourneyTypes rewritten (simplified to take into account the columns that have "new" DEFAULT attribute)
modified: SQL.py
* createTourneyTypesTable query modified : some existing columns are now created with a default values, new columns added
* createTourneysTable query modified : new columns added
* createTourneysPlayersTable query modified : new columns added
Database: Add Absolute to sites
GuiPlayerStats: set avgseats to False
Hand: Add Absolute to SITEIDS list
fpdb_import: check for presence of settings['dropHudCache'] before testing it, to keep command line import from erroring
Added getSqlPlayerIDs to Database.py - returns a hash {playername:sqlid}
Function uses a caching hash in Database.py to reduce the number of round trips to the database needed just to fetch the player ids for later inserts.
Need to do a performance comparison on a larger import.