Merge branch 'master' of git://git.assembla.com/fpdb

This commit is contained in:
gimick 2010-08-01 22:51:47 +01:00
commit f9b437c8d3
5 changed files with 70 additions and 3 deletions

View File

@ -0,0 +1,60 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# created by Steffen Schaumburg, steffen@schaumburger.info
inherit eutils
inherit games
EAPI="2"
NEED_PYTHON=2.5
DESCRIPTION="A free/open source tracker/HUD for use with online poker"
HOMEPAGE="http://fpdb.wiki.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/Snapshots/${P}.tar.bz2"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
#note: this should work on other architectures too, please send me your experiences
IUSE="graph mysql postgres sqlite"
RDEPEND="
mysql? ( virtual/mysql
dev-python/mysql-python )
postgres? ( dev-db/postgresql-server
dev-python/psycopg )
sqlite? ( dev-lang/python[sqlite]
dev-python/numpy )
>=x11-libs/gtk+-2.10
dev-python/pygtk
graph? ( dev-python/numpy
dev-python/matplotlib[gtk] )
dev-python/python-xlib
dev-python/pytz"
DEPEND="${RDEPEND}"
src_install() {
insinto "${GAMES_DATADIR}"/${PN}
doins -r gfx
doins -r pyfpdb
doins readme.txt
exeinto "${GAMES_DATADIR}"/${PN}
doexe run_fpdb.py
dodir "${GAMES_BINDIR}"
dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN}
newicon gfx/fpdb-icon.png ${PN}.png
make_desktop_entry ${PN}
prepgamesdirs
fperms +x "${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw
}
pkg_postinst() {
games_pkg_postinst
elog "Note that if you really want to use mysql or postgresql you will have to create"
elog "the database and user yourself and enter it into the fpdb config."
elog "You can find the instructions on the project's website."
}

View File

@ -1,2 +1,5 @@
If you want to run a stable version please use current_stable.ebuild
If you want to run a testing version please use current_testing.ebuild
To use the ebuild please simply copy it into your local portage tree and rename it to fpdb-version.ebuild, for example fpdb-0.20.1.ebuild or fpdb-0.20.902.ebuild. To use the ebuild please simply copy it into your local portage tree and rename it to fpdb-version.ebuild, for example fpdb-0.20.1.ebuild or fpdb-0.20.902.ebuild.
Here's a little howto on how to utilise 3rd party ebuilds such as this one: http://www.gentoo-wiki.info/HOWTO_Installing_3rd_Party_Ebuilds Here's a little howto on how to utilise 3rd party ebuilds such as this one: http://www.gentoo-wiki.info/HOWTO_Installing_3rd_Party_Ebuilds

View File

@ -951,6 +951,7 @@ class Database:
# hmmm, tested by commenting out rollback in grapher. lock seems to work but # hmmm, tested by commenting out rollback in grapher. lock seems to work but
# then drop still hangs :-( does work in some tests though?? # then drop still hangs :-( does work in some tests though??
# will leave code here for now pending further tests/enhancement ... # will leave code here for now pending further tests/enhancement ...
c.execute("BEGIN TRANSACTION")
c.execute( "lock table %s in exclusive mode nowait" % (fk['fktab'],) ) c.execute( "lock table %s in exclusive mode nowait" % (fk['fktab'],) )
#print "after lock, status:", c.statusmessage #print "after lock, status:", c.statusmessage
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']) #print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
@ -961,6 +962,7 @@ class Database:
if "does not exist" not in str(sys.exc_value): if "does not exist" not in str(sys.exc_value):
print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \ print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \
% (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') ) % (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') )
c.execute("END TRANSACTION")
except: except:
print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \ print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \
% (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n')) % (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n'))
@ -984,6 +986,7 @@ class Database:
print "dropping pg index ", idx['tab'], idx['col'] print "dropping pg index ", idx['tab'], idx['col']
try: try:
# try to lock table to see if index drop will work: # try to lock table to see if index drop will work:
c.execute("BEGIN TRANSACTION")
c.execute( "lock table %s in exclusive mode nowait" % (idx['tab'],) ) c.execute( "lock table %s in exclusive mode nowait" % (idx['tab'],) )
#print "after lock, status:", c.statusmessage #print "after lock, status:", c.statusmessage
try: try:
@ -995,6 +998,7 @@ class Database:
if "does not exist" not in str(sys.exc_value): if "does not exist" not in str(sys.exc_value):
print "warning: drop index %s_%s_idx failed: %s, continuing ..." \ print "warning: drop index %s_%s_idx failed: %s, continuing ..." \
% (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n')) % (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n'))
c.execute("END TRANSACTION")
except: except:
print "warning: index %s_%s_idx not dropped %s, continuing ..." \ print "warning: index %s_%s_idx not dropped %s, continuing ..." \
% (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n')) % (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n'))

View File

@ -146,8 +146,8 @@ class Sql:
id BIGSERIAL, PRIMARY KEY (id), id BIGSERIAL, PRIMARY KEY (id),
tourneysPlayerId INT NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id), tourneysPlayerId INT NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id),
playerId INT NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id), playerId INT NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
buyInPercentage FLOAT UNSIGNED NOT NULL, buyInPercentage FLOAT NOT NULL,
payOffPercentage FLOAT UNSIGNED NOT NULL)""" payOffPercentage FLOAT NOT NULL)"""
elif db_server == 'sqlite': elif db_server == 'sqlite':
self.query['createBackingsTable'] = """CREATE TABLE Backings ( self.query['createBackingsTable'] = """CREATE TABLE Backings (
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
@ -3275,7 +3275,7 @@ class Sql:
,sum(CAST(foldToOtherRaisedStreet2 as integer)) ,sum(CAST(foldToOtherRaisedStreet2 as integer))
,sum(CAST(foldToOtherRaisedStreet3 as integer)) ,sum(CAST(foldToOtherRaisedStreet3 as integer))
,sum(CAST(foldToOtherRaisedStreet4 as integer)) ,sum(CAST(foldToOtherRaisedStreet4 as integer))
,sum(CAST(raisedFirstInChance as integer)) ,sum(CAST(raiseFirstInChance as integer))
,sum(CAST(raisedFirstIn as integer)) ,sum(CAST(raisedFirstIn as integer))
,sum(CAST(foldBbToStealChance as integer)) ,sum(CAST(foldBbToStealChance as integer))
,sum(CAST(foldedBbToSteal as integer)) ,sum(CAST(foldedBbToSteal as integer))