Commit Graph
46 Commits
Author SHA1 Message Date
Mika Bostrom 18cc51ba7a Make hud's menu-area text configurable
By default the hud positions a little box on top-left corner of each
table. Make the text in this box user-modifiable without touching the
source.

Most likely useful for active users and those who play with smaller
tables. On shrunk table the default box may cover some of the players'
cards.
2009-10-03 21:05:41 +03:00
Mika Bostrom 7eb368f221 Debian package: architecture any -> all
The installed files are scripts and even the bytecode versions are
generated on install. There is no need to build arch-dependent packages.
2009-10-03 08:17:41 +03:00
Mika Bostrom a1d5f2292f Merge branch 'master' of git://trac-git.assembla.com/fpdb-sql 2009-10-03 00:57:25 +03:00
Mika Bostrom e4969820b8 Merge branch 'master' of git://trac-git.assembla.com/fpdb-sql 2009-09-30 20:27:17 +03:00
Mika Bostrom 432c24173e Merge branch 'master' of git://trac-git.assembla.com/fpdb-sql 2009-09-29 09:11:33 +03: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
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
Mika Bostrom df71dcf2c7 Fix knockout variable type
fpdb_parse_logic.py : recogniseTourneyTypeId()

The column in table is of type 'boolean' but the default value was
integer '0'; this triggered an error
2009-09-23 23:44:57 +03: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
Mika Bostrom 1351cd6dd9 Use cleaner syntax in fillDefaultData 2009-09-21 15:31:19 +03: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
Mika Bostrom 84dc9652df Fix table creation for Postgres
PostgreSQL does not have an UNSIGNED specifier in its language.
Mysql's "TINYINT UNSIGNED" is postgreSQL's "SMALLINT" which is a bit
inconvenient but apart from annoying, not a problem.
2009-09-19 11:10:07 +03:00
Mika Bostrom 9af903a666 Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-09-19 10:56:21 +03:00
Mika Bostrom 59560b1025 Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-08-24 07:36:38 +03:00
Mika Bostrom be116905c4 Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-08-23 22:25:51 +03:00
Mika Bostrom f4e6de744a Fix noop() prototype
Hud's noop() is called from gtk event handler, which passes
additional arguments. We don't care about them but we do want to prevent
HUD-error.txt from being flooded with TypeError messages.
2009-08-23 10:18:06 +03:00
Mika Bostrom d43954bc5f Clean up debian/control
Drop unneeded and already covered dependencies. Change package priority
from optional to extra, which makes more sense.
2009-08-22 23:05:18 +03:00
Mika Bostrom ae0612370d Packaging fixes
* It seems that fpdb gets installed into /usr/share/python-support/
  while many other packages end up in .../pyshared; fixed the symlink
  target
* Fixed mail address in changelog, which now is the correct one
* Added postinst script to make fpdb.py executable again. This hack
  is needed because dh_fixperms didn't allow to ignore the script's
  permissions and the file is located in .../fpdb/ along with all the
  other fpdb modules
* Told package manager to create /usr/bin/fpdb symlink pointing to
  fpdb.py so we now have an application named "fpdb" in the system
2009-08-22 22:47:27 +03:00
Mika Bostrom 777b7b726a Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-08-22 17:41:31 +03:00
Mika Bostrom f84644990b Debian packaging, step #1
* add setup.py for python distutils use
* add packaging/debian/*

Not ready yet, but at least seems to behave sanely
2009-08-22 17:36:44 +03:00
Mika Bostrom 1eb17e90e1 Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-08-17 19:24:07 +03:00
Mika Bostrom 49022fcf83 Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-08-16 00:47:46 +03:00
Mika Bostrom b79f0ddccf Actually call position update on reposition
Forgot to commit the call that does hud and aux window repositioning
2009-08-15 14:36:08 +03:00
Mika Bostrom 53eaee4d7c Fix mucked cards' position update
When menu->reposition is called, only the HUD windows were moved to
their new positions. The auxiliary windows used for mucked cards
remained where they were at the time the HUD instance was created. This
caused mucked cards to appear in wrong places after the poker table was
moved.

Split positioning code in Mucked.py to its own method. Now the same
routine that moves HUD windows to their new places also invokes code
to reposition auxiliary windows.

Now the mucked cards are displayed at correct screen coordinates too.
2009-08-15 10:44:04 +03:00
Mika Bostrom 185f9660c5 Use same locale conversion everywhere
It is not enough to use actual system locale in just one spot if all
the other encodings are hard-coded to latin1. Now that we have the real
locale available, do all string conversions [.encode($locale)] with
that.
2009-08-12 10:00:23 +03:00
Mika Bostrom 89dccac169 Merge branch 'master' of git://git.assembla.com/free_poker_tools
Conflicts:
	pyfpdb/GuiTableViewer.py
2009-08-12 08:30:31 +03:00
Mika Bostrom 35cd58545a More generic locale use, I hope
Instead of assuming conversion is from latin1, use locale information
2009-08-12 08:26:06 +03:00
Mika Bostrom b1281385ec Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-08-09 14:27:05 +03:00
Mika Bostrom f60416502d Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-07-31 08:26:50 +03:00
Mika Bostrom 74d571a938 Merge branch 'master' of git://git.assembla.com/free_poker_tools
Conflicts:
	pyfpdb/Database.py
	pyfpdb/fpdb_db.py

Reverted to upstream versions
2009-07-30 10:47:38 +03:00
Mika Bostrom 9a98d7ac07 Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-07-15 16:56:35 +03:00
Mika Bostrom 96f0c77920 Merge branch 'master' of git://git.assembla.com/free_poker_tools 2009-07-14 14:11:39 +03:00
Mika Bostrom b7ca7a77a7 Work around error with no database
Instead of blindly trusting that SELECT ... works, use try-catch to get
around errors when the database doesn't have the tables yet.
2009-07-06 09:01:49 +03:00
Mika Bostrom dd4aeffa4f Remove obnoxious error window
Do we really need that annoying error note about table viewer not
working any longer? It's useless with postgres backend anyhow, so might
as well kill it off entirely.
2009-07-06 00:18:46 +03:00
Mika Bostrom 14dc35ef81 Fix initial run with postgres
Simplify error check, so that regardless of how the table name is
mangled, we now catch just the meaningful part.

When trying to obtain the lock, make sure that there is no transaction
block open (which tends to happen on error-paths); flush the database
connection before requesting exclusive lock.
2009-07-06 00:15:37 +03:00
Mika Bostrom d3373add8b Fix most annoying typo in Postgres case
The error message from postgres contains the said table as written in
original command. 'Players' != 'players', indeed. Now software can at
least start with postgres and an empty database.
2009-07-06 00:00:32 +03:00
Mika Bostrom 105e868864 Catch local connection config
If database backend is Postgres and the connection is over domain
socket, the only values in <database> node are:
    * db_name
    * db_server
    * db_type

Now, for some reason the config reader unconditionally creates "tidy"
string representations for all possible keys. This means that
host, user and password are all empty strings (''), and not even
NoneType entities.

To catch the case for postgres, simply treat empty host the same as
undefined host.
2009-07-05 23:33:09 +03:00
Mika Bostrom 90e348946f First step at fixing the bulk importer with postgres 2008-12-06 21:59:58 +02:00
Mika Bostrom 415eb4a3c6 Retab/whitespace demangly fpdb_import.py 2008-12-06 21:50:40 +02:00
Mika Bostrom 19c0328955 Change syntax for CREATE INDEX... for postgresql 2008-12-06 21:14:39 +02:00
Mika Bostrom 6070066f8a obtain_global_lock() is a method, not top-level function 2008-12-06 15:16:55 +02:00
Mika Bostrom dfb8a06686 Allow to connect to local PostgreSQL via domain socket 2008-12-06 15:07:37 +02:00
Mika Bostrom 7ecfac5437 Retab/whitespace demangle fpdb_db.py 2008-12-06 14:40:04 +02:00
Mika Bostrom c9700fc1a7 Some debugs 2008-12-06 14:34:44 +02:00
Mika Bostrom 0f05d0886e Modify local HUD_config.xml, clean some places and change DB type to
postgresql
2008-12-06 14:10:50 +02:00
Mika Bostrom 3eb1a1dd0b Start to clean up psycopg2.connect() and surroundings 2008-12-06 13:41:39 +02:00