From de39d1cabfb906b223d1a160864a431a2bb6b90d Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 29 Jul 2010 22:57:57 +0800 Subject: [PATCH 1/3] Add all Timezones that Stars supports to TZ function All timezones outside of Australia I dodn't define for the moment. Still requires support for actually getting said timezone, but were on our way. --- pyfpdb/HandHistoryConverter.py | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 658e7433..59ba90ef 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -511,6 +511,50 @@ or None if we fail to get the info """ elif givenTimezone=="CET": givenTimezone = timezone('Europe/Berlin') #Note: Daylight Saving Time is standardised across the EU so this should be fine + elif givenTimezone == 'HST': # Hawaiian Standard Time + pass + elif givenTimezone == 'AKT': # Alaska Time + pass + elif givenTimezone == 'PT': # Pacific Time + pass + elif givenTimezone == 'MT': # Mountain Time + pass + elif givenTimezone == 'CT': # Central Time + pass + elif givenTimezone == 'AT': # Atlantic Time + pass + elif givenTimezone == 'NT': # Newfoundland Time + pass + elif givenTimezone == 'ART': # Argentinian Time + pass + elif givenTimezone == 'BRT': # Brasilia Time + pass + elif givenTimezone == 'AKT': # Alaska Time + pass + elif givenTimezone == 'WET': # Western European Time + pass + elif givenTimezone == 'EET': # Eastern European Time + pass + elif givenTimezone == 'MSK': # Moscow Standard Time + pass + elif givenTimezone == 'IST': # India Standard Time + pass + elif givenTimezone == 'CCT': # China Coast Time + pass + elif givenTimezone == 'JST': # Japan Standard Time + pass + elif givenTimezone == 'AWST': # Australian Western Standard Time + givenTimezone = timezone('Australia/West') + elif givenTimezone == 'ACST': # Australian Central Standard Time + givenTimezone = timezone('Australia/Darwin') + elif givenTimezone == 'AEST': # Australian Eastern Standard Time + # Each State on the East Coast has different DSTs. + # Melbournce is out because I don't like AFL, Queensland doesn't have DST + # ACT is full of politicians and Tasmania will never notice. + # Using Sydney. + givenTimezone = timezone('Australia/Sydney') + elif givenTimezone == 'NZT': # New Zealand Time + pass else: raise Error #TODO raise appropriate error From 4510268bc898a641f5934e9ae7dd865f8e987c7c Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 30 Jul 2010 00:51:47 +0200 Subject: [PATCH 2/3] teach windows how to handle non-ASCII usernames --- pyfpdb/Configuration.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 03858760..6063b14d 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -52,8 +52,13 @@ def get_default_config_path(): if os.name == 'posix': config_path = os.path.join(os.path.expanduser("~"), '.fpdb') elif os.name == 'nt': - config_path = os.path.join(os.environ["APPDATA"], 'fpdb') + config_path = os.path.join(unicode(os.environ[u"APPDATA"], "latin-1"), u"fpdb") + #print u"path after joining in get_default_config_path:",config_path else: config_path = False + + try: os.mkdir(config_path) + except: pass + return config_path def get_exec_path(): @@ -110,7 +115,7 @@ def get_logger(file_name, config = "config", fallback = False, log_dir=None, log (conf_file,copied) = get_config(file_name, fallback = fallback) if log_dir is None: - log_dir = os.path.join(get_exec_path(), 'log') + log_dir = os.path.join(get_exec_path(), u'log') #print "\nget_logger: checking log_dir:", log_dir check_dir(log_dir) if log_file is None: @@ -147,7 +152,7 @@ def check_dir(path, create = True): msg = "Creating directory: '%s'" % (path) print msg log.info(msg) - os.mkdir(path) + os.mkdir(path)#, "utf-8")) else: return False @@ -520,9 +525,9 @@ class Config: self.dir_self = get_exec_path() # self.dir_config = os.path.dirname(self.file) self.dir_config = get_default_config_path() - self.dir_log = os.path.join(self.dir_config, 'log') - self.dir_database = os.path.join(self.dir_config, 'database') - self.log_file = os.path.join(self.dir_log, 'fpdb-log.txt') + self.dir_log = os.path.join(self.dir_config, u'log') + self.dir_database = os.path.join(self.dir_config, u'database') + self.log_file = os.path.join(self.dir_log, u'fpdb-log.txt') log = get_logger("logging.conf", "config", log_dir=self.dir_log) # Parse even if there was no real config file found and we are using the example From 4394cebbff69ae142abb292f220aaa576483daec Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sat, 31 Jul 2010 20:30:35 +0200 Subject: [PATCH 3/3] adapt ebuild to work with snapshots too --- ...d_testing.ebuild => current_stable.ebuild} | 0 packaging/gentoo/current_testing.ebuild | 60 +++++++++++++++++++ packaging/gentoo/readme.txt | 3 + 3 files changed, 63 insertions(+) rename packaging/gentoo/{current_stable_and_testing.ebuild => current_stable.ebuild} (100%) create mode 100644 packaging/gentoo/current_testing.ebuild diff --git a/packaging/gentoo/current_stable_and_testing.ebuild b/packaging/gentoo/current_stable.ebuild similarity index 100% rename from packaging/gentoo/current_stable_and_testing.ebuild rename to packaging/gentoo/current_stable.ebuild diff --git a/packaging/gentoo/current_testing.ebuild b/packaging/gentoo/current_testing.ebuild new file mode 100644 index 00000000..05483b62 --- /dev/null +++ b/packaging/gentoo/current_testing.ebuild @@ -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." +} diff --git a/packaging/gentoo/readme.txt b/packaging/gentoo/readme.txt index 66d3b452..e8317e9d 100644 --- a/packaging/gentoo/readme.txt +++ b/packaging/gentoo/readme.txt @@ -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. 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