Commit Graph

204 Commits

Author SHA1 Message Date
Worros
230eb32615 Merge branch 'master' of git://git.assembla.com/fpdb-sql 2009-10-06 11:11:58 +08:00
sqlcoder
8851b141a2 add dropdown to player name in filter 2009-10-05 22:12:35 +01:00
sqlcoder
5a0c83b60a debug session stats 2009-10-03 23:11:45 +01:00
Mika Bostrom
e4969820b8 Merge branch 'master' of git://trac-git.assembla.com/fpdb-sql 2009-09-30 20:27:17 +03:00
sqlcoder
2b7a42bf1d fix bug for tourneys in new code, modify part of hud menu to use checkmenuitems 2009-09-29 23:34:52 +01:00
Mika Bostrom
432c24173e Merge branch 'master' of git://trac-git.assembla.com/fpdb-sql 2009-09-29 09:11:33 +03:00
sqlcoder
16f8fffd68 add separate hud config for user and allow some user config in HUD menu (opponents still only via editing HUD_main.py) 2009-09-28 23:59:17 +01:00
Mika Bostrom
5260f5c384 Merge branch 'master' of git://trac-git.assembla.com/fpdb-sql
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.
2009-09-28 18:07:08 +03:00
sqlcoder
b6ea02fd43 improve tourney importing 2009-09-28 00:44:55 +01:00
sqlcoder
7f47a753db cosmetic change to comment 2009-09-27 21:21:26 +01:00
sqlcoder
8353d0739b improve hudcache recalc when db is empty and avoid mysql long int problem 2009-09-27 13:36:45 +01:00
sqlcoder
01c33c26f8 fix tourneytypes insert for postgres again 2009-09-27 12:47:21 +01:00
sqlcoder
9a7d7267ff remove print 2009-09-27 10:42:33 +01:00
sqlcoder
6f75719ffe refine hero's player id derivation in empty db's 2009-09-27 02:06:07 +01:00
sqlcoder
c1711c4e2e refine new date option on hudcache rebuild 2009-09-27 01:42:26 +01:00
sqlcoder
e75d915120 allow hudcache rebuild to only start Hero's stats from chosen date :-) 2009-09-26 23:32:44 +01:00
sqlcoder
518fd9e039 merge from Eric 2009-09-26 11:45:05 +01:00
sqlcoder
ea74862a5a start changes to allow different hud choices for hero and opponents 2009-09-26 11:30:12 +01:00
sqlcoder
3d301718ae create/alter unique indexes and change inserts into tourneytypes and tourneysplayers 2009-09-25 23:10:58 +01:00
sqlcoder
a67830d92e 2 changes: move recognisePlayerIDs from fpdb_simple into Database, and make index on siteTourneyNo on Tourneys table unique and refine store_tourneys function to handle this 2009-09-24 02:12:04 -04:00
Mika Bostrom
6f536d29e7 Fix import on PostgreSQL
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.
2009-09-24 07:08:32 +03:00
sqlcoder
23f56ea2ae 2 changes: move recognisePlayerIDs from fpdb_simple into Database, and make index on siteTourneyNo on Tourneys table unique and refine store_tourneys function to handle this 2009-09-23 23:03:34 +01:00
Mika Bostrom
00f8b34fff Simplify database creation
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.
2009-09-23 23:36:17 +03:00
Worros
a20bfe0921 Merge branch 'master' of git://git.assembla.com/fpdb-sql 2009-09-23 13:22:45 +08:00
Worros
4e361e383c Merge branch 'master' of git://repo.or.cz/fpbd-bostik 2009-09-23 13:22:35 +08:00
sqlcoder
e080ec3fd1 further fix to tourneytypes insert for postgres 2009-09-22 22:08:42 +01:00
sqlcoder
455e92e6f6 fix tourneytypes insert for postgres 2009-09-22 22:04:05 +01:00
Worros
89f86dd32b Merge branch 'master' of git://git.assembla.com/fpdb-eric 2009-09-22 12:35:11 +08:00
Mika Bostrom
1351cd6dd9 Use cleaner syntax in fillDefaultData 2009-09-21 15:31:19 +03:00
Worros
2cea6f01b9 Merge branch 'master' of git://repo.or.cz/fpbd-bostik 2009-09-19 19:25:01 +08:00
Worros
577beed942 Prep new function - commented out for the moment 2009-09-19 19:24:07 +08:00
Mika Bostrom
e54c45b7d1 Fix database creation with Postgres
* 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.
2009-09-19 11:44:06 +03:00
Eric Blade
a1783a37cb reflow init_hud_stat_vars exception handling 2009-09-15 21:04:00 -05:00
Eric Blade
8b19750b1f == None to is None (PEP 8, Style Guide for Python Code) 2009-09-15 19:27:25 -05:00
Eric Blade
4374b6c810 remove Database:__init__ parameters for db_name and game, as there was a comment right next to them # db_name and game not used anymore 2009-09-15 18:49:34 -05:00
Ray
e69cbc30ea Merge branch 'master' of git://git.assembla.com/fpt_fpdb 2009-09-11 10:05:22 -04:00
PassThePeas
49ce7de254 Patch for HandsPlayers.TourneyTypeId not being null (even in ring context) for hudcache / Extend tourneyName size in TourneysTable 2009-09-07 00:18:10 +02:00
Ray
88d33dd4f4 Merge branch 'master' of git://git.assembla.com/mctfpdb 2009-09-04 18:08:06 -04:00
Matt Turnbull
b40132e961 db can be specified in cmd line option again 2009-09-04 22:12:35 +01:00
Ray
d80318d950 Fix small case sensitive bug. 2009-09-04 16:43:55 -04:00
Eric Blade
9fa57b6014 Database: re-write and fix drop_tables
Exceptions: add FpdbDatabaseError
SQL: default all tourneytypeids to 1
fpdb_import: import error tuples set to right size
2009-09-04 06:49:46 -05:00
Worros
4f98b29b26 Merge branch 'master' of git://git.assembla.com/fpt_fpdb
Conflicts:
	pyfpdb/Database.py
2009-09-04 12:45:49 +08:00
PassThePeas
91ebbe79e1 Last part of core tourney import
Database.py : tStoreTourneyPlayers and tUpdateTourneysHandsPlayers implemented
HandHistoryConverter.py : fix for 0-byte summary files
SQL.py : new queries
Tourney.py : cleanup stdout
2009-09-04 02:01:41 +02:00
PassThePeas
d28f56db18 Tourney import : tRecognizeTourney implemented (search, update or insert a Tourney 2009-09-02 22:55:47 +02:00
PassThePeas
b00a58249f Tourney import : tRecogniseTourneyType implemented
modified:   Database.py
	* tRecogniseTourneyType : implemented
	modified:   FulltiltToFpdb.py
	* buyin, fee, rebuyAmount, addOnAmount : converted using fpdb_simple.float2int
	modified:   SQL.py
	* Added queries for Database.tRecogniseTourneyType (getTourneyTypeIdByTourneyNo modified to return all data, getTourneyTypeId and insertTourneyTypes added)
2009-09-01 02:35:52 +02:00
PassThePeas
3323d25ce7 Patch for handsplayers.tourneyTypeId and preparation for Tourney import
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
2009-08-31 01:30:28 +02:00
Matt Turnbull
d2380ba738 merge from futz2 branch 2009-08-28 18:24:51 +01:00
Matt Turnbull
09350e8f52 Database.py - need os. Hand.py - encoding, and writeHTML doesn't need fh 2009-08-28 01:22:08 +01:00
PassThePeas
0217e2320c DB Model changes to prepare for Tourney Summary import
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
2009-08-27 01:41:04 +02:00
Matt Turnbull
29a0ad85c7 full path to logging.config, small fix in Configuration.Database string repr 2009-08-15 22:36:14 +01:00
Worros
5a4bcf3997 Add streetXPot and showdownPot to hhc insert
totalPot not actually calcuated yet, and valued need to be converted from Decimal() to cents
2009-08-12 22:21:54 +08:00
Matt Turnbull
222d713169 too much changes to go into master 2009-08-12 01:46:39 +01:00
Worros
24e5c2252d Fix inserting into Gametypes 2009-08-11 20:52:07 +08:00
Worros
d6529ab42f Import Hand.insert() work
storeHand updated, almost works, just violating some NOT NULL contraints
2009-08-09 01:59:44 +08:00
Worros
5550166f37 Start of storeHand from HHC code
Currently cant actually insert as we need the fk gametypeid
2009-08-08 16:15:36 +08:00
Worros
679393e78d Minor change to insertPlayer() 2009-08-08 14:59:23 +08:00
Worros
470d34c65c Merge branch 'master' of git://github.com/grindi/fpdb-grindi 2009-08-08 13:06:41 +08:00
Worros
08a70b75f2 Fix insertPlayer so that it works again 2009-08-08 12:33:25 +08:00
sqlcoder
d292cd18d4 Merge branch 'master' of git://git.assembla.com/fpdboz 2009-08-07 00:12:22 +01:00
sqlcoder
126dfd7331 get hudcache update to work for sqlite - hud now working! 2009-08-07 00:04:44 +01:00
sqlcoder
6de41be9c9 mainly sqlite fixes, also removed not null on many hudcache columns 2009-08-06 20:31:46 +01:00
grindi
054abfc178 Merge branch 'party'
Conflicts:
	pyfpdb/Database.py
	pyfpdb/Hand.py
	pyfpdb/PartyPokerToFpdb.py
2009-08-06 18:44:03 +04:00
Worros
d043368c88 Prep for PartyPoker plugin add 2009-08-06 20:54:39 +08:00
Worros
5f5825e30b Add additional siteids to default data insert 2009-08-06 10:18:48 +08:00
Worros
2a3a5f0601 Merge branch 'master' of git://git.assembla.com/free_poker_tools
Conflicts:
	pyfpdb/Database.py
2009-08-06 09:20:10 +08:00
eblade
34c469ab3a Add AbsoluteToFpdb.py
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
2009-08-05 21:07:16 -04:00
grindi
ebe652d49e Added PartyPoker into Database.py 2009-08-05 20:58:25 +04:00
sqlcoder
b7a718d786 some more sqlite work 2009-08-04 23:17:31 +01:00
sqlcoder
fe62e78c5b mods for sqlite 2009-08-04 22:06:03 +01:00
Worros
5e66e48b75 Some comments and cleanup to the recent Player insert code 2009-08-04 18:22:29 +08:00
Worros
7050df10c2 Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-08-04 08:34:21 +08:00
sqlcoder
5a94f16d16 fix typo in column name 2009-08-03 19:15:36 +01:00
Worros
47595ecfef Merge branch 'master' of git://git.assembla.com/fpdb-sql 2009-08-03 09:35:37 +08:00
Worros
6781d97539 Remove debug message 2009-08-03 09:35:22 +08:00
sqlcoder
745baf139f Sorry guys. Added some error checking and discovered a bug in the mysql index creation - I've fixed it and imports don't degrade anything like they used to now. I've just imported 15K hands at 20+/second when it used to be down at 5/sec after 10K hands or so. 2009-08-03 01:30:51 +01:00
sqlcoder
1a63c62cf1 Merge branch 'master' of git://git.assembla.com/fpdboz 2009-08-02 22:50:31 +01:00
sqlcoder
8e0519708e fix bugs and move hud stat config to HUD_main.py so that GUI can set it 2009-08-02 13:00:55 +01:00
Worros
ff2cca361c New insert player function for HHC import
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.
2009-08-02 12:19:33 +08:00
sqlcoder
e2dde5c3e3 fix aggregate query and stop hud queries being executed whenever anything created a db connection 2009-08-01 23:15:04 +01:00
sqlcoder
e9873d38a5 fix sleep() call 2009-08-01 00:06:07 +01:00
sqlcoder
36f09ebc82 merge from ray @f5ba0b5b7... 2009-07-31 21:58:39 +01:00
sqlcoder
b503626c2b add db writer threading 2009-07-31 21:24:21 +01:00
eblade
f5ba0b5b7f Database: insert missing HandToWrite.payin_amounts var
EverleafToFpdb: remove DEBUG XXXXXXX line
FulltiltToFpdb: pass on converting tournament hands
Hand: add Hand.fee var that Database is looking for
fpdb_import: clean up file update scan code, queue files that have changed in the last 60 seconds for the next importer pass, instead of locking it up reading them now (not that this does anything since FT no longer updates the mtime until it closes the table, but maybe it works with Stars or others)
2009-07-30 21:50:08 -04:00
sqlcoder
c2f79ddc24 refine mysql index drop/creation, but redundant as have left Erics new commands in - mysql crawls with 10k hands! get postgres :-) 2009-07-29 07:57:18 +01:00
sqlcoder
9c62ecb80e debug move to Database.py and move last part of mainparser into Database.py 2009-07-29 06:17:51 +01:00
sqlcoder
298de5dc15 move most stuff from fpdb_db.py to Database.py and simplify db connections in fpdb_import 2009-07-28 23:58:10 +01:00
sqlcoder
12e1da0a5e add lock_for_insert routine but comment out for now (hangs) 2009-07-28 21:19:31 +01:00
sqlcoder
f45038673c more moves into Database.py, better exception handling, store hudcache stats for holdem tourneys (some maybe no use? it's a start anyway - need to add NL/FL switch on Filter) 2009-07-26 01:42:09 +01:00
sqlcoder
9c9202b539 remove debug statement 2009-07-22 20:22:20 +01:00
sqlcoder
ab004b8284 only update psycopg2 extensions when using it 2009-07-22 20:19:41 +01:00
sqlcoder
f69281e2fd finish hudcache rebuild code which speeds up bulk imports nicely - turn off permanently via allow_hudcache_rebuild in fpdb_import.py. Also some more moves into Database.py and cosmetic stuff 2009-07-21 22:26:23 +01:00
sqlcoder
0fecdfb2d7 make positional stats use Database.py 2009-07-19 18:28:13 +01:00
sqlcoder
cdd94d512f improve handling of hud_style options 2009-07-18 18:29:06 +01:00
Worros
ec9ce544ca Fix if database hasn't been created yet.
Still broken on my setup, but at least fpdb now starts
2009-07-15 23:32:17 +08:00
Ray
7d97365fbf Merge branch 'master' of git://git.assembla.com/fpdb-sql 2009-07-02 10:11:23 -04:00
Ray
97520bfee9 Fix call to StoreHands for stud games. 2009-07-01 13:55:12 -04:00
sqlcoder
cb1a4d2d0a add wrappers for fpdb_db methods (plan is to move the fpdb_db methods into Database) 2009-06-30 22:00:55 +01:00
sqlcoder
dc7a3fb88e finish removal of store_board_cards() 2009-06-28 18:56:18 +01:00
sqlcoder
a2db28ebf2 create Database instance in import to pass into parser - will eventually replace fpdb_db 2009-06-25 23:14:32 +01:00
sqlcoder
9b50987d0c add sql param to Database constructor - aim is to have just one SQL instance passed around and to use Database for db connections and methods 2009-06-23 23:44:37 +01:00