Commit Graph

255 Commits

Author SHA1 Message Date
sqlcoder
014ddedc01 create db automatically if using sqlite 2010-03-07 10:30:56 +00:00
sqlcoder
6a6d1b1b2c fix 3bet stat (was being set to false if someone else 4bet) 2010-02-27 18:41:30 +00:00
sqlcoder
134a13bf29 create indexes on hudcache in sqlite 2010-02-25 20:43:15 +00:00
sqlcoder
09801cd00e first go at db maintenance window, turned off for now 2010-02-20 18:59:49 +00:00
sqlcoder
4a0fcd62a0 sqlite seems to perform ok for me 2010-02-06 10:28:17 +00:00
Worros
b2e409ae00 Merge branch 'master' of git://git.assembla.com/fpdb-sql 2010-02-04 00:36:51 +08:00
Worros
1cefb2e857 Fix playername siteid insert
From Gerko on mailing list:
> I just did a trial. Use bulkimport for a single Pokerstars file
> switch setting and bulkimport a single Full tilt file.
> When screening the db all players in the database show the same siteId
> (2 for pokerstars)
> Or the other way if the first site was Full Tilt.

The Lambda function wasn't initialising the lambda function correctly.
2010-02-03 23:48:39 +08:00
sqlcoder
d4248706e4 remove surplus get_logger calls, tidy up log messages some more 2010-02-01 22:31:00 +00:00
sqlcoder
86330e536a tidy up logging so that log isn't created in /fpdb/log/ unless it is being used 2010-02-01 21:03:51 +00:00
sqlcoder
e4c6419074 try to improve tourney handling in filter (now displays buyin, but this is not yet used by playerstats when fetching stats 2010-02-01 00:17:55 +00:00
sqlcoder
bbc84fef14 comment out debug message 2010-01-31 12:22:24 +00:00
sqlcoder
5e9486aa3d config changes for logging: logs rotate and go to APPDATA, hud_config now goes in /fpdb/ if they must use it but logging.conf stays in /pyfpdb/. TODO: Some logging still into /fpdb/log/ 2010-01-31 11:25:24 +00:00
sqlcoder
9932025271 move sqlite charset fix to Configuration.py from Database.py, make separate not_needed variables in Charset.py in case we want to update them separately 2010-01-30 11:05:34 +00:00
sqlcoder
d147187a71 add extra comment/suggestion 2010-01-29 23:36:39 +00:00
sqlcoder
a7d4c6243a add assignment (but commented out) that fixes unicode probs for me with sqlite 2010-01-29 23:29:37 +00:00
sqlcoder
2e970baa82 remove sqlite specific test to skip unicode encoding 2010-01-29 22:29:14 +00:00
Worros
a23d96e85d Add Carbon back in as default data.
Also add PKR
2010-01-29 17:00:37 +08:00
Worros
17bc9af88e Merge branch 'master' of git://github.com/kangaderoo/fpdb-kangaderoo
Conflicts:
	run_fpdb.py
2010-01-29 13:01:38 +08:00
sqlcoder
1df418c8e4 create fpdb dir if required, improve sqlite performance :-) 2010-01-27 23:48:39 +00:00
sqlcoder
e82d276cf9 pull and merge from carl (nothing changed) 2010-01-27 08:56:51 +00:00
sqlcoder
5a9836862f sqlite mods, made sqlite the default in HUD_config.xml.example - works (roughly) straight out of the box 2010-01-27 00:48:02 +00:00
sqlcoder
11bc48e126 merge fpdb_db.py into Database.py 2010-01-26 23:54:04 +00:00
sqlcoder
47baee65f9 add tourneyid to hands table (REQUIRES REIMPORT) and fix sqlite db access 2010-01-26 22:46:48 +00:00
Mika Bostrom
2c7287c351 Add new encoder
This encoder is used to handle input from HH conversion, which needs to
end up as UTF-8 in the database. Switch the open-coded routine from
Database.py to this common routine so all encodings now take place in
the same file.
2010-01-24 21:27:40 +01:00
Mika Bostrom
860b5737b7 Use common encoding routine everywhere
The string/locale manipulation in Database.py was open-coded and did not
use Charset.to_utf8() like the rest of the code.
2010-01-24 21:27:35 +01:00
Mika Bostrom
33277ce68b Add new encoder
This encoder is used to handle input from HH conversion, which needs to
end up as UTF-8 in the database. Switch the open-coded routine from
Database.py to this common routine so all encodings now take place in
the same file.
2010-01-24 21:11:46 +02:00
Mika Bostrom
6dcec48005 Use common encoding routine everywhere
The string/locale manipulation in Database.py was open-coded and did not
use Charset.to_utf8() like the rest of the code.
2010-01-24 19:59:49 +02:00
Gerko de Roo
73ae88e47a Merge branch 'master' of git://git.assembla.com/fpdboz.git 2010-01-24 13:37:27 +01:00
Mika Bostrom
3a03bc51a2 Some character set improvements
The strings (names) as stored in database should always be UTF-8;
whatever the display locale is, we then need to convert from the storage
encoding to session encoding. When making database queries with players
names in them, the names must be reconverted to UTF-8.
2010-01-23 16:34:24 +01:00
Worros
98e4b598ed Merge branch 'master' of git://repo.or.cz/fpbd-bostik 2010-01-23 02:18:42 +08:00
Worros
c88ccd1140 Remove unused convert_cards() 2010-01-23 02:18:20 +08:00
Mika Bostrom
91cd2d2599 Remove erroneous encoding
This string should not be encoded, it seems.
2010-01-21 22:05:24 +02:00
Mika Bostrom
dd12da302d Merge branch 'good'
Conflicts:
	pyfpdb/test_PokerStars.py

Resolve by copying sorrow's version on top-
2010-01-21 21:34:54 +02:00
Mika Bostrom
a841603460 Some character set improvements
The strings (names) as stored in database should always be UTF-8;
whatever the display locale is, we then need to convert from the storage
encoding to session encoding. When making database queries with players
names in them, the names must be reconverted to UTF-8.
2010-01-21 21:24:55 +02:00
Worros
776405982b Quick fix for hud 2010-01-15 21:24:37 +08:00
Mika Bostrom
478b82587d Store names as UTF-8
The names should be always in UTF-8 encoding. At least for PostgreSQL
the encdoding of the database comes from the time of running 'initdb'
(which is different from 'createdb') and if the encoding was selected or
set to something else at that time, the following error will occur:

  File ".../pyfpdb/Database.py", line 1630, in <lambda>
    self.pcache = LambdaDict(lambda  key:self.insertPlayer(key, siteid))
  File ".../pyfpdb/Database.py", line 1661, in insertPlayer
    c.execute (q, (site_id, _name))
  File "/usr/lib/python2.5/encodings/iso8859_15.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2122' in
position 10: character maps to <undefined>

This happens because 'name' is a regular string as opposed to a valid
unicode object. By forcing the string to unicode and encoding it in
UTF-8 the error goes away. In my case the database encoding was
ISO-8859-15 (latin9) but any other "wrong" encoding would trigger the
same problem.

This is a relatively common problem in python.
2009-12-29 13:05:03 +08:00
Worros
46e91e1a0f [NEWIMPORT] Remove a couple of unused functions 2009-12-25 18:55:13 +08:00
Worros
0adf0a7b18 [NEWIMPORT] updateHudCache update.
Fix a couple of bugs:
    position != 2 its = 'M'
    actually commit changes to hud
2009-12-24 01:12:39 +08:00
Worros
a0475aa4db [NEWIMPORT] Add function to update hudcache for Hand 2009-12-23 23:14:34 +08:00
Worros
a2d0657b3a [NEWIMPORT] Remove unused functions
Move old HudCache update over in preparation for fixing
2009-12-23 13:56:18 +08:00
Worros
1b82f20411 [NEWIMPORT] Remove legacy code. 2009-12-22 14:44:35 +08:00
Worros
a2947c8707 [NEWIMPORT] Add stubbed variable to insert 2009-12-18 10:28:28 +08:00
Worros
975eb360ef [NEWIMPORT] Add stubbed variable to insert 2009-12-18 10:27:43 +08:00
Worros
1f70a9ad8a [NEWIMPORT] Fix thinko on insertPlayer
Was returning the player name instead of id in the case where the player exists in the database, but wasn't cached already

Removing some merge gunge too
2009-12-17 01:55:48 +08:00
Worros
56c5521e6a [NEWIMPORT] Move HandsPlayers insert statement into SQL.py 2009-12-14 18:01:24 +08:00
Worros
fb92ee2941 [NEWIMPORT] Stub remaining HandsPlayers stats 2009-12-14 17:52:08 +08:00
sqlcoder
ab89f9f603 show message dialog if pg connect fails 2009-12-12 09:51:07 +00:00
Worros
5f67fc8220 Merge branch 'master' of git://git.assembla.com/fpdb-eric 2009-12-07 12:10:56 +08:00
sqlcoder
18b0a47555 move print message to log 2009-12-05 22:20:44 +00:00
Eric Blade
abf132c719 Merge branch 'master' of git://git.assembla.com/fpdb-sql.git
Conflicts:
	pyfpdb/Database.py
2009-12-01 08:03:25 -05:00