poker-engine-1.3.6/0002755000175000017500000000000011540702075011110 500000000000000poker-engine-1.3.6/Makefile.in0000644000175000017500000011541611540702065013102 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_confpoker_DATA) \ $(dist_upgradepoker_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/poker-engine.pc.in \ $(srcdir)/pokerconfigupgrade.8.in \ $(srcdir)/pokerconfigupgrade.in $(top_srcdir)/configure \ AUTHORS COPYING ChangeLog INSTALL NEWS config/install-sh \ config/missing config/py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = pokerconfigupgrade poker-engine.pc \ pokerconfigupgrade.8 CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)" \ "$(DESTDIR)$(confpokerdir)" "$(DESTDIR)$(upgradepokerdir)" \ "$(DESTDIR)$(pkgconfigdir)" SCRIPTS = $(sbin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) DATA = $(dist_confpoker_DATA) $(dist_upgradepoker_DATA) \ $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print pkgdatadir = @pkgdatadir@ pkglibdir = @pkglibdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POKER_ENGINE_PKGDATADIR = @POKER_ENGINE_PKGDATADIR@ POKER_ENGINE_PKGLIBDIR = @POKER_ENGINE_PKGLIBDIR@ POKER_ENGINE_PKGSYSCONFDIR = @POKER_ENGINE_PKGSYSCONFDIR@ PYPOKER_EVAL_CFLAGS = @PYPOKER_EVAL_CFLAGS@ PYPOKER_EVAL_LIBS = @PYPOKER_EVAL_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RSYNC = @RSYNC@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pkgsysconfdir = ${sysconfdir}/poker-engine prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # # ACLOCAL_AMFLAGS = -I config SUBDIRS = pokerengine tests po MAINTAINERCLEANFILES = INSTALL Makefile.in aclocal.m4 configure \ $(wildcard config/*) confpokerdir = ${pkgdatadir}/conf dist_confpoker_DATA = \ $(wildcard ${top_srcdir}/conf/*.xml) upgradepokerdir = ${pkgdatadir}/upgrades dist_upgradepoker_DATA = \ $(wildcard ${top_srcdir}/upgrades/*.xsl) EXTRA_DIST = \ examples/simple.py \ po/raw.string \ $(wildcard conf/*.template) \ $(wildcard gentoo/dev-games/poker-eval/*.ebuild) \ Makefile.cygwin pkgconfigdir = ${datadir}/pkgconfig pkgconfig_DATA = poker-engine.pc man_MANS = \ pokerconfigupgrade.8 sbin_SCRIPTS = \ pokerconfigupgrade TESTS_ENVIRONMENT = PYTHONPATH=. @PYTHON@ TESTS = examples/simple.py all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): pokerconfigupgrade: $(top_builddir)/config.status $(srcdir)/pokerconfigupgrade.in cd $(top_builddir) && $(SHELL) ./config.status $@ poker-engine.pc: $(top_builddir)/config.status $(srcdir)/poker-engine.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pokerconfigupgrade.8: $(top_builddir)/config.status $(srcdir)/pokerconfigupgrade.8.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files install-man8: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @list=''; test -n "$(man8dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } install-dist_confpokerDATA: $(dist_confpoker_DATA) @$(NORMAL_INSTALL) test -z "$(confpokerdir)" || $(MKDIR_P) "$(DESTDIR)$(confpokerdir)" @list='$(dist_confpoker_DATA)'; test -n "$(confpokerdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confpokerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(confpokerdir)" || exit $$?; \ done uninstall-dist_confpokerDATA: @$(NORMAL_UNINSTALL) @list='$(dist_confpoker_DATA)'; test -n "$(confpokerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(confpokerdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(confpokerdir)" && rm -f $$files install-dist_upgradepokerDATA: $(dist_upgradepoker_DATA) @$(NORMAL_INSTALL) test -z "$(upgradepokerdir)" || $(MKDIR_P) "$(DESTDIR)$(upgradepokerdir)" @list='$(dist_upgradepoker_DATA)'; test -n "$(upgradepokerdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(upgradepokerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(upgradepokerdir)" || exit $$?; \ done uninstall-dist_upgradepokerDATA: @$(NORMAL_UNINSTALL) @list='$(dist_upgradepoker_DATA)'; test -n "$(upgradepokerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(upgradepokerdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(upgradepokerdir)" && rm -f $$files install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) all-local installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confpokerdir)" "$(DESTDIR)$(upgradepokerdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-dist_confpokerDATA \ install-dist_upgradepokerDATA install-man \ install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-sbinSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man8 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_confpokerDATA \ uninstall-dist_upgradepokerDATA uninstall-local uninstall-man \ uninstall-pkgconfigDATA uninstall-sbinSCRIPTS uninstall-man: uninstall-man8 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local am--refresh check check-TESTS check-am \ clean clean-generic clean-local ctags ctags-recursive dist \ dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local \ install-dist_confpokerDATA install-dist_upgradepokerDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man8 install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am \ install-sbinSCRIPTS install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-dist_confpokerDATA uninstall-dist_upgradepokerDATA \ uninstall-local uninstall-man uninstall-man8 \ uninstall-pkgconfigDATA uninstall-sbinSCRIPTS clean-local: rm -f */*.py[co] rm -fr tests/conftest rm -f tests/.coverage all-local: if [ -w ${srcdir}/conf ] ; then \ ${PYTHON} ${top_builddir}/pokerconfigupgrade --verbose=1 --upgrades=${srcdir}/upgrades ${srcdir}/conf ; \ fi install-data-local: mkdir -p "${DESTDIR}${pkgsysconfdir}" ${PYTHON} ${top_builddir}/pokerconfigupgrade --verbose=1 --upgrades=${srcdir}/upgrades --reference=${srcdir}/conf "${DESTDIR}${pkgsysconfdir}" chmod u+w "${DESTDIR}${pkgsysconfdir}" uninstall-local: rm -f ${DESTDIR}${pkgsysconfdir}/*.{xml,template} rmdir ${DESTDIR}${pkgsysconfdir} buildconf: ( \ echo '.01-.02 .01/.02 1 2 1' ; \ echo '.02-.04 .02/.04 2 4 2' ; \ echo '.05-.10 .05/.10 5 10 5' ; \ echo '.10-.25 .10/.25 12 25 1' ; \ echo '.25-.50 .25/.50 25 50 5' ; \ echo '.50-1 .50/1 50 100 50' ; \ echo '1-2 1/2 100 200 100' ; \ echo '2-4 2/4 200 400 100' ; \ echo '3-6 3/6 300 600 100' ; \ echo '5-10 5/10 500 1000 500' ; \ echo '10-20 10/20 1000 2000 1000' ; \ echo '30-60 30/60 3000 6000 1000' ; \ echo '50-100 50/100 5000 10000 5000' ; \ echo '100-200 100/200 10000 20000 10000' ; \ ) | while read name desc small big unit ; do \ buy_in=`expr $$big \* 10` ; \ best_buy_in=`expr $$big \* 50` ; \ max_buy_in=`expr $$big \* 100` ; \ sed -e "s;_NAME_;$$name;g" -e "s;_DESC_;$$desc;g" -e "s/_UNIT_/$$unit/g" -e "s/_BEST_BUY_IN_/$$best_buy_in/g" -e "s/_MAX_BUY_IN_/$$max_buy_in/g" -e "s/_BUY_IN_/$$buy_in/g" -e "s/_SMALL_/$$small/g" -e "s/_BIG_/$$big/g" < conf/no-limit.template > conf/poker.$${name}-no-limit.xml ; \ done ( \ echo '.01-.02 .01/.02 1 2 1' ; \ echo '.02-.04 .02/.04 2 4 2' ; \ echo '.05-.10 .05/.10 5 10 5' ; \ echo '.10-.25 .10/.25 12 25 1' ; \ echo '.25-.50 .25/.50 25 50 5' ; \ echo '.50-1 .50/1 50 100 50' ; \ echo '1-2 1/2 100 200 100' ; \ echo '2-4 2/4 200 400 100' ; \ echo '3-6 3/6 300 600 100' ; \ echo '5-10 5/10 500 1000 500' ; \ echo '10-20 10/20 1000 2000 1000' ; \ echo '30-60 30/60 3000 6000 1000' ; \ echo '50-100 50/100 5000 10000 5000' ; \ echo '100-200 100/200 10000 20000 10000' ; \ ) | while read name desc small big unit ; do \ buy_in=`expr $$big \* 10` ; \ best_buy_in=`expr $$big \* 50` ; \ max_buy_in=`expr $$big \* 100` ; \ sed -e "s;_NAME_;$$name;g" -e "s;_DESC_;$$desc;g" -e "s/_UNIT_/$$unit/g" -e "s/_BEST_BUY_IN_/$$best_buy_in/g" -e "s/_MAX_BUY_IN_/$$max_buy_in/g" -e "s/_BUY_IN_/$$buy_in/g" -e "s/_SMALL_/$$small/g" -e "s/_BIG_/$$big/g" < conf/pot-limit.template > conf/poker.$${name}-pot-limit.xml ; \ done ( \ echo '.02-.04 .02/.04 1 2 1' ; \ echo '.05-.10 .05/.10 2 5 1' ; \ echo '.10-.25 .10/.25 5 10 5' ; \ echo '.25-.50 .25/.50 12 25 1' ; \ echo '.50-1 .50/1 25 50 5' ; \ echo '1-2 1/2 50 100 50' ; \ echo '2-4 2/4 100 200 100' ; \ echo '3-6 3/6 150 300 50' ; \ echo '5-10 5/10 250 500 50' ; \ echo '10-20 10/20 500 1000 500' ; \ echo '30-60 30/60 1500 3000 500' ; \ echo '50-100 50/100 2500 5000 500' ; \ echo '100-200 100/200 5000 10000 5000' ; \ ) | while read name desc small big unit ; do \ buy_in=`expr $$big \* 5` ; \ best_buy_in=`expr $$big \* 30` ; \ max_buy_in=`expr $$big \* 100000` ; \ big_bet=`expr $$big \* 2` ; \ sed -e "s;_NAME_;$$name;g" -e "s;_DESC_;$$desc;g" -e "s/_UNIT_/$$unit/g" -e "s/_BEST_BUY_IN_/$$best_buy_in/g" -e "s/_MAX_BUY_IN_/$$max_buy_in/g" -e "s/_BUY_IN_/$$buy_in/g" -e "s/_SMALL_/$$small/g" -e "s/_BIG_/$$big/g" -e "s/_BIGBET_/$$big_bet/g" < conf/limit.template > conf/poker.$${name}-limit.xml ; \ done ( \ echo '.04-.08 .04/.08 4 8 1 2 1' ; \ echo '.10-.20 .10/.20 10 20 2 5 2' ; \ echo '.25-.50 .25/.50 25 50 5 10 5' ; \ echo '.50-1 .50/1 50 100 5 25 5' ; \ echo '1-2 1/2 100 200 10 50 10' ; \ echo '2-4 2/4 200 400 25 100 25' ; \ echo '3-6 3/6 300 600 25 150 25' ; \ echo '5-10 5/10 500 1000 50 200 50' ; \ echo '10-20 10/20 1000 2000 100 500 100' ; \ echo '30-60 30/60 3000 6000 500 1500 500' ; \ ) | while read name desc small big ante bringin unit ; do \ buy_in=`expr $$big \* 5` ; \ best_buy_in=`expr $$big \* 30` ; \ max_buy_in=`expr $$big \* 100000` ; \ sed -e "s;_NAME_;$$name;g" -e "s;_DESC_;$$desc;g" -e "s/_UNIT_/$$unit/g" -e "s/_BEST_BUY_IN_/$$best_buy_in/g" -e "s/_MAX_BUY_IN_/$$max_buy_in/g" -e "s/_BUY_IN_/$$buy_in/g" -e "s/_SMALL_/$$small/g" -e "s/_BIG_/$$big/g" -e "s/_ANTE_/$$ante/g" -e "s/_BRINGIN_/$$bringin/g" < conf/ante-limit.template > conf/poker.ante-$${name}-limit.xml ; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: poker-engine-1.3.6/pokerengine/0002755000175000017500000000000011540702076013417 500000000000000poker-engine-1.3.6/pokerengine/pokerchips.py0000644000175000017500000001507411344205422016060 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Henry Precheur (2004) # import sys from types import * MAX_CHIPS_PER_STACK = 23 INT2CHIPS_FACTOR = 0.3 class PokerChips: def __init__(self, values, what = False): self.remainder = 0 self.values = values self.size = len(self.values) if what == False: self.reset() return if type(what) is IntType or type(what) is LongType: ( self.chips, self.remainder ) = PokerChips.int2chips(values, INT2CHIPS_FACTOR, what) self.limitChips() elif type(what) is ListType: self.chips = what[:] self.remainder = 0 self.limitChips() else: self.chips = what.chips[:] self.remainder = what.remainder def __eq__(self, other): if isinstance(other, PokerChips): return self.chips == other.chips and self.remainder == other.remainder else: return False def __ne__(self, other): if isinstance(other, PokerChips): return self.chips != other.chips or self.remainder != other.remainder else: return True def __str__(self): return "PokerChips(%s) = %d (-%d)" % (self.chips, self.toint(), self.remainder) def __repr__(self): return "%s(%s)" % (self.__class__.__name__, self.chips) def copy(self): return PokerChips(self.values, self) def reset(self): self.chips = [ 0 ] * self.size self.remainder = 0 def set(self, chips): # # Must copy because if chips is a PokerChips object it # will be a reference to a chips data member used in another # object. # converted = PokerChips.convert(self.values, chips) self.chips = converted.chips self.remainder = converted.remainder self.limitChips() def convert(values, what): remainder = 0 if type(what) is IntType or type(what) is LongType: ( what, remainder ) = PokerChips.int2chips(values, INT2CHIPS_FACTOR, what) if type(what) is ListType: chips = PokerChips(values, what) chips.remainder += remainder return chips else: return what convert = staticmethod(convert) def add(self, other): other = PokerChips.convert(self.values, other) self.chips = [ self.chips[i] + other.chips[i] for i in xrange(self.size) ] self.remainder += other.remainder self.limitChips() def subtract(self, other): other = PokerChips.convert(self.values, other) chips = [ self.chips[i] - other.chips[i] for i in xrange(self.size) ] self.remainder -= other.remainder if len(filter(lambda x: x < 0, chips)) != 0 or self.remainder < 0: res = self.toint() - other.toint() if res < 0: self.reset() else: self.set(res) else: self.chips = chips def toint(self): return int(sum([ self.chips[i] * self.values[i] for i in xrange(self.size) ])) + self.remainder def tolist(self): chips = self.chips[:] list = [] for value in self.values: count = chips.pop(0) if count > 0: list.append(value) list.append(count) if self.remainder > 0: if list: if list[0] == 1: # Can not be tested # If the first value is equal to 1, the remainder can not be different than 0 raise UserWarning, "pokerchips.py:tolist unexpected remainder > 0 when first chip value is 1 : " + str(self) #pragma: no cover else: list.insert(0, self.remainder) list.insert(0, 1) else: list = [ 1, self.remainder ] return list def tostring(value): string = str(value) if value == 0: return string elif value < 10: return "0.0" + string elif value < 100: return "0." + string elif value % 100 == 0: return string[:-2] else: return string[:-2] + '.' + string[-2:] tostring = staticmethod(tostring) def tofloat(value): return value / 100.0 tofloat = staticmethod(tofloat) def int2chips(values, factor, money): if len(values) > 0: chips = [0] * len(values) for i in range(len(values) - 1, -1, -1): if i == 0: to_distribute = money else: to_distribute = money - int(values[i] / factor) if to_distribute > 0: chips[i] = to_distribute / values[i] money -= to_distribute - to_distribute % values[i] else: chips = [] return ( chips, money ) int2chips = staticmethod(int2chips) def limitChips(self): def lcm(a, b): def gcm(x, y): if y == 0: return x else: return gcm(y, x % y) return (a * b) / gcm(a, b) for i in xrange(len(self.chips) - 1): if self.chips[i] > MAX_CHIPS_PER_STACK: _lcm = lcm(self.values[i], self.values[i + 1]) too_many = ( self.chips[i] - MAX_CHIPS_PER_STACK ) * self.values[i] moving = too_many - too_many % _lcm if moving > 0: self.chips[i] -= moving / self.values[i] self.chips[i + 1] += moving / self.values[i + 1] poker-engine-1.3.6/pokerengine/Makefile.in0000644000175000017500000003235211540702065015405 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = pokerengine DIST_COMMON = $(pokerengine_PYTHON) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pokerenginedir)" py_compile = $(top_srcdir)/config/py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgdatadir = @pkgdatadir@ pkglibdir = @pkglibdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POKER_ENGINE_PKGDATADIR = @POKER_ENGINE_PKGDATADIR@ POKER_ENGINE_PKGLIBDIR = @POKER_ENGINE_PKGLIBDIR@ POKER_ENGINE_PKGSYSCONFDIR = @POKER_ENGINE_PKGSYSCONFDIR@ PYPOKER_EVAL_CFLAGS = @PYPOKER_EVAL_CFLAGS@ PYPOKER_EVAL_LIBS = @PYPOKER_EVAL_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RSYNC = @RSYNC@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pkgsysconfdir = @pkgsysconfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # # MAINTAINERCLEANFILES = Makefile.in pokerenginedir = ${pythondir}/pokerengine pokerengine_PYTHON = \ __init__.py \ pokercards.py \ pokerchips.py \ pokerengineconfig.py \ pokergame.py \ pokerrake.py \ pokerprizes.py \ pokertournament.py \ version.py all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pokerengine/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pokerengine/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pokerenginePYTHON: $(pokerengine_PYTHON) @$(NORMAL_INSTALL) test -z "$(pokerenginedir)" || $(MKDIR_P) "$(DESTDIR)$(pokerenginedir)" @list='$(pokerengine_PYTHON)'; dlist=; list2=; test -n "$(pokerenginedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ if test -f $$b$$p; then \ $(am__strip_dir) \ dlist="$$dlist $$f"; \ list2="$$list2 $$b$$p"; \ else :; fi; \ done; \ for file in $$list2; do echo $$file; done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pokerenginedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pokerenginedir)" || exit $$?; \ done || exit $$?; \ if test -n "$$dlist"; then \ if test -z "$(DESTDIR)"; then \ PYTHON=$(PYTHON) $(py_compile) --basedir "$(pokerenginedir)" $$dlist; \ else \ PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pokerenginedir)" $$dlist; \ fi; \ else :; fi uninstall-pokerenginePYTHON: @$(NORMAL_UNINSTALL) @list='$(pokerengine_PYTHON)'; test -n "$(pokerenginedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ filesc=`echo "$$files" | sed 's|$$|c|'`; \ fileso=`echo "$$files" | sed 's|$$|o|'`; \ echo " ( cd '$(DESTDIR)$(pokerenginedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pokerenginedir)" && rm -f $$files || exit $$?; \ echo " ( cd '$(DESTDIR)$(pokerenginedir)' && rm -f" $$filesc ")"; \ cd "$(DESTDIR)$(pokerenginedir)" && rm -f $$filesc || exit $$?; \ echo " ( cd '$(DESTDIR)$(pokerenginedir)' && rm -f" $$fileso ")"; \ cd "$(DESTDIR)$(pokerenginedir)" && rm -f $$fileso tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: for dir in "$(DESTDIR)$(pokerenginedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pokerenginePYTHON install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pokerenginePYTHON .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pokerenginePYTHON \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am \ uninstall-pokerenginePYTHON # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: poker-engine-1.3.6/pokerengine/pokerrake.py0000644000175000017500000000462111344205422015670 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # from os import path import imp class PokerRake: def __init__(self, game): pass def getRake(self, game): """ implementation constraint of compute is as follows : for any game1.pot greater than game2.pot compute(game1.pot) MUST be greater or equal to compute(game2.pot) """ if game.isTournament(): return 0 else: return int((game.getPotAmount() - game.getUncalled()) * .05) _get_rake_instance = None def get_rake_instance(game): global _get_rake_instance if _get_rake_instance == None: verbose = game.verbose for dir in game.dirs: file = dir + "/pokerrake.py" if path.exists(file): if verbose > 0: game.message("get_rake_instance: trying to load " + file) module = imp.load_source("user_defined_pokerrake", file) get_instance = getattr(module, "get_rake_instance") _get_rake_instance = get_instance break else: if verbose > 0: game.message("get_rake_instance: " + file + " does not exist") if _get_rake_instance == None: if verbose > 0: game.message("get_rake_instance: no pokerrake.py found in directories " + str(game.dirs)) _get_rake_instance = lambda game: PokerRake(game) else: if verbose > 0: game.message("get_rake_instance: using custom implementation of get_rake_instance") return apply(_get_rake_instance, [game]) poker-engine-1.3.6/pokerengine/pokergame.py0000644000175000017500000043252311344205422015665 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2008 Bradley M. Kuhn # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Bradley M. Kuhn # Henry Precheur (2004) # from string import split, join, lower from pprint import pformat import sys import re import struct import random import platform from pokereval import PokerEval from pokerengine.pokercards import * from pokerengine.pokerengineconfig import Config from pokerengine.pokerchips import PokerChips from pokerengine import pokerrake import locale import gettext if float(sys.version[0:3]) > 2.3: gettext.bind_textdomain_codeset('poker-engine','UTF-8') def init_i18n(locale_dir, overrideTranslationFunction = None): global _ # If we've been fed the function that we know will work to translate # text, then we just set _() to that. This is to support the scenario # where users of this library want to provide their own setup for # gettext() (i.e., to switch languages on the fly, as # pokernetwork.pokeravatar does). # Note that we return the _() that is being replaced. This is done so # that the function can be restored by the caller, should it chose to do # so. # First, if our _() has never been defined, we simply set it to None try: oldTranslationFunction = _ except NameError: oldTranslationFunction = None if callable(overrideTranslationFunction): _ = overrideTranslationFunction return oldTranslationFunction lang = '' if platform.system() == "Windows": lang = locale.getdefaultlocale()[0][:2] if locale_dir == None: locale_dir = './../../locale' try: t = gettext.translation('poker-engine', localedir=locale_dir, languages=[lang]) _ = t.gettext except IOError: _ = lambda text:text return oldTranslationFunction init_i18n(None) ABSOLUTE_MAX_PLAYERS = 10 LEVELS_CACHE = {} def uniq(elements): temp = {} for element in elements: temp[element] = None return temp.keys() class PokerRandom(random.Random): def __init__(self, paranoid=False): self._file = None self._paranoid = paranoid self.seed(None) def seed(self, ignore): if self._file: try: close(self._file) except: pass if self._paranoid: fname = '/dev/random' else: fname = '/dev/urandom' self._file = open(fname, 'r') def getstate(self): return None def setstate(self, ignore): pass def jumpahead(self, ignore): pass def random(self): lsize = struct.calcsize('l') return abs(struct.unpack('l', self._file.read(lsize))[0])/(0.+(~(1L<<((8*lsize)-1)))) if platform.system() == "Linux": random._inst = PokerRandom() shuffler = random # muck constants AUTO_MUCK_NEVER = 0x00 AUTO_MUCK_WIN = 0x01 AUTO_MUCK_LOSE = 0x02 AUTO_MUCK_ALWAYS = AUTO_MUCK_WIN + AUTO_MUCK_LOSE class PokerPlayer: def __init__(self, serial, game): self.serial = serial self.name = "noname" self.game = game self.fold = False self.remove_next_turn = False ## self.sit_out = True ## self.sit_out_next_turn = False ## self.sit_requested = False ## self.bot = False self.auto = False ## self.auto_blind_ante = False ## self.auto_muck = AUTO_MUCK_ALWAYS # AUTO_MUCK_NEVER, AUTO_MUCK_WIN, AUTO_MUCK_LOSE, AUTO_MUCK_ALWAYS self.wait_for = False # True, False, "late", "big", "first_round" ## self.missed_blind = "n/a" # None, "n/a", "big", "small" self.missed_big_blind_count = 0 self.blind = "late" # True, None, "late", "big", "small", "big_and_dead" ## self.buy_in_payed = False ## self.ante = False self.side_pot_index = 0 self.all_in = False self.seat = -1 ## self.hand = PokerCards() self.money = 0 self.rebuy = 0 self.bet = 0 self.dead = 0 self.talked_once = False self.user_data = None def copy(self): other = PokerPlayer(self.serial, self.game) other.name = self.name other.fold = self.fold other.remove_next_turn = self.remove_next_turn other.sit_out = self.sit_out other.sit_out_next_turn = self.sit_out_next_turn other.sit_requested = self.sit_requested other.bot = self.bot other.auto = self.auto other.auto_blind_ante = self.auto_blind_ante other.auto_muck = self.auto_muck other.wait_for = self.wait_for other.missed_blind = self.missed_blind other.missed_big_blind_count = self.missed_big_blind_count other.blind = self.blind other.buy_in_payed = self.buy_in_payed other.ante = self.ante other.side_pot_index = self.side_pot_index other.all_in = self.all_in other.seat = self.seat other.hand = self.hand.copy() other.money = self.money other.rebuy = self.rebuy other.bet = self.bet other.dead = self.dead other.talked_once = self.talked_once other.user_data = self.user_data return other def __str__(self): return "serial = %d, name = %s, fold = %s, remove_next_turn = %s, sit_out = %s, sit_out_next_turn = %s, sit_requested = %s, bot = %s, auto = %s, auto_blind_ante = %s, wait_for = %s, auto_muck = %d, missed_blind = %s, missed_big_blind_count = %d, blind = %s, buy_in_payed = %s, ante = %s, all_in = %s, side_pot_index = %d, seat = %d, hand = %s, money = %d, rebuy = %d, bet = %d, dead = %d, talked_once = %s, user_data = %s" % (self.serial, self.name, self.fold, self.remove_next_turn, self.sit_out, self.sit_out_next_turn, self.sit_requested, self.bot, self.auto, self.auto_blind_ante, self.wait_for, self.auto_muck, self.missed_blind, self.missed_big_blind_count, self.blind, self.buy_in_payed, self.ante, self.all_in, self.side_pot_index, self.seat, self.hand, self.money, self.rebuy, self.bet, self.dead, self.talked_once, self.user_data) def setUserData(self, user_data): self.user_data = user_data def getUserData(self): return self.user_data def beginTurn(self): self.bet = 0 self.dead = 0 self.fold = False self.hand = PokerCards() self.side_pot_index = 0 self.all_in = False self.blind = None self.ante = False def isInGame(self): return not self.isAllIn() and not self.isFold() def isAllIn(self): return self.all_in def isFold(self): return self.fold def isNotFold(self): return not self.fold def isConnected(self): return not self.remove_next_turn def isDisconnected(self): return self.remove_next_turn def isSitOut(self): return self.sit_out def isSit(self): return not self.sit_out def isSitRequested(self): return self.sit_requested def isBot(self): return self.bot def isAuto(self): return self.auto def isAutoBlindAnte(self): return self.auto_blind_ante def isWaitForBlind(self): return self.wait_for def isMissedBlind(self): return self.missed_blind and self.missed_blind != "n/a" def isBlind(self): return self.blind def isBuyInPayed(self): return self.buy_in_payed def getMissedRoundCount(self): return self.missed_big_blind_count def resetMissedBlinds(self): self.missed_blind = None self.missed_big_blind_count = 0 def __historyResolve2messages(game, hands, serial2name, serial2displayed, frame): messages = [] best = { 'hi': 0, 'low': 0x0FFFFFFF } for serial in frame['serials']: for side in ('hi', 'low'): if not hands.has_key(serial): continue hand = hands[serial] if not hand.has_key(side): continue if hand[side][1][0] == 'Nothing': continue hand = hand[side] show = False if ( ( side == 'hi' and best['hi'] <= hand[0] ) or ( side == 'low' and best['low'] >= hand[0] ) ): best[side] = hand[0] show = True if serial2displayed.has_key(serial) and not serial in frame[side]: # # If the player already exposed the hand and is not going # to win this side of the pot, there is no need to issue # a message. # continue if show: serial2displayed[serial] = True value = game.readableHandValueLong(side, hand[1][0], hand[1][1:]) messages.append( _("%(name)s shows %(value)s for %(side)s ") % { 'name' : serial2name(serial), 'value' : value, 'side' : _(side) }) else: messages.append( _("%(name)s mucks loosing hand") % { 'name' : serial2name(serial) }) for side in ('hi', 'low'): if not frame.has_key(side): continue message = join([ serial2name(serial) for serial in frame[side] ]) if len(frame[side]) > 1: message += " tie for %(side)s " % { 'side' : _(side) } else: message += _(" wins %(side)s ") % { 'side' : _(side) } messages.append(message) if len(frame['serial2share']) > 1: message = _("winners share a pot of %(pot)s") % { 'pot' : PokerChips.tostring(frame['pot']) } if frame.has_key('chips_left'): message += _(" (minus %(chips_left)d odd chips)") % { 'chips_left' : frame['chips_left'] } messages.append(message) for (serial, share) in frame['serial2share'].iteritems(): messages.append( _("%(name)s receives %(amount)s") % { 'name' : serial2name(serial), 'amount' : PokerChips.tostring(share) }) return messages def history2messages(game, history, serial2name = str, pocket_messages = False, verbose = 0): messages = [] subject = '' for event in history: type = event[0] if type == "game": (type, level, hand_serial, hands_count, time, variant, betting_structure, player_list, dealer, serial2chips) = event subject = _("hand #%(hand_serial)d, %(variant)s, %(betting_structure)s") % { 'hand_serial' : hand_serial, 'variant' : _(variant), 'betting_structure' : _(betting_structure) } elif type == "wait_for": (type, serial, reason) = event messages.append( _("%(serial)s waiting for ") % { 'serial' : serial2name(serial) } + "%s" % ( reason == "late" and "late blind" or "big blind")) elif type == "player_list": pass elif type == "round": (type, name, board, pockets) = event if pockets: messages.append( _("%(name)s, %(len_pockets)d players") % { 'name' : name, 'len_pockets' : len(pockets) }) else: messages.append(name) if board and not board.isEmpty(): messages.append( _("Board: %(board)s") % { 'board' : game.cards2string(board) } ) if pockets and pocket_messages: for (serial, pocket) in pockets.iteritems(): if not pocket.areAllNocard(): messages.append( _("Cards player %(name)s: %(card)s") % { 'name' : serial2name(serial), 'card' : game.cards2string(pocket) }) elif type == "showdown": (type, board, pockets) = event if board and not board.isEmpty(): messages.append( _("Board: %(cards)s") % { 'cards' : game.cards2string(board) }) if pockets and pocket_messages: for (serial, pocket) in pockets.iteritems(): if not pocket.areAllNocard(): messages.append( _("Cards player %(name)s: %(cards)s") % { 'name' : serial2name(serial), 'cards' : game.cards2string(pocket) }) elif type == "rake": (type, amount, serial2rake) = event messages.append( _("Rake %(amount)s") % { 'amount' : PokerChips.tostring(amount) } ) elif type == "position": pass elif type == "blind_request": pass elif type == "wait_blind": pass elif type == "rebuy": pass elif type == "blind": (type, serial, amount, dead) = event if dead > 0: dead_message = _(" and %(dead)d dead") % { 'dead' : dead } else: dead_message = "" messages.append( _("%(name)s pays %(amount)s blind%(deadmsg)s") % { 'name' : serial2name(serial), 'amount' : PokerChips.tostring(amount), 'deadmsg' : dead_message }) elif type == "ante_request": pass elif type == "ante": (type, serial, amount) = event messages.append( _("%(name)s pays %(amount)s ante") % { 'name' : serial2name(serial), 'amount' : PokerChips.tostring(amount) }) elif type == "all-in": (type, serial) = event messages.append( _("%(name)s is all in") % { 'name' : serial2name(serial) }) elif type == "call": (type, serial, amount) = event messages.append( _("%(name)s calls %(amount)s") % { 'name' : serial2name(serial), 'amount' : PokerChips.tostring(amount) }) elif type == "check": (type, serial) = event messages.append( _("%(name)s checks") % { 'name' : serial2name(serial)} ) elif type == "fold": (type, serial) = event messages.append( _("%(name)s folds") % { 'name' : serial2name(serial)} ) elif type == "raise": (type, serial, amount) = event messages.append( _("%(name)s raises %(amount)s") % { 'name' : serial2name(serial), 'amount' : PokerChips.tostring(amount) } ) elif type == "canceled": (type, serial, amount) = event if serial > 0 and amount > 0: returned_message = _(" (%(amount)s returned to %(name)s)") % { 'amount' : PokerChips.tostring(amount), 'name' : serial2name(serial) } else: returned_message = "" messages.append( _("turn canceled%(message)s") % { 'message' : returned_message} ) elif type == "end": (type, winners, showdown_stack) = event if showdown_stack: game_state = showdown_stack[0] if not game_state.has_key('serial2best'): serial = winners[0] messages.append( _("%(name)s receives %(amount)s (everyone else folded)") % { 'name' : serial2name(serial), 'amount' : PokerChips.tostring(game_state['serial2share'][serial]) }) else: serial2displayed = {} hands = showdown_stack[0]['serial2best'] for frame in showdown_stack[1:]: message = None if frame['type'] == 'left_over': message = _("%(name)s receives %(amount)d odd chips") % { 'name' : serial2name(frame['serial']), 'amount' : frame['chips_left']} elif frame['type'] == 'uncalled': message = _("returning uncalled bet %(amount)s to %(name)s") % { 'amount' : PokerChips.tostring(frame['uncalled']), 'name' : serial2name(frame['serial']) } elif frame['type'] == 'resolve': messages.extend(__historyResolve2messages(game, hands, serial2name, serial2displayed, frame)) else: if verbose >= 0: print "ERROR history2messages unexpected showdown_stack frame type %s" % frame['type'] if message: messages.append(message) else: print "ERROR history2messages ignored empty showdown_stack" elif type == "sitOut": (type, serial) = event messages.append( _("%(name)s sits out") % { 'name' : serial2name(serial) }) elif type == "leave": pass elif type == "finish": pass elif type == "muck": pass else: if verbose >= 0: print "ERROR history2messages: unknown history type %s " % type return (subject, messages) # poker game states GAME_STATE_NULL = "null" GAME_STATE_BLIND_ANTE = "blindAnte" GAME_STATE_PRE_FLOP = "pre-flop" GAME_STATE_FLOP = "flop" GAME_STATE_THIRD = "third" GAME_STATE_TURN = "turn" GAME_STATE_FOURTH = "fourth" GAME_STATE_RIVER = "river" GAME_STATE_FIFTH = "fifth" GAME_STATE_MUCK = "muck" GAME_STATE_END = "end" # winning helper states WON_NULL = -1 # turn not ended yet WON_ALLIN_BLIND = 0 # turn ended on allin in blind phase WON_ALLIN = 1 # turn ended on allin WON_FOLD = 2 # turn ended on fold WON_REGULAR = 3 # turn ended normally class PokerGame: def __init__(self, url, is_directing, dirs): self.id = 0 self.name = "noname" self.__variant = Config(dirs) self.__betting_structure = Config(dirs) self.dirs = dirs self.url = url self.variant = False self.variant_name = "unknown" self.round_info = False self.round_info_backup = False self.win_orders = False self.betting_structure = False self.betting_structure_name = "unknown" self.blind_info = False self.ante_info = False self.bet_info = False self.unit = 1 self.buy_in = 0 self.max_buy_in = 100000000 self.max_players = ABSOLUTE_MAX_PLAYERS self.is_open = True self.hand_serial = 1 self.time = -1 self.time_of_first_hand = -1 self.hands_count = 0 self.stats = { "flops": [], "flops_count": 20, "percent_flop": 0, "pots": [], "pots_count": 20, "average_pot": 0, "hands_per_hour": 0, "time": -1, "hands_count": 0, "frequency": 180 # seconds } self.is_directing = is_directing self.prefix = "" self.verbose = 0 self.callbacks = [] self.first_turn = True self.level_skin = "" self.eval = PokerEval() if self.is_directing: self.shuffler = shuffler self.reset() self.rake = None self.raked_amount = 0 self.forced_dealer_seat = -1 # print "__init__ PokerGame %s" % self def reset(self): self.state = GAME_STATE_NULL self.win_condition = WON_NULL self.current_round = -2 self.serial2player = {} self.player_list = [] self.resetSeatsLeft() self.dealer = -1 self.dealer_seat = -1 self.position = 0 self.last_to_talk = -1 self.raked_amount = 0 self.pot = False self.board = PokerCards() self.round_cap_left = sys.maxint self.last_bet = 0 self.uncalled = 0 self.uncalled_serial = 0 self.winners = [] self.muckable_serials = [] self.side2winners = {} self.serial2best = {} self.showdown_stack = [] self.side_pots = {} self.first_betting_pass = True self.turn_history = [] self.level = 0 def open(self): self.is_open = True def close(self): self.is_open = False def setMaxPlayers(self, max_players): self.max_players = max_players if (self.max_players < 2) or (self.max_players > ABSOLUTE_MAX_PLAYERS): self.error("The number of players must be between %d and %d" % (2, ABSOLUTE_MAX_PLAYERS)) self.max_players = 0 self.resetSeatsLeft() self.serial2player = {} def seatsLeftCount(self): return len(self.seats_left) def resetSeatsLeft(self): if self.max_players == 2: self.seats_left = [2, 7] elif self.max_players == 3: self.seats_left = [2, 7, 5] elif self.max_players == 4: self.seats_left = [1, 6, 3, 8] elif self.max_players == 5: self.seats_left = [0, 2, 4, 6, 8] elif self.max_players == 6: self.seats_left = [0, 2, 4, 5, 7, 9] elif self.max_players == 7: self.seats_left = [0, 2, 3, 5, 6, 8, 9] elif self.max_players == 8: self.seats_left = [1, 2, 3, 4, 5, 6, 7, 8] elif self.max_players == 9: self.seats_left = [0, 1, 2, 3, 4, 5, 6, 7, 8] elif self.max_players == 10: self.seats_left = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] else: self.seats_left = [] self.seats_all = self.seats_left[:] def seatsCount(self): return len(self.seats_all) def canComeBack(self, serial): return ( self.serial2player.has_key(serial) and ( self.serial2player[serial].isDisconnected() or self.serial2player[serial].isAuto() ) ) def canAddPlayer(self, serial): if len(self.seats_left) < 1: self.error("no seats left for player %d" % serial) return False else: return self.is_open def isInPosition(self, serial): return self.isPlaying(serial) and self.getSerialInPosition() == serial def isInTurn(self, serial): return ( not self.isEndOrNull() and self.serial2player.has_key(serial) and serial in self.player_list ) def isPlaying(self, serial): return ( self.isRunning() and self.serial2player.has_key(serial) and serial in self.player_list ) def isInGame(self, serial): return ( self.isRunning() and self.serial2player.has_key(serial) and serial in self.serialsInGame() ) def isSeated(self, serial): return serial in self.serial2player.keys() def isSit(self, serial): return ( self.serial2player.has_key(serial) and self.serial2player[serial].isSit() ) def isSitOut(self, serial): return ( self.serial2player.has_key(serial) and self.serial2player[serial].isSitOut() ) def sitOutNextTurn(self, serial): player = self.serial2player[serial] if ( self.isInTurn(serial) and not ( self.isBlindAnteRound() and self.getSerialInPosition() == serial ) ): player.sit_out_next_turn = True player.sit_requested = False return False elif not self.is_directing: player.sit_out_next_turn = True player.sit_requested = False player.wait_for = False return False else: return self.sitOut(serial) def sitOut(self, serial): player = self.serial2player[serial] if player.isSitOut(): return False if self.is_directing and self.isBlindAnteRound() and self.getSerialInPosition() != serial: self.error("sitOut for player %d while paying the blinds although not in position" % serial) return False if self.isPlaying(serial): self.historyAdd("sitOut", serial) player.sit_out = True player.sit_out_next_turn = False player.sit_requested = False player.wait_for = False if self.is_directing and self.isBlindAnteRound(): player.blind = None self.updateBlinds() if self.getSerialInPosition() == serial: self.__talkedBlindAnte() # the else is impossible because checked above return True def sit(self, serial): player = self.serial2player[serial] if not player.isBuyInPayed() or self.isBroke(serial): if self.verbose > 0: self.error("sit: refuse to sit player %d because buy in == %s instead of True or broke == %s instead of False" % ( serial, player.buy_in_payed, self.isBroke(serial) )) return False player.sit_requested = False player.sit_out = False if player.wait_for == "big": player.wait_for = False # # Rationale of player.sit_out_next_turn == False # This condition happens when the player sitout + sit # while not having the position during the blind/ante round it. # In this particular case, instead of instructing her to wait # for the first round, she sits back. This is important because # she was included in the player list at the begining of the turn. # If she is marked wait_for = "first_round", she will be removed # from the player list at the end of the blind/ante round, which # is exactly the opposite of what we want. # if self.isRunning() and self.isBlindAnteRound() and player.sit_out_next_turn == False: player.wait_for = "first_round" player.sit_out_next_turn = False player.auto = False if self.sitCount() < 2: self.first_turn = True self.dealer_seat = player.seat return True def sitRequested(self, serial): player = self.getPlayer(serial) if player: player.sit_out_next_turn = False player.sit_requested = True player.wait_for = False def canceled(self, serial, amount): if self.isBlindAnteRound(): self.acceptPlayersWaitingForFirstRound() self.cancelState() if self.sitCount() != 1: self.error("%d players sit, expected exactly one" % self.sitCount()) elif amount > 0: self.bet2pot() if self.pot != amount: self.error("pot contains %d, expected %d" % ( self.pot, amount )) else: self.pot2money(serial) else: self.error("canceled unexpected while in state %s (ignored)" % self.state) def returnBlindAnte(self): serial = 0 pot = 0 for player in self.playersPlaying(): if player.bet > 0: self.bet2pot() pot = self.pot serial = player.serial self.pot2money(serial) self.acceptPlayersWaitingForFirstRound() self.historyAdd("canceled", serial, pot) def getSerialByNameNoCase(self, name): name = lower(name) for player in self.playersAll(): if lower(player.name) == name: return player.serial return 0 def setPosition(self, position): if not self.isRunning(): self.error("changing position while the game is not running has no effect") else: self.position = position def setDealer(self, seat): if self.isRunning(): self.error("cannot change the dealer during the turn") else: self.dealer_seat = seat def getPlayer(self, serial): return self.serial2player.get(serial, None) def getPlayerMoney(self, serial): player = self.getPlayer(serial) if player: return player.money + player.rebuy def getSitOut(self, serial): return self.serial2player[serial].sit_out def comeBack(self, serial): if self.canComeBack(serial): player = self.serial2player[serial] player.remove_next_turn = False player.sit_out_next_turn = False player.sit_requested = False player.auto = False return True else: return False def addPlayer(self, serial, seat = -1): if self.serial2player.has_key(serial): player = self.serial2player[serial] if seat == player.seat: # Player already added on this seat return True else: # Player already added on another seat return False if self.canAddPlayer(serial): player = PokerPlayer(serial, self) if self.is_directing: if seat != -1: if seat in self.seats_left: player.seat = seat self.seats_left.remove(seat) else: self.error("the seat %d is not among the remaining seats %s" % ( seat, self.seats_left )) return False else: player.seat = self.seats_left.pop(0) else: if seat not in self.seats_left: self.error("the seat %d is not among the remaining seats %s" % ( seat, self.seats_left )) return False player.seat = seat self.seats_left.remove(seat) if self.verbose >= 1: self.message("player %d get seat %d" % (serial, player.seat)) self.serial2player[serial] = player return True else: return False def botPlayer(self, serial): self.serial2player[serial].bot = True self.autoBlindAnte(serial) self.autoMuck(serial, AUTO_MUCK_ALWAYS) self.autoPlayer(serial) def interactivePlayer(self, serial): self.serial2player[serial].bot = False self.noAutoBlindAnte(serial) self.autoMuck(serial, AUTO_MUCK_ALWAYS) self.noAutoPlayer(serial) def autoPlayer(self, serial): if self.verbose >= 2: self.message("autoPlayer: player %d" % serial) player = self.getPlayer(serial) player.auto = True if not self.is_directing: return if self.isBlindAnteRound(): # note that we can never get here on tournament tables # because blind / antes are payed automatically if player.isBot(): if self.getSerialInPosition() == serial: self.autoPayBlindAnte() else: self.sitOut(serial) elif self.isPlaying(serial): self.__autoPlay() def noAutoPlayer(self, serial): if self.verbose >= 2: self.message("noAutoPlayer: player %d" % serial) player = self.getPlayer(serial) if player: player.auto = False return True else: return False def removePlayer(self, serial): if self.isInTurn(serial): self.serial2player[serial].remove_next_turn = True if self.isBlindAnteRound(): self.sitOut(serial) else: self.__autoPlay() return False else: self.__removePlayer(serial) return True def seats(self): seats = [ 0 ] * ABSOLUTE_MAX_PLAYERS for (serial, player) in self.serial2player.iteritems(): seats[player.seat] = serial return seats def setSeats(self, seats): self.resetSeatsLeft() seat = 0 for serial in seats: if serial != 0: self.serial2player[serial].seat = seat if seat in self.seats_left: self.seats_left.remove(seat) else: self.error("setSeats: seat %d not in seats_left %s" % ( seat, self.seats_left )) self.serial2player[serial].seat = -1 seat += 1 if self.seats() != seats: self.error("seatSeats: wanted %s but got %s" % ( seats, self.seats() )) def beginTurn(self, hand_serial): if not self.isEndOrNull(): self.error("beginTurn: turn is not over yet") return self.hand_serial = hand_serial if self.verbose >= 1: self.message("Dealing %s hand number %d" % ( self.getVariantName(), self.hand_serial ) ) self.pot = 0 self.raked_amount = 0 self.board = PokerCards() self.winners = [] if self.muckable_serials: self.error("beginTurn: muckable_serials not empty %s" % self.muckable_serials) self.muckable_serials = [] self.win_condition = WON_NULL self.serial2best = {} self.showdown_stack = [] self.turn_history = [] if self.levelUp(): self.setLevel(self.getLevel() + 1) self.resetRoundInfo() self.playersBeginTurn() if not self.buildPlayerList(True): return self.changeState(GAME_STATE_BLIND_ANTE) if self.blind_info and self.is_directing and not self.first_turn: self.moveDealerLeft() elif self.forced_dealer_seat >= 0: self.dealer_seat = self.forced_dealer_seat self.dealerFromDealerSeat() self.historyAdd("game", self.getLevel(), self.hand_serial, self.hands_count, (self.time - self.time_of_first_hand), self.variant, self.betting_structure, self.player_list[:], self.dealer_seat, self.moneyMap()) self.resetRound() self.side_pots = { 'contributions': { 'total': {} }, 'pots': [[0, 0]], 'building': 0, 'last_round': self.current_round, } self.initBlindAnte() if self.is_directing: self.deck = self.eval.deck() self.shuffler.shuffle(self.deck) self.updateBlinds() self.autoPayBlindAnte() if self.verbose >= 2: self.message("initialisation turn %d ... finished" % self.hand_serial) def dealerFromDealerSeat(self): self.dealer = -1 seat2player = [None] * ABSOLUTE_MAX_PLAYERS for player in self.playersAll(): seat2player[player.seat] = player previous_player = None for seat in range(self.dealer_seat + 1, ABSOLUTE_MAX_PLAYERS) + range(0, self.dealer_seat + 1): player = seat2player[seat] if player and player.serial in self.player_list: if seat == self.dealer_seat: self.dealer = self.player_list.index(player.serial) break previous_player = player elif seat == self.dealer_seat: if previous_player: self.dealer = self.player_list.index(previous_player.serial) else: # the impossible has happened self.dealer = len(self.player_list) - 1 break if self.dealer < 0: self.error("dealer seat %d cannot be translated in player position among the %d players willing to join the game" % ( self.dealer_seat, self.playingCount() )) def moveDealerLeft(self): if not self.blind_info: return seat2player = [None] * ABSOLUTE_MAX_PLAYERS for player in self.playersAll(): seat2player[player.seat] = player for seat in range(self.dealer_seat + 1, ABSOLUTE_MAX_PLAYERS) + range(0, self.dealer_seat + 1): player = seat2player[seat] if ( player and player.isSit() and not player.isWaitForBlind() ): if self.seatsCount() <= 2: self.dealer_seat = seat break elif player.missed_blind == None: self.dealer_seat = seat break def isBlindRequested(self, serial): return ( self.getSerialInPosition() == serial and self.isBlindAnteRound() and self.blind_info and not self.getPlayer(serial).isAutoBlindAnte() ) def isAnteRequested(self, serial): return ( self.getSerialInPosition() == serial and self.isBlindAnteRound() and self.ante_info and not self.getPlayer(serial).isAutoBlindAnte() ) def sitCountBlindAnteRound(self): sit_count = 0 for player in self.playersSit(): if player.wait_for != "first_round": sit_count += 1 return sit_count def updateBlinds(self): if not self.blind_info: return sit_count = self.sitCountBlindAnteRound() if sit_count <= 1: # # Forget the missed blinds and all when there is less than # two players willing to join the game. # for player in self.playersAll(): player.resetMissedBlinds() player.blind = None if player.wait_for != 'first_round': player.wait_for = False return seat2player = [None] * ABSOLUTE_MAX_PLAYERS blind_ok_count = 0 for player in self.playersAll(): seat2player[player.seat] = player if player.isSit() and player.wait_for != 'first_round' and player.missed_blind == None: blind_ok_count += 1 if self.seatsCount() == 2: first = self.dealer_seat else: first = self.dealer_seat + 1 players = seat2player[first:] + seat2player[:first] # # If less than two players did not miss the blind, declare # that all missed blinds are forgotten. That solves a special # case that would lead to the unability to assign the big blind # to someone despite the fact that there would be players willing # to pay for it. For instance, if all players are # new (missed_blind == "n/a") and only one player is ok with his # blind AND is on the button. Another case is when all players # save one are waiting for the late blind. This player would have to pay the # small blind but then, there would be a need to walk the list # of players, starting from the dealer, once more to figure out # who has to pay the big blind. Furthermore, this case leads to # the awkward result that the person next to the dealer pays the # big blind and the dealer pays the small blind. # if blind_ok_count < 2: if self.verbose > 2: self.message("Forbid missed blinds") for player in players: if player and player.isSit(): player.resetMissedBlinds() if player.wait_for == "late": player.wait_for = False def updateMissed(players, index, what): while ( ( index < ABSOLUTE_MAX_PLAYERS ) and ( not players[index] or not players[index].isSit() or players[index].wait_for == 'first_round' ) ): player = players[index] if player and player.wait_for != 'first_round': if player.missed_blind == None: player.missed_blind = what if player.missed_blind == "big" and what == "big": player.missed_big_blind_count += 1 if self.verbose > 5: self.message("%d big blind count is now %d because of %s" % (player.serial, player.missed_big_blind_count, what)) index += 1 return index # # Small blind # done = False index = 0 while index < ABSOLUTE_MAX_PLAYERS and not done: index = updateMissed(players, index, "small") if index >= ABSOLUTE_MAX_PLAYERS: continue player = players[index] if player.blind == True: done = True elif ( ( not player.wait_for and player.missed_blind == None ) or sit_count == 2 ): player.blind = "small" done = True elif player.missed_blind != None: player.wait_for = "late" index += 1 if not done: self.error("updateBlinds cannot assign the small blind") # # Big blind # index = updateMissed(players, index, "big") if index < ABSOLUTE_MAX_PLAYERS: player = players[index] if player.wait_for: player.wait_for = False if player.blind == True: pass else: player.blind = "big" index += 1 else: self.error("updateBlinds cannot assign big blind") # # # Late blind # while index < ABSOLUTE_MAX_PLAYERS: player = players[index] if player: if not player.sit_out: if ( player.wait_for == "big" or player.missed_blind == None ): player.blind = None elif ( player.missed_blind == "big" or player.missed_blind == "small" ): if sit_count > 5: player.blind = "big_and_dead" else: player.blind = "late" player.wait_for = False elif ( player.missed_blind == "n/a" and player.wait_for != "first_round" ): player.blind = "late" player.wait_for = False else: #pragma: no cover self.error("updateBlinds statement unexpectedly reached while evaluating late blind") #pragma: no cover else: player.blind = None index += 1 if self.verbose > 2: showblinds = lambda player: "%02d:%s:%s:%s" % ( player.serial, player.blind, player.missed_blind, player.wait_for ) self.message("updateBlinds: in game (blind:missed:wait) " + join(map(showblinds, self.playersInGame()))) players = self.playersAll() players.sort(lambda a,b: int(a.seat - b.seat)) self.message("updateBlinds: all (blind:missed:wait) " + join(map(showblinds, players))) def handsMap(self): pockets = {} for player in self.playersNotFold(): pockets[player.serial] = player.hand.copy() return pockets def moneyMap(self): money = {} for player in self.playersNotFold(): money[player.serial] = player.money return money def isTournament(self): return self.hasLevel() def hasLevel(self): return ( (self.blind_info and self.blind_info["change"]) or (self.ante_info and self.ante_info["change"]) ) def delayToLevelUp(self): for what in (self.blind_info, self.ante_info): if not what or not what["change"]: continue if self.level == 0: return (0, what["unit"]) if what["unit"] == "minute" or what["unit"] == "minutes": return ( ( what["frequency"] * 60 ) - ( self.time - what["time"] ), "second" ) elif what["unit"] == "hand" or what["unit"] == "hands": return ( what["frequency"] - ( self.hands_count - what["hands"] ), "hand" ) else: self.error("delayToLevelUp: unknown unit %s " % what["unit"]) return False def levelUp(self): if not self.is_directing: return False delay = self.delayToLevelUp() if delay: return delay[0] <= 0 else: return False def updateStatsFlop(self, fold_before_flop): info = self.stats if fold_before_flop: flop = 0 else: flop = (self.inGameCount() * 100) / self.sitCount(); info["flops"].append(flop) if len(info["flops"]) > info["flops_count"]: info["flops"].pop(0) info["percent_flop"] = sum(info["flops"]) / min(info["flops_count"], len(info["flops"])) def updateStatsEndTurn(self): info = self.stats # # First time thru # if info["time"] == -1: info["hands_count"] = self.hands_count info["time"] = self.time return info["pots"].append(self.getSidePotTotal()) if len(info["pots"]) > info["pots_count"]: info["pots"].pop(0) delta = self.time - info["time"] if delta > info["frequency"]: info["average_pot"] = sum(info["pots"]) / min(info["pots_count"], len(info["pots"])) info["hands_per_hour"] = (self.hands_count - info["hands_count"]) * (3600 / info["frequency"]) info["hands_count"] = self.hands_count info["time"] = self.time def setHandsCount(self, hands_count): self.hands_count = hands_count def setTime(self, time): if self.time_of_first_hand == -1: self.time_of_first_hand = time # first turn, so we get initial time self.time = time def initBlindAnte(self): self.side_pots['contributions'][self.current_round] = {} is_tournament = self.isTournament() if is_tournament: for player in self.playersAll(): player.auto_blind_ante = True if not self.is_directing: return if self.blind_info and ( self.first_turn or is_tournament ): for player in self.playersAll(): player.resetMissedBlinds() if self.blind_info: if self.seatsCount() == 2: self.position = self.dealer else: self.position = self.indexInGameAdd(self.dealer, 1) else: self.position = self.dealer def isBlindAntePayed(self): if self.blind_info: for player in self.playersPlaying(): if player.isSitOut(): continue if ( player.blind != True and player.blind != None ): return False if self.ante_info: for player in self.playersPlaying(): if player.isSitOut(): continue if not player.ante: return False return True def blindAmount(self, serial): if self.blind_info: player = self.getPlayer(serial) big = self.blind_info["big"] small = self.blind_info["small"] if player.blind == "big": return (big, 0, player.blind) elif player.blind == "late": return (big, 0, player.blind) elif player.blind == "small": return (small, 0, player.blind) elif player.blind == "big_and_dead": return (big, small, player.blind) elif ( player.blind == None or player.blind == True ): return (0, 0, player.blind) else: self.error("blindAmount unexpected condition for player %d" % player.serial) else: return (0, 0, False) def smallBlind(self): if self.blind_info: return self.blind_info["small"] else: return None def bigBlind(self): if self.blind_info: return self.blind_info["big"] else: return None def autoPayBlindAnte(self): if not self.is_directing: return if not self.blind_info and not self.ante_info: self.__talkedBlindAnte() return auto_payed = False for self.position in range(self.position, len(self.player_list)) + range(0, self.position): serial = self.player_list[self.position] player = self.serial2player[serial] if player.isSitOut(): # # This case happens when a player refuses to pay the blind/ante # He is sit out but will only be removed from the player list when # the blind/ante round is over. # continue if self.blind_info: (amount, dead, state) = self.blindAmount(serial) if amount > 0: self.historyAddNoDuplicate("position", self.position) if player.isAutoBlindAnte(): self.payBlind(serial, amount, dead) auto_payed = True else: self.historyAdd("blind_request", serial, amount, dead, state) auto_payed = False break if self.ante_info and player.ante == False: self.historyAddNoDuplicate("position", self.position) if player.isAutoBlindAnte(): self.payAnte(serial, self.ante_info["value"]) auto_payed = True else: self.historyAdd("ante_request", serial, self.ante_info["value"]) auto_payed = False break if self.isBlindAntePayed(): break if auto_payed: self.__talkedBlindAnte() def acceptPlayersWaitingForFirstRound(self): # # Players who sit while others are paying the blinds are # waiting for the first round so that buildPlayerList # does not include them. When the first round starts, this # mark can be removed. # for player in self.playersSit(): if player.wait_for == "first_round": player.wait_for = False def initRound(self): info = self.roundInfo() if self.verbose >= 2: self.message("new round %s" % info["name"]) if self.isFirstRound(): if not self.is_directing: self.buildPlayerList(False) self.dealerFromDealerSeat() self.acceptPlayersWaitingForFirstRound() self.round_cap_left = self.roundCap() if self.verbose > 2: self.message("round cap reset to %d" % self.round_cap_left) self.first_betting_pass = True if info["position"] == "under-the-gun": # # The player under the gun is the first to talk # count = self.inGameCount() if count < 2 and self.betsEqual(): raise UserWarning, "initialization but less than two players in game" if self.seatsCount() == 2: self.position = self.dealer else: under_the_gun = self.indexNotFoldAdd(self.dealer, 2) self.position = self.indexInGameAdd(under_the_gun, 1) elif info["position"] == "next-to-dealer": # # The player left to the dealer is first to talk # self.position = self.indexInGameAdd(self.dealer, 1) # # The dealer is last to talk. However, if the dealer folded, # the player before him is last to talk. # next_to_dealer = self.indexInGameAdd(self.dealer, 1) dealer_or_before_him = self.indexInGameAdd(next_to_dealer, -1) elif info["position"] == "low" or info["position"] == "high": values = [] for player in self.playersInGame(): values.append(self.eval.evaln(player.hand.getVisible())) if self.verbose > 2: self.message("%s : %d" % ( player.hand.getVisible(), values[-1] )) if info["position"] == "low": value = min(values) else: value = max(values) index = values.index(value) serial = self.serialsInGame()[index] self.position = self.player_list.index(serial) else: raise UserWarning, "unknown position info %s" % info["position"] # # In theory, when there is a live bet from the blind/ant round, # last_bet should be set to big_blind - small_blind. However, this # is useless in practice because the minimum bet will always be # higher than this number. Since the purpose of last_bet is to define # the minimum bet when this minimum is a consequence of a bet that # is larger than the minimum bet, setting it to zero is equivalent # to setting it to the actual difference between the big_blind and # the small_blind for all intented purposes. # self.last_bet = 0 if self.isFirstRound(): # # The first round takes the live blinds/antes # (is there any game with live antes ?) # self.blindAnteMoveToFirstRound() else: self.side_pots['contributions'][self.current_round] = {} self.uncalled = 0 self.uncalled_serial = 0 self.side_pots['last_round'] = self.current_round if self.isSecondRound(): self.updateStatsFlop(False) if info["position"] == "under-the-gun": self.last_to_talk = self.indexInGameAdd(self.position, -1) elif info["position"] == "next-to-dealer": self.last_to_talk = dealer_or_before_him elif info["position"] == "low" or info["position"] == "high": self.last_to_talk = self.indexInGameAdd(self.position, -1) else: # Impossible case # The position value has already been tested at the beginning of the method raise UserWarning, "unknow position info %s" % info["position"] #pragma: no cover for player in self.playersInGame(): player.talked_once = False if self.verbose >= 2: self.message("dealer %d, in position %d, last to talk %d" % (self.dealer, self.position, self.last_to_talk)) self.historyAdd("round", self.state, self.board.copy(), self.handsMap()) self.historyAdd("position", self.position) self.__autoPlay() def sortPlayerList(self): self.player_list.sort(lambda a,b: int(self.serial2player[a].seat - self.serial2player[b].seat)) def playersBeginTurn(self): map(PokerPlayer.beginTurn, self.playersAll()) if not self.is_directing: for player in self.playersAll(): if player.wait_for != "first_round": player.wait_for = False def buildPlayerList(self, with_wait_for): if self.sitCount() < 2: self.error("cannot make a consistent player list with less than two players willing to join the game") return False # # The player list is the list of players seated, sorted by seat # if with_wait_for: self.player_list = filter(lambda x: self.serial2player[x].wait_for != "first_round", self.serialsSit()) else: self.player_list = filter(lambda x: self.serial2player[x].isSit() and not self.serial2player[x].isWaitForBlind(), self.serial2player.keys()) self.sortPlayerList() if self.verbose >= 2: self.message("player list: %s" % self.player_list) return True def getLevel(self): return self.level def getLevelValues(self, level): info = self.blind_info blind_info = None if info and info["change"]: blind_info = {} if info["change"] == "double": blind_info["small"] = info["small_reference"] * pow(2, level - 1) blind_info["big"] = info["big_reference"] * pow(2, level - 1) elif info["change"] == "levels" or info["change"] == "level": level_info = info["levels"][level - 1] blind_info["small"] = level_info["small"] blind_info["big"] = level_info["big"] else: blind_info = None if self.verbose >= 1: self.message("unexpected blind change method %s " % info["change"]) info = self.ante_info ante_info = None if info and info["change"]: ante_info = {} if info["change"] == "double": ante_info["value"] = info["value_reference"] * pow(2, level - 1) ante_info["bring-in"] = info["bring-in_reference"] * pow(2, level - 1) elif info["change"] == "levels": level_info = info["levels"][level - 1] ante_info["value"] = level_info["value"] ante_info["bring-in"] = level_info["bring-in"] else: ante_info = None if self.verbose >= 1: self.message("unexpected ante change method %s " % info["change"]) return ( blind_info, ante_info ) def setLevel(self, level): if level == self.level: return (blind_info, ante_info) = self.getLevelValues(level) info = self.blind_info if blind_info: info["hands"] = self.hands_count info["time"] = self.time info["small"] = blind_info["small"] info["big"] = blind_info["big"] info = self.ante_info if ante_info: info["hands"] = self.hands_count info["time"] = self.time info["value"] = ante_info["value"] info["bring-in"] = ante_info["bring-in"] self.level = level def minMoney(self): if self.isTournament(): return 0 elif self.blind_info: return self.blind_info["big"] + self.blind_info["small"] elif self.ante_info: return self.ante_info["value"] + self.ante_info["bring-in"] else: return 0 def isBroke(self, serial): player = self.getPlayer(serial) if player: money = player.money return ( money <= 0 or ( not self.isTournament() and money < self.minMoney() ) ) else: return False def endTurn(self): if self.verbose >= 2: self.message("---end turn--") self.hands_count += 1 self.updateStatsEndTurn() self.dealer_seat = self.getPlayerDealer().seat self.historyAdd("end", self.winners[:], self.showdown_stack) for player in self.playersAll(): if player.rebuy > 0: player.money += player.rebuy self.historyAdd("rebuy", player.serial, player.rebuy) player.rebuy = 0 # # Players who are broke automatically sit out. # In live games, one cannot play with less than one big blind + dead. # for player in self.playersSit(): if self.isBroke(player.serial): player.sit_out_next_turn = True # # Compute sit_out for all players so that it accurately # reflects the players that will not be playing next turn # (regardless of the fact that a new player may join later) # sitting_out = [] for player in self.playersAll(): if player.sit_out_next_turn: self.historyAdd("sitOut", player.serial) self.sitOut(player.serial) sitting_out.append(player.serial) if player.remove_next_turn: if player.serial not in sitting_out: self.historyAdd("sitOut", player.serial) self.sitOut(player.serial) sitting_out.append(player.serial) disconnected = self.playersDisconnected() if len(disconnected) > 0: self.historyAdd("leave", map(lambda player: (player.serial, player.seat), disconnected)) for player in disconnected: self.__removePlayer(player.serial) self.historyAdd("finish", self.hand_serial) def __removePlayer(self, serial): # # Get his seat back # if self.verbose >= 1: self.message("removing player %d from game" % (serial)) if not self.serial2player[serial].seat in self.seats_left: self.seats_left.insert(0, self.serial2player[serial].seat) else: self.error("%d alreay in seats_left" % self.serial2player[serial].seat) # # Forget about him # del self.serial2player[serial] def isBlindAnteRound(self): return self.current_round == -1 def isFirstRound(self): return self.current_round == 0 def isSecondRound(self): return self.current_round == 1 def isLastRound(self): return self.current_round == len(self.round_info) - 1 def resetRound(self): self.current_round = -1 def nextRound(self): self.current_round += 1 if self.position != -1: self.historyAdd("position", -1) self.position = -1 self.changeState(self.roundInfo()["name"]) def muckState(self, win_condition): self.current_round = -2 if self.position != -1: self.historyAdd("position", -1) self.position = -1 self.win_condition = win_condition self.changeState(GAME_STATE_MUCK) if self.is_directing: self.setRakedAmount(self.rake.getRake(self)) self.distributeMoney() to_show, muckable_candidates_serials = self.dispatchMuck() if self.verbose > 2: self.message("muckState: to_show = %s muckable_candidates = %s " % ( to_show, muckable_candidates_serials )) muckable_serials = [] for serial in to_show: self.serial2player[serial].hand.allVisible() for serial in muckable_candidates_serials: auto_muck = self.serial2player[serial].auto_muck if auto_muck == AUTO_MUCK_ALWAYS: pass elif auto_muck == AUTO_MUCK_WIN and self.isWinnerBecauseFold(): pass elif auto_muck == AUTO_MUCK_LOSE and not self.isWinnerBecauseFold(): pass else: muckable_serials.append(serial) self.setMuckableSerials(muckable_serials) self.__talked_muck() else: if self.verbose >= 2: self.message("muckState: not directing...") def setRakedAmount(self, rake): if rake > 0: self.raked_amount = rake self.historyAdd("rake", rake, self.getRakeContributions()) def getRakedAmount(self): return self.raked_amount def getRakeContributions(self): rake = self.getRakedAmount() total = self.getPotAmount() - self.getUncalled() uncalled_serial = self.getUncalledSerial() side_pots = self.getPots() # # Uncalled bet is not raked # serial2share = side_pots['contributions']['total'].copy() if uncalled_serial > 0: serial2share[uncalled_serial] -= self.getUncalled() return self.distributeRake(rake, total, serial2share) def distributeRake(self, rake, total, serial2share): # # Each player contributes to the rake in direct proportion # of their contribution to the global pot (uncalled bet does # not count). # total_rake = rake distributed_rake = 0 serial2rake = {} if len(serial2share) == 1: # # Special case to avoid rounding errors # serial2rake[serial2share.keys()[0]] = rake rake = 0 else: for (serial, contribution) in serial2share.iteritems(): contribution += self.getPlayer(serial).dead player_rake = (total_rake * contribution) / total serial2rake[serial] = player_rake rake -= player_rake if rake > 0: keys = serial2rake.keys() keys.sort(lambda a,b: cmp(serial2rake[a], serial2rake[b]) or cmp(a,b)) # # rake distribution rounding error benefit the player with the # lowest rake participation (with the idea that a player with # very little rake participation has a chance to not be raked # at all instead of being raked for 1 unit). # # Note: the rake rounding error can't be greater than the number # of players. But the above distribution is slightly flawed # because the dead blind is not accounted as a contribution # of the player to the pot, therefore the total is not 100%. # while rake > 0: for serial in keys: serial2rake[serial] += 1 rake -= 1 if rake <= 0: break return serial2rake def setMuckableSerials(self, muckable_serials): self.muckable_serials = list(muckable_serials) if muckable_serials: self.historyAdd("muck", self.muckable_serials[:]) if self.verbose > 2: self.message("setMuckableSerials: muckable = %s " % self.muckable_serials) def cancelState(self): self.current_round = -2 if self.position != -1: self.historyAdd("position", -1) self.position = -1 self.changeState(GAME_STATE_END) self.runCallbacks("end_round_last") def endState(self): self.current_round = -2 self.changeState(GAME_STATE_END) self.runCallbacks("end_round_last") self.endTurn() def roundInfo(self): return self.round_info[self.current_round] def betInfo(self): return self.bet_info[self.current_round] def getChipUnit(self): return self.unit def willAct(self, serial): if ( self.isRunning() and serial in self.serialsInGame() ): player = self.getPlayer(serial) return not player.talked_once or self.canCall(serial) else: return False def canAct(self, serial): return ( self.isRunning() and self.getSerialInPosition() == serial and self.cardsDealt() ) def canCall(self, serial): """ Can call if the highest bet is greater than the player bet. """ if self.isBlindAnteRound(): return False player = self.serial2player[serial] return self.highestBetNotFold() > player.bet def canRaise(self, serial): """ Can raise if round cap not reached and the player can at least match the highest bet. """ if self.isBlindAnteRound(): return False player = self.serial2player[serial] highest_bet = self.highestBetNotFold() money = player.money bet = player.bet # # Can raise if the round is not capped and the player has enough money to # raise. The player will be given an opportunity to raise if his bet is # lower than the highest bet on the table or if he did not yet talk in this # betting round (for instance if he payed the big blind or a late blind). # return ( self.round_cap_left != 0 and money > highest_bet - bet and ( player.talked_once == False or bet < highest_bet ) ) def canCheck(self, serial): """ Can check if all bets are equal """ if self.isBlindAnteRound(): return False return self.highestBetNotFold() <= self.getPlayer(serial).bet def canFold(self, serial): """ Can fold if in game and not in blind round """ if self.isBlindAnteRound(): return False player = self.getPlayer(serial) if not player.isInGame(): return False return True def setPlayerBlind(self, serial, blind): if self.isBlindAnteRound() and self.isInPosition(serial): self.getPlayer(serial).blind = blind def getRequestedAction(self, serial): if self.isInPosition(serial): if self.isBlindAnteRound(): return "blind_ante" else: return "play" else: player = self.getPlayer(serial) if not self.isTournament() and player: if not player.isBuyInPayed(): return "buy-in" elif self.isBroke(serial): return "rebuy" else: return None else: return None def possibleActions(self, serial): actions = [] if self.canAct(serial) and not self.isBlindAnteRound(): if self.canCall(serial): actions.append("call") if self.canRaise(serial): actions.append("raise") if self.canCheck(serial): actions.append("check") else: actions.append("fold") return actions def call(self, serial): if self.isBlindAnteRound() or not self.canAct(serial): self.error("player %d cannot call. state = %s" % (serial, self.state)) return False player = self.serial2player[serial] amount = min(self.highestBetNotFold() - player.bet, player.money) if self.verbose >= 2: self.message("player %d calls %d" % (serial, amount)) self.historyAdd("call", serial, amount) self.bet(serial, amount) return True def callNraise(self, serial, amount): if self.isBlindAnteRound() or not self.canAct(serial): self.error("player %d cannot raise. state = %s" % (serial, self.state)) return False if self.round_cap_left <= 0: self.error("round capped, can't raise (ignored)") if self.round_cap_left < 0: self.error("round cap below zero") return False (min_bet, max_bet, to_call) = self.betLimits(serial) if amount < min_bet: amount = min_bet elif amount > max_bet: amount = max_bet if self.verbose >= 1: self.message("player %d raises %d" % (serial, amount)) self.historyAdd("raise", serial, amount) highest_bet = self.highestBetNotFold() self.money2bet(serial, amount) if self.isRunning(): last_bet = self.highestBetNotFold() - highest_bet self.last_bet = max(self.last_bet, last_bet) self.round_cap_left -= 1 if self.verbose > 2: self.message("round cap left %d" % self.round_cap_left) self.runCallbacks("round_cap_decrease", self.round_cap_left) self.__talked(serial) return True def bet(self, serial, amount): if self.verbose >= 1: self.message("player %d bets %s" % ( serial, amount )) # # Transfert the player money from his stack to the bet stack # self.money2bet(serial, amount) self.__talked(serial) def check(self, serial): if self.isBlindAnteRound() or not self.canAct(serial): self.error("player %d cannot check. state = %s (ignored)" % (serial, self.state)) return False if not self.canCheck(serial): self.error("player %d tries to check but should call or raise (ignored)" % serial) return False if self.verbose >= 1: self.message("player %d checks" % serial) self.historyAdd("check", serial) # # Nothing done: that's what "check" stands for # self.__talked(serial) return True def fold(self, serial): if self.isBlindAnteRound() or not self.canAct(serial): self.error("player %d cannot fold. state = %s (ignored)" % (serial, self.state)) return False if self.serial2player[serial].fold == True: if self.verbose >= 1: self.message("player %d already folded (presumably autoplay)" % serial) return True if self.verbose >= 1: self.message("player %d folds" % serial) self.historyAdd("fold", serial) self.serial2player[serial].fold = True # # His money goes to the pot # self.bet2pot(serial) self.__talked(serial) return True def waitBigBlind(self, serial): if not self.blind_info: self.error("no blind due") return False if not self.isBlindAnteRound(): self.error("player %d cannot pay blind while in state %s" % ( serial, self.state )) return False if not self.canAct(serial): self.error("player %d cannot wait for blind. state = %s, serial in position = %d (ignored)" % (serial, self.state, self.getSerialInPosition())) return False player = self.serial2player[serial] player.wait_for = "big" if self.is_directing: self.updateBlinds() self.historyAdd("wait_blind", serial) self.__talkedBlindAnte() return True def blind(self, serial, amount = 0, dead = 0): if not self.blind_info: self.error("no blind due") return False if not self.isBlindAnteRound(): self.error("player %d cannot pay blind while in state %s" % ( serial, self.state )) return False if not self.canAct(serial): self.error("player %d cannot pay blind. state = %s, serial in position = %d (ignored)" % (serial, self.state, self.getSerialInPosition())) return False if self.is_directing and amount == 0: (amount, dead, state) = self.blindAmount(serial) self.payBlind(serial, amount, dead) if self.is_directing: self.__talkedBlindAnte() def payBlind(self, serial, amount, dead): player = self.serial2player[serial] money = player.money if money < amount + dead: # # If the player does not have enough money to pay the blind, # make sure the live blind is payed before puting money into # the dead blind. # if money < amount: dead = 0 amount = money else: dead = money - amount if self.verbose >= 2: self.message("player %d pays blind %d/%d" % (serial, amount, dead)) self.historyAdd("blind", serial, amount, dead) if dead > 0: # # There is enough money to pay the amount, pay the dead, if any # # Note about uncalled amounts : the dead is always lower than the # blind, therefore if self.uncalled is updated (indirectly thru # the self.money2bet in the line immediately following this comment) # it will *always* be overriden by the self.uncalled # self.money2bet of the blind. # self.money2bet(serial, dead, dead_money = True) self.bet2pot(serial = serial, dead_money = True) self.money2bet(serial, amount) player.blind = True player.resetMissedBlinds() player.wait_for = False def ante(self, serial, amount = 0): if not self.ante_info: self.error("no ante due") return False if not self.isBlindAnteRound(): self.error("player %d cannot pay ante while in state %s" % ( serial, self.state )) return False if not self.canAct(serial): self.error("player %d cannot pay ante. state = %s, serial in position = %d (ignored)" % (serial, self.state, self.getSerialInPosition())) return False if self.is_directing and amount == 0: amount = self.ante_info['value'] self.payAnte(serial, amount) if self.is_directing: self.__talkedBlindAnte() return True def payAnte(self, serial, amount): player = self.serial2player[serial] amount = min(amount, player.money) if self.verbose >= 2: self.message("player %d pays ante %d" % (serial, amount)) self.historyAdd("ante", serial, amount) self.money2bet(serial, amount) self.bet2pot(serial) self.getPlayer(serial).ante = True def blindAnteMoveToFirstRound(self): self.side_pots['contributions'][self.current_round] = self.side_pots['contributions'][self.current_round - 1] del self.side_pots['contributions'][self.current_round - 1] # self.uncalled is kept to what it was set during the blind/ante round with live bets def blindAnteRoundEnd(self): if self.is_directing: return if self.inGameCount() < 2 and self.betsEqual(): # # All players are all-in except one, distribute all # cards and figure out who wins. # if self.verbose >= 2: self.message("less than two players not all-in") self.nextRound() self.blindAnteMoveToFirstRound() self.__makeSidePots() self.bet2pot() if self.verbose >= 2: self.message("money not yet distributed, assuming information is missing ...") else: self.nextRound() def muck(self, serial, want_to_muck): if not self.is_directing: if self.verbose > 0: self.message("muck action ignored...") return if not self.state == GAME_STATE_MUCK: self.error("muck: game state muck expected, found %s" % self.state) return if serial not in self.muckable_serials: self.error("muck: serial %s not found in muckable_serials" % serial) return self.muckable_serials.remove(serial) if not want_to_muck: self.serial2player[serial].hand.allVisible() self.__talked_muck() def __talkedBlindAnte(self): if self.sitCountBlindAnteRound() < 2: self.returnBlindAnte() self.cancelState() return if self.isBlindAntePayed(): # # Once the blind and antes are payed, it may be necessary to # recompute the list of players willing to participate in the # turn. Some of them may have declined to pay the blind/ante # and thus excluded themselves from the turn. # player_list = self.player_list[:] self.buildPlayerList(False) if player_list != self.player_list: for serial in player_list: player = self.getPlayer(serial) if player.wait_for: self.historyAdd("wait_for", serial, player.wait_for) self.historyAdd("player_list", self.player_list) self.dealerFromDealerSeat() self.first_turn = False if self.inGameCount() < 2 and self.betsEqual(): # # All players are all-in (except one, maybe), distribute all # cards and figure out who wins. # if self.verbose >= 2: self.message("less than two players not all-in") self.nextRound() self.blindAnteMoveToFirstRound() self.__makeSidePots() self.bet2pot() self.dealCards() while not self.isLastRound(): self.nextRound() self.dealCards() self.muckState(WON_ALLIN_BLIND) else: self.nextRound() self.dealCards() if self.is_directing: self.initRound() else: self.updateBlinds() self.position = self.indexInGameAdd(self.position, 1) self.historyAdd("position", self.position) self.autoPayBlindAnte() def __talked(self, serial): self.getPlayer(serial).talked_once = True if self.__roundFinished(serial): if self.verbose >= 2: self.message("round finished") self.__makeSidePots() self.bet2pot() if self.notFoldCount() < 2: self.position = self.indexNotFoldAdd(self.position, 1) self.historyAdd("position", self.position) if self.verbose >= 2: self.message("last player in game %d" % self.getSerialInPosition()) if self.isFirstRound(): self.updateStatsFlop(True) self.muckState(WON_FOLD) elif self.inGameCount() < 2: # # All players are all-in except one, distribute all # cards and figure out who wins. # if self.verbose >= 2: self.message("less than two players not all-in") while not self.isLastRound(): self.nextRound() self.dealCards() self.muckState(WON_ALLIN) else: # # All bets equal, go to next round # if self.verbose >= 2: self.message("next state") if self.isLastRound(): self.muckState(WON_REGULAR) else: self.nextRound() if self.is_directing: self.dealCards() self.initRound() else: self.runCallbacks("end_round") if self.verbose >= 2: self.message("round not initialized, waiting for more information ... ") else: self.position = self.indexInGameAdd(self.position, 1) self.historyAdd("position", self.position) if self.verbose >= 2: self.message("new position (%d)" % self.position) self.__autoPlay() def __talked_muck(self): if not self.is_directing: # Test impossible, at this point the game can not be a client game # This method is called from muckstate and muck functions where this test is already done return #pragma: no cover if not self.state == GAME_STATE_MUCK: # Test impossible, at this point the game state can not be something else than GAME_STATE_MUCK # This method is called from : # - muckstate where the game state is set to the right state # - muck where this test is already done self.error("muck: game state muck expected, found %s" % self.state) #pragma: no cover return #pragma: no cover if not self.muckable_serials: self.showdown() self.endState() def __botEval(self, serial): ev = self.handEV(serial, 10000, True) if self.state == GAME_STATE_PRE_FLOP: if ev < 100: action = "check" elif ev < 500: action = "call" else: action = "raise" elif self.state == GAME_STATE_FLOP or self.state == GAME_STATE_THIRD: if ev < 200: action = "check" elif ev < 600: action = "call" else: action = "raise" elif self.state == GAME_STATE_TURN or self.state == GAME_STATE_FOURTH: if ev < 300: action = "check" elif ev < 700: action = "call" else: action = "raise" else: if ev < 400: action = "check" elif ev < 800: action = "call" else: action = "raise" return (action, ev) def __autoPlay(self): if not self.is_directing: return player = self.getPlayerInPosition() serial = player.serial if player.isBot(): (desired_action, ev) = self.__botEval(serial) actions = self.possibleActions(serial) if actions: while not desired_action in actions: if desired_action == "check": desired_action = "fold" elif desired_action == "call": desired_action = "check" elif desired_action == "raise": desired_action = "call" if desired_action == "fold": self.fold(serial) elif desired_action == "check": self.check(serial) elif desired_action == "call": self.call(serial) elif desired_action == "raise": self.callNraise(serial, 0) else: # Test impossible # The actions returned by the possibleActions method can not be somethin else than fold, chack, call or raise self.error("__autoPlay: unexpected actions = %s" % actions) #pragma: no cover else: self.error("__autoPlay: no possible action") elif ( player.isSitOut() or player.isAuto() ): # # A player who is sitting but not playing (sitOut) automatically # folds. # self.fold(serial) def hasLow(self): return "low" in self.win_orders def hasHigh(self): return "hi" in self.win_orders def isLow(self): return self.win_orders == [ "low" ] def isHigh(self): return self.win_orders == [ "hi" ] def isHighLow(self): return self.win_orders == [ "hi", "low" ] def getVariantName(self): return self.variant_name def setVariant(self, variant): self.__variant.load(self.url % variant) self.variant = variant self.variant_name = self.getParam("/poker/variant/@name") self.round_info = [] self.round_info_backup = [] self.win_orders = [] for win_order in self.getParamList("/poker/variant/wins/winner/@order"): if win_order == "low8": self.win_orders.append("low") elif win_order == "high": self.win_orders.append("hi") else: self.error("unexpected win order: %s for variant %s" % ( win_order, variant )) if not self.win_orders: raise UserWarning, "failed to read win orders from %s" % self.__variant.path board_size = 0 hand_size = 0 for name in self.getParamList("/poker/variant/round/@name"): board = self.getParamList("/poker/variant/round[@name='" + name + "']/deal[@card='board']") board_size += len(board) cards = self.getParamList("/poker/variant/round[@name='" + name + "']/deal[@card='up' or @card='down']/@card") hand_size += len(cards) position = self.getParam("/poker/variant/round[@name='" + name + "']/position/@type") info = { "name": name, "position": position, "board": board, "board_size": board_size, "hand_size": hand_size, "cards": cards, } self.round_info.append(info) self.round_info_backup.append(info.copy()) self.rake = pokerrake.get_rake_instance(self) def resetRoundInfo(self): """ The roundInfo() data structure may be altered during the round, for instance to cope with a lack of cards in stud7. resetRoundInfo() reset the roundInfo structure to match the information that was initialy read from the betting structure description file. """ for i in xrange(len(self.round_info)): self.round_info[i] = self.round_info_backup[i].copy() def getBettingStructureName(self): return self.betting_structure_name def setBettingStructure(self, betting_structure): self.__betting_structure.load(self.url % betting_structure) self.betting_structure = betting_structure self.betting_structure_name = self.getParam("/bet/description") self.buy_in = int(self.getParam('/bet/@buy-in') or "0") self.max_buy_in = int(self.getParam('/bet/@max-buy-in') or sys.maxint) self.best_buy_in = int(self.getParam('/bet/@best-buy-in') or "0") self.unit = int(self.getParam('/bet/@unit')) self.bet_info = self.getParamProperties('/bet/variants[contains(@ids,"' + self.variant + '")]/round') for bet_info in self.bet_info: if not bet_info.has_key("cap"): bet_info["cap"] = sys.maxint else: bet_info["cap"] = int(bet_info["cap"]) if bet_info["cap"] < 0: bet_info["cap"] = sys.maxint self.blind_info = False blind_info = self.getParamProperties("/bet/blind"); if len(blind_info) > 0: blinds = blind_info[0] self.blind_info = { "change": blinds.has_key("change") and blinds["change"] } if self.blind_info["change"] != False: self.blind_info["frequency"] = int(blinds["frequency"]) self.blind_info["unit"] = blinds["unit"] if self.blind_info["change"] == "levels": self.blind_info["levels"] = self.loadTournamentLevels(self.getParam('/bet/blind/@levels')) elif self.blind_info["change"] == "double": self.blind_info["small"] = int(blinds["small"]) self.blind_info["small_reference"] = self.blind_info["small"] self.blind_info["big"] = int(blinds["big"]) self.blind_info["big_reference"] = self.blind_info["big"] else: self.blind_info["small"] = int(blinds["small"]) self.blind_info["big"] = int(blinds["big"]) self.ante_info = False ante_info = self.getParamProperties("/bet/ante"); if len(ante_info) > 0: antes = ante_info[0] self.ante_info = { "change": antes.has_key("change") and antes["change"] } if self.ante_info["change"]: self.ante_info["frequency"] = int(antes["frequency"]) self.ante_info["unit"] = antes["unit"] if self.ante_info["change"] == "levels": self.ante_info["levels"] = self.loadTournamentLevels(self.getParam('/bet/ante/@levels')) elif self.ante_info["change"] == "double": self.ante_info["value"] = int(antes["value"]) self.ante_info["value_reference"] = self.ante_info["value"] self.ante_info["bring-in"] = int(antes["bring-in"]) self.ante_info["bring-in_reference"] = self.ante_info["bring-in"] else: self.ante_info["value"] = int(antes["value"]) self.ante_info["bring-in"] = int(antes["bring-in"]) self.rake = pokerrake.get_rake_instance(self) def loadTournamentLevels(self, file): if not LEVELS_CACHE.has_key(file): config = Config(self.dirs) config.load(file) levels = [] nodes = config.header.xpathEval('/levels/level') for node in nodes: level = map(lambda (key, value): ( key, int(value) ), config.headerNodeProperties(node).iteritems()) levels.append(dict(level)) config.free() LEVELS_CACHE[file] = levels return LEVELS_CACHE[file] def getBoardLength(self): return len(self.board.tolist(True)) def cardsDealtThisRoundCount(self, criterion = lambda x: True): if not self.isRunning(): return -1 if self.isBlindAnteRound(): return 0 round_info = self.roundInfo() return len(filter(criterion, round_info["cards"])) def upCardsDealtThisRoundCount(self): return self.cardsDealtThisRoundCount(lambda x: x == "up") def downCardsDealtThisRoundCount(self): return self.cardsDealtThisRoundCount(lambda x: x == "down") def getMaxHandSize(self): return len(self.getParamList("/poker/variant/hand/position")) def getMaxBoardSize(self): if self.getParam("/poker/variant/@type") == "community": return len(self.getParamList("/poker/variant/community/position")) else: return 0 def cardsDealt(self): if self.isBlindAnteRound(): return True hand_size = self.roundInfo()["hand_size"] for player in self.playersInGame(): if player.hand.len() != hand_size: return False return self.getBoardLength() == self.roundInfo()["board_size"] def dealCards(self): if not self.is_directing: return info = self.roundInfo() number_of_players = len(self.playersNotFold()) def number_to_deal(): return len(info["board"]) + len(info["cards"]) * number_of_players if number_to_deal() > len(self.deck): cards = info["cards"] cards.reverse() while number_to_deal() > len(self.deck): if "up" in cards: cards.remove("up") elif "down" in cards: cards.remove("down") else: raise UserWarning, "unable to deal %d cards" % number_to_deal() info["hand_size"] -= 1 info["board"].append("board") info["board_size"] += 1 cards.reverse() for card in info["board"]: self.board.add(self.deck.pop(), True) for card in info["cards"]: for player in self.playersNotFold(): player.hand.add(self.deck.pop(), card == "up") if self.verbose >= 1: if len(info["cards"]) > 0: for serial in self.serialsNotFold(): self.message("player %d cards: " % serial + self.getHandAsString(serial)) if len(info["board"]) > 0: self.message("board: " + self.getBoardAsString()) def __roundFinished(self, serial): # # The round finishes when there is only one player not fold ... # if self.notFoldCount() < 2: if self.verbose >= 2: self.message("only one player left in the game") return True # # ... or when all players are all-in. # if self.inGameCount() < 1: if self.verbose >= 2: self.message("all players are all-in") return True if self.first_betting_pass: if serial != self.getSerialLastToTalk(): if self.inGameCount() < 2: # # If there is only one player left to talk, it is # meaningless to ask for his action, unless he has # something to call. # return self.betsEqual() else: return False else: self.first_betting_pass = False return self.betsEqual() def moneyDistributed(self): return len(self.showdown_stack) > 0 def isWinnerBecauseFold(self): return ( self.win_condition == WON_FOLD ) # # Split the pots # def distributeMoney(self): if self.moneyDistributed(): self.error("distributeMoney must be called only once per turn") return pot_backup = self.pot side_pots = self.getPots() serial2delta = {} for (serial, share) in side_pots['contributions']['total'].iteritems(): player_dead = self.getPlayer(serial).dead serial2delta[serial] = - ( share + player_dead ) if self.isWinnerBecauseFold(): serial2rake = {} # # Special and simplest case : the winner has it because # everyone folded. Don't bother to evaluate. # (serial,) = self.serialsNotFold() self.pot -= self.getRakedAmount() serial2rake[serial] = self.getRakedAmount() serial2delta[serial] += self.pot self.showdown_stack = [ { 'type': 'game_state', 'player_list': self.player_list, 'side_pots': side_pots, 'pot': pot_backup, 'foldwin': True, 'serial2share': { serial: self.pot }, 'serial2delta': serial2delta, 'serial2rake': serial2rake }, { 'type': 'resolve', 'serial2share': { serial: pot_backup }, 'serials': [serial], 'pot': pot_backup } ] if self.verbose > 2: self.message(pformat(self.showdown_stack)) self.pot2money(serial) self.setWinners([serial]) if not self.is_directing: self.updateHistoryEnd(self.winners, self.showdown_stack) return serial2side_pot = {} for player in self.playersNotFold(): serial2side_pot[player.serial] = side_pots['pots'][player.side_pot_index][1] if self.verbose >= 2: self.message("distribute a pot of %d" % self.pot) # # Keep track of the best hands (high and low) for information # and for the showdown. # self.serial2best = self.bestHands(self.serialsNotFold()) # # Every player that received a share of the pot and the # amount. # serial2share = {} # # List of winners for each side of the pot (hi or low), # regardless of the fact that low hands matter for this # particular variant. Warning: a winner may show more # than once in these lists (when he is tie for two side pots, # for instance). # self.side2winners = { 'hi': [], 'low': [] } # # Complete showdown information, starting with the lowest side pot. # showdown_stack = [] # # The chips that can't be divided evenly among winners # chips_left = 0 # # While there is some money left at the table # while True: potential_winners = filter(lambda player: serial2side_pot[player.serial] > 0, self.playersNotFoldShowdownSorted()) # # Loop ends when there is no more money, i.e. no more # players with a side_pot greater than 0 # if len(potential_winners) == 0: break # # All information relevant to this distribution round # frame = {} # # This happens only for the potential winner that has the # highest pot (all other players are all-in but none matched # his bet). # # This last potential winner reaches this stage and wins not # because of his hand but because of the size of his stacks. # He only wins back what he bet. # # Let him have his money back and don't register him as a # winner (winners are registered in self.side2winners). # if len(potential_winners) == 1: winner = potential_winners[0] frame['type'] = 'uncalled' frame['serial'] = winner.serial frame['uncalled'] = serial2side_pot[winner.serial] # # Special case : a player folds on the turn and the only other player left in the game # did not bet. There is no reason for the player to fold : he forfeits a pot that # he may win. Nevertheless, it can happen. In this case, and only if there is at least # one player allin, the only other player left is awarded what looks like an uncalled # bet. # In this case the uncalled_serial is zero. # if self.uncalled_serial != 0 and winner.serial != self.uncalled_serial: self.error(pformat(self.showdown_stack)) #pragma: no cover raise UserWarning, "distributeMoney: unexpected winner.serial != uncalled_serial / %d != %d" % ( winner.serial, self.uncalled_serial ) #pragma: no cover showdown_stack.insert(0, frame) serial2share.setdefault(winner.serial, 0) if self.verbose >= 2 and self.uncalled_serial != 0 and side_pots and side_pots.has_key('last_round') and side_pots['last_round'] >= 0: if serial2side_pot[winner.serial] < self.uncalled: self.error(pformat(self.showdown_stack)) #pragma: no cover raise UserWarning, "serial2side_pot[winner.serial] < self.uncalled (%d != %d)" % ( serial2side_pot[winner.serial], self.uncalled ) #pragma: no cover serial2share[winner.serial] += serial2side_pot[winner.serial] serial2delta[winner.serial] += serial2side_pot[winner.serial] serial2side_pot[winner.serial] = 0 break for key in (self.win_orders + [ 'pot', 'chips_left' ]): frame[key] = None frame['type'] = 'resolve' frame['serial2share'] = {} frame['serials'] = [ player.serial for player in potential_winners ] if self.verbose >= 2: self.message("looking for winners with board %s" % self.getBoardAsString()) for player in potential_winners: self.message(" => hand for player %d %s" % ( player.serial, self.getHandAsString(player.serial))) # # # Ask poker-eval to figure out who the winners actually are # eval = self.eval.winners(game = self.variant, pockets = [ player.hand.tolist(True) for player in potential_winners ], board = self.board.tolist(True)) # # Feed local variables with eval results sorted in various # forms to ease computing the results. # winners = [ ] if self.verbose >= 1: self.message("winners:") for (side, indices) in eval.iteritems(): side_winners = [ potential_winners[i] for i in indices ] for winner in side_winners: if self.verbose >= 1: self.message(" => player %d %s (%s)" % ( winner.serial, self.bestCardsAsString(self.serial2best, winner.serial, side), side )) serial2share.setdefault(winner.serial, 0) frame['serial2share'][winner.serial] = 0 frame[side] = [ winner.serial for winner in side_winners ] self.side2winners[side] += frame[side] winners += side_winners # # The pot to be considered is the lowest side_pot of all # the winners. In other words, we must share the pot that # was on the table for the winner that was all-in first. # pot = min([ serial2side_pot[player.serial] for player in winners ]) frame['pot'] = pot if self.verbose >= 2: self.message(" and share a pot of %d" % pot) # # If there are no winners for the low hand (either because the # game is not hi/low or because there is no qualifying low # hand), the pot goes to the high side winner. Otherwise # the pot is divided equaly between hi and low winners. # # A player who scoops (wins high and low) will show twice # in the winners_indices list and will therefore get two shares. # This is why the following does not take in account the side # for which the winner wins. # (global_share, remainder) = self.divideChips(pot, len(eval.keys())) chips_left += remainder frame['chips_left'] = remainder for winners_indices in eval.values(): winners = [ potential_winners[i] for i in winners_indices ] (share, remainder) = self.divideChips(global_share, len(winners)) chips_left += remainder frame['chips_left'] += remainder for winner in winners: serial2share[winner.serial] += share serial2delta[winner.serial] += share frame['serial2share'][winner.serial] += share # # The side pot of each winner is lowered by the amount # that was shared among winners. It will reduce the number # of potential winners (to the very least, the winner(s) # with the smallest side pot will be discarded). # for player in potential_winners: serial2side_pot[player.serial] -= pot showdown_stack.append(frame) # # Do not rake the chips that were uncalled # serial2rackable = serial2share.copy() if showdown_stack[0]['type'] == 'uncalled': uncalled = showdown_stack[0] serial2rackable[uncalled['serial']] -= uncalled['uncalled'] if serial2rackable[uncalled['serial']] <= 0: del serial2rackable[uncalled['serial']] serial2rake = self.distributeRake(self.getRakedAmount(), pot_backup, serial2rackable) for serial in serial2rake.keys(): serial2share[serial] -= serial2rake[serial] serial2delta[serial] -= serial2rake[serial] for (serial, share) in serial2share.iteritems(): self.getPlayer(serial).money += share # # The chips left go to the player next to the dealer, # regardless of the fact that this player folded. # if chips_left > 0: next_to_dealer = self.indexAdd(self.dealer, 1) player = self.serial2player[self.player_list[next_to_dealer]] player.money += chips_left serial2share.setdefault(player.serial, 0) serial2share[player.serial] += chips_left serial2delta[player.serial] += chips_left showdown_stack.insert(0, { 'type': 'left_over', 'chips_left': chips_left, 'serial': player.serial }) self.pot = 0 # # For convenience, build a single list of all winners, regardless # of the side of the pot they won. Remove duplicates in all lists. # winners_serials = [] for side in self.side2winners.keys(): self.side2winners[side] = uniq(self.side2winners[side]) winners_serials += self.side2winners[side] self.setWinners(uniq(winners_serials)) showdown_stack.insert(0, { 'type': 'game_state', 'serial2best': self.serial2best, 'player_list': self.player_list, 'side_pots': side_pots, 'pot': pot_backup, 'serial2share': serial2share, 'serial2rake': serial2rake, 'serial2delta': serial2delta }) self.showdown_stack = showdown_stack if not self.is_directing: self.updateHistoryEnd(self.winners, showdown_stack) if self.verbose > 2: self.message(pformat(self.showdown_stack)) def divideChips(self, amount, divider): return ( amount / divider, amount % divider ) def dispatchMuck(self): if not self.is_directing: self.error("dispatchMuck: not supposed to be called by client") return None if self.isWinnerBecauseFold(): return ( (), tuple(self.winners) ) # # Show the winning cards. # Starting left of the dealer, display player cards as if each showed # his hand only if the previous hand is not better (either hi or low). # showing = self.indexNotFoldAdd(self.dealer, 1) last_to_show = self.indexNotFoldAdd(showing, -1) has_low = len(self.side2winners["low"]) best_low_value = 0x0FFFFFFF has_high = len(self.side2winners["hi"]) best_hi_value = 0 muckable = [] to_show = [] while True: player = self.serial2player[self.player_list[showing]] show = False if has_low: low_value = self.bestHandValue("low", player.serial) if low_value < best_low_value: best_low_value = low_value show = True if has_high: hi_value = self.bestHandValue("hi", player.serial) if hi_value > best_hi_value: best_hi_value = hi_value show = True # # This is deemed necessary because this simplistic but intuitive # way to show or muck cards does not take in account the recursive # nature of splitting a side pot. A player with a hand lower than # a previous hand may need to show his cards if the previous hand # belonged to someone who was all-in. Example: player 1 has trips, # player 2 has two pairs, player 3 has nothing. Player 1 is left # of dealer, shows and win. But player 1 was all-in, therefore # player 2 and player 3 compete for the remaining chips. Player 2 # shows and win. In the end player 1 showed his hand and player 2 # also showed his hand although he was after player 1 with a # weaker hand. # if player.serial in self.winners: show = True if show: to_show.append(player.serial) else: muckable.append(player.serial) if showing == last_to_show: break showing = self.indexNotFoldAdd(showing, 1) return ( to_show, muckable ) def showdown(self): self.historyAdd("showdown", self.board.copy(), self.handsMap()) def handEV(self, serial, iterations, self_only = False): pocket_size = self.getMaxHandSize() pockets = [] serials = self.serialsNotFold() if self_only: # # Pretend that the pocket cards of other players are unknown # pockets = [[PokerCards.NOCARD] * pocket_size] * len(serials) if serial in serials: my_cards = self.getPlayer(serial).hand.tolist(True) pockets[serials.index(serial)] = my_cards else: for pocket in [ player.hand.tolist(True) for player in self.playersNotFold() ]: if len(pocket) < pocket_size: pocket.extend([PokerCards.NOCARD] * (pocket_size - len(pocket))) pockets.append(pocket) board = self.board.tolist(True) board_size = self.getMaxBoardSize() if len(board) < board_size: board.extend([PokerCards.NOCARD] * (board_size - len(board))) eval = self.eval.poker_eval(game = self.variant, pockets = pockets, board = board, fill_pockets = 1, iterations = iterations) if serial in serials: player_index = serials.index(serial) return eval["eval"][player_index]["ev"] else: self.error("handEV: player %d is not holding cards in the hand" % serial) return None def readableHandValueLong(self, side, value, cards): cards = self.eval.card2string(cards) if value == "NoPair": if side == "low": if cards[0][0] == '5': return _("The wheel") else: return join(map(lambda card: card[0], cards), ", ") else: return _("High card %(card)s") % { 'card' : _(letter2name[cards[0][0]]) } elif value == "OnePair": return _("A pair of %(card)s") % { 'card' : _(letter2names[cards[0][0]]) } + _(", %(card)s kicker") % { 'card' : _(letter2name[cards[2][0]]) } elif value == "TwoPair": return _("Two pairs %(card1)s and %(card2)s") % { 'card1' : _(letter2names[cards[0][0]]), 'card2' : _(letter2names[cards[2][0]]) } + _(", %(card)s kicker") % { 'card' : _(letter2name[cards[4][0]]) } elif value == "Trips": return _("Three of a kind %(card)s") % { 'card' : _(letter2names[cards[0][0]]) } + _(", %(card)s kicker") % { 'card' : _(letter2name[cards[3][0]]) } elif value == "Straight": return _("Straight %(card1)s to %(card2)s") % { 'card1' : _(letter2name[cards[0][0]]), 'card2' : _(letter2name[cards[4][0]]) } elif value == "Flush": return _("Flush %(card)s high") % { 'card' : _(letter2name[cards[0][0]]) } elif value == "FlHouse": return _("%(card1)ss full of %(card2)ss") % { 'card1' : _(letter2name[cards[0][0]]), 'card2' : _(letter2name[cards[3][0]]) } elif value == "Quads": return _("Four of a kind %(card)s") % { 'card' : _(letter2names[cards[0][0]]) } + _(", %(card)s kicker") % { 'card' : _(letter2name[cards[4][0]]) } elif value == "StFlush": if letter2name[cards[0][0]] == 'Ace': return _("Royal flush") else: return _("Straight flush %(card)s high") % { 'card' : _(letter2name[cards[0][0]]) } return value def readableHandValueShort(self, side, value, cards): cards = self.eval.card2string(cards) if value == "NoPair": if side == "low": if cards[0][0] == '5': return _("The wheel") else: return join(map(lambda card: card[0], cards), ", ") else: return _("High card %(card)s") % { 'card' : _(letter2name[cards[0][0]]) } elif value == "OnePair": return _("Pair of %(card)s") % { 'card' : _(letter2names[cards[0][0]]) } elif value == "TwoPair": return _("Pairs of %(card1)s and %(card2)s") % { 'card1' : _(letter2names[cards[0][0]]), 'card2' : _(letter2names[cards[2][0]]) } elif value == "Trips": return _("Trips %(card)s") % { 'card' : _(letter2names[cards[0][0]]) } elif value == "Straight": return _("Straight %(card)s high") % { 'card' : _(letter2name[cards[0][0]]) } elif value == "Flush": return _("Flush %(card)s high") % { 'card' : _(letter2name[cards[0][0]]) } elif value == "FlHouse": return _("%(card1)ss full of %(card2)ss") % { 'card1' : _(letter2name[cards[0][0]]), 'card2' : _(letter2name[cards[3][0]]) } elif value == "Quads": return _("Quads %(card)s") % { 'card' : _(letter2names[cards[0][0]]) } + ", %(card)s kicker" % { 'card' : _(letter2name[cards[4][0]]) } elif value == "StFlush": if letter2name[cards[0][0]] == 'Ace': return _("Royal flush") else: return _("Straight flush") return value def bestHands(self, serials): results = {} for serial in serials: # # Cannot figure out the best hand for a player with # a placeholder. # if self.serial2player[serial].hand.hasCard(PokerCards.NOCARD): continue result = {} for side in self.win_orders: result[side] = self.bestHand(side, serial) results[serial] = result # print "bestHands: %s" % self.win_orders # pprint(results) return results def bestCardsAsString(self, bests, serial, side): return join(self.eval.card2string(bests[serial][side][1][1:])) def bestHand(self, side, serial): if self.variant == "omaha" or self.variant == "omaha8": hand = self.serial2player[serial].hand.tolist(True) board = self.board.tolist(True) else: hand = self.serial2player[serial].hand.tolist(True) + self.board.tolist(True) board = [] return self.eval.best(side, hand, board) def bestHandValue(self, side, serial): (value, cards) = self.bestHand(side, serial) return value def bestHandCards(self, side, serial): (value, cards) = self.bestHand(side, serial) return cards def readablePlayerBestHands(self, serial): results = [] if self.hasHigh(): results.append(self.readablePlayerBestHand('hi', serial)) if self.hasLow(): results.append(self.readablePlayerBestHand('low', serial)) return "\n".join(results) def readablePlayerBestHand(self, side, serial): cards = self.bestHandCards(side, serial) result = self.readableHandValueLong(side, cards[0], cards[1:]) result += ": " + ", ".join(self.eval.card2string(cards[1:])) return result def cards2string(self, cards): return join(self.eval.card2string(cards.tolist(True))) def getHandAsString(self, serial): return self.cards2string(self.serial2player[serial].hand) def getBoardAsString(self): return self.cards2string(self.board) def betsNull(self): if self.isRunning(): return sum([ player.bet for player in self.playersNotFold()]) == 0 else: return False def setWinners(self, serials): if self.verbose >= 2: self.message("player(s) %s win" % serials) self.winners = serials def bet2pot(self, serial = 0, dead_money = False): if serial == 0: serials = self.player_list else: serials = [serial] for serial in serials: player = self.serial2player[serial] bet = player.bet self.pot += bet if dead_money: player.dead += bet player.bet = 0 self.runCallbacks("bet2pot", serial, bet) def money2bet(self, serial, amount, dead_money = False): player = self.serial2player[serial] if amount > player.money: self.error("money2bet: %d > %d" % (amount, player.money)) amount = player.money player.money -= amount player.bet += amount self.runCallbacks("money2bet", serial, amount) if dead_money: pot_index = len(self.side_pots['pots']) - 1 self.side_pots['building'] += amount else: self.__updateUncalled() self.updatePots(serial, amount) if player.money == 0: self.historyAdd("all-in", serial) player.all_in = True def __updateUncalled(self): highest_bet = 0 highest_bet_players_count = 0 for player in self.playersNotFold(): if player.bet > highest_bet: highest_bet = player.bet highest_bet_players_count = 1 elif player.bet == highest_bet: highest_bet_players_count += 1 if highest_bet_players_count == 0: raise UserWarning, "there should be at least one player in the game" #pragma: no cover if highest_bet_players_count > 1: self.uncalled = 0 self.uncalled_serial = 0 return self.uncalled = highest_bet for player in self.playersNotFold(): if player.bet != highest_bet and highest_bet - player.bet < self.uncalled: self.uncalled = highest_bet - player.bet if player.bet == highest_bet: self.uncalled_serial = player.serial def updatePots(self, serial, amount): pot_index = len(self.side_pots['pots']) - 1 self.side_pots['building'] += amount contributions = self.side_pots['contributions'] contributions['total'].setdefault(serial, 0) contributions['total'][serial] += amount round_contributions = contributions[self.current_round] round_contributions.setdefault(pot_index, {}) pot_contributions = round_contributions[pot_index] pot_contributions.setdefault(serial, 0) pot_contributions[serial] += amount def playersInPotCount(self, side_pots): pot_index = len(side_pots['pots']) - 1 if not side_pots['contributions'].has_key(side_pots['last_round']): return 0 contributions = side_pots['contributions'][side_pots['last_round']] if not contributions.has_key(pot_index): return 0 return len(contributions[pot_index]) def isSingleUncalledBet(self, side_pots): return self.playersInPotCount(side_pots) == 1 def getUncalled(self): return self.uncalled def getUncalledSerial(self): return self.uncalled_serial def getPotAmount(self): if self.isRunning(): return self.pot else: if self.moneyDistributed(): return self.showdown_stack[0]['pot'] else: return self.pot def pot2money(self, serial): player = self.serial2player[serial] player.money += self.pot self.pot = 0 def highestBetNotFold(self): return max([ player.bet for player in self.playersNotFold() ]) def highestBetInGame(self): return max([ player.bet for player in self.playersInGame() ]) def betsEqual(self): if self.notFoldCount() > 1 and self.inGameCount() > 0: # # If a player that is all-in placed a bet that is higher # than any of the bets of the players still in game, the # bets are not equal. # if self.highestBetNotFold() > self.highestBetInGame(): return False # # If one of the players still in game placed a bet that # is different from the others, the bets are not equal. # players = self.playersInGame() bet = players[0].bet for player in players: player_bet = player.bet if bet != player_bet: return False return True def __makeSidePots(self): amount_index = 0 total_index = 1 last_pot_index = -1 round_contributions = self.side_pots['contributions'][self.current_round] pots = self.side_pots['pots'] pots[last_pot_index][amount_index] += self.side_pots['building'] # amount pots[last_pot_index][total_index] += self.side_pots['building'] # total self.side_pots['building'] = 0 current_pot_index = len(pots) - 1 players = filter(lambda player: player.side_pot_index == current_pot_index, self.playersAllIn()) if not players: return players.sort(lambda a,b: int(a.bet - b.bet)) for player in players: pot_contributions = round_contributions[len(pots) - 1] if not pot_contributions.has_key(player.serial): # # This may happen if two players are all in for exactly # the same amount. # continue if len(pot_contributions) == 1: # # This may happen when a player goes all in and # has more chips than all other players # break new_pot_contributions = {} pot = pots[last_pot_index] new_pot = [0, 0] new_pot_index = len(pots) contribution = pot_contributions[player.serial] for serial in pot_contributions.keys(): other_contribution = pot_contributions[serial] pot_contributions[serial] = min(contribution, other_contribution) remainder = other_contribution - pot_contributions[serial] pot[amount_index] -= remainder pot[total_index] -= remainder other_player = self.getPlayer(serial) if other_contribution > contribution: new_pot_contributions[serial] = remainder new_pot[amount_index] += remainder other_player.side_pot_index = new_pot_index elif ( other_contribution == contribution and not other_player.isAllIn() ): other_player.side_pot_index = new_pot_index round_contributions[new_pot_index] = new_pot_contributions new_pot[total_index] = new_pot[amount_index] + pot[total_index] pots.append(new_pot) def getPots(self): return self.side_pots def getSidePotTotal(self): return self.side_pots['pots'][-1][1] def getLatestPotContributions(self): contributions = self.side_pots['contributions'] last_round = max(filter(lambda x: x != 'total', contributions.keys())) return contributions[last_round] def indexInGameAdd(self, position, increment): return self.playerListIndexAdd(position, increment, PokerPlayer.isInGame) def indexNotFoldAdd(self, position, increment): return self.playerListIndexAdd(position, increment, PokerPlayer.isNotFold) def indexAdd(self, position, increment): return self.playerListIndexAdd(position, increment, lambda x: True) # # Increment the "index" (relative to self.player_list knowing # that self.player_list is not modified during a turn) for a # total of "increment", skipping the players for which "predicate" # is false. # def playerListIndexAdd(self, index, increment, predicate): if increment > 0: step = 1 else: step = -1 while increment: index = (index + step) % len(self.player_list) increment -= step while not predicate(self.serial2player[self.player_list[index]]): index = (index + step) % len(self.player_list) return index def getSerialDealer(self): return self.player_list[self.dealer] def getSerialInPosition(self): if self.position >= 0: return self.player_list[self.position] else: return 0 def getSerialLastToTalk(self): return self.player_list[self.last_to_talk] def getPlayerDealer(self): return self.serial2player[self.player_list[self.dealer]] def getPlayerInPosition(self): return self.serial2player[self.player_list[self.position]] def getPlayerLastToTalk(self): return self.serial2player[self.player_list[self.last_to_talk]] def disconnectedCount(self): return len(self.serialsDisconnected()) def serialsDisconnected(self): return filter(lambda x: self.serial2player[x].isDisconnected(), self.serial2player.keys()) def playersDisconnected(self): return [ self.serial2player[serial] for serial in self.serialsDisconnected() ] def connectedCount(self): return len(self.serialsConnected()) def serialsConnected(self): return filter(lambda x: self.serial2player[x].isConnected(), self.serial2player.keys()) def playersConnected(self): return [ self.serial2player[serial] for serial in self.serialsConnected() ] def sitOutCount(self): return len(self.serialsSitOut()) def serialsSitOut(self): return filter(lambda x: self.serial2player[x].isSitOut(), self.serial2player.keys()) def playersSitOut(self): return [ self.serial2player[serial] for serial in self.serialsSitOut() ] def brokeCount(self): return len(self.serialsBroke()) def serialsBroke(self): return filter(lambda serial: self.isBroke(serial), self.serial2player.keys()) def playersBroke(self): return [ self.serial2player[serial] for serial in self.serialsBroke() ] def sitCount(self): return len(self.serialsSit()) def serialsSit(self): return filter(lambda x: self.serial2player[x].isSit(), self.serial2player.keys()) def playersSit(self): return [ self.serial2player[serial] for serial in self.serialsSit() ] def notPlayingCount(self): return len(self.serialsNotPlaying()) def serialsNotPlaying(self): if self.isRunning(): return filter(lambda x: not x in self.player_list, self.serial2player.keys()) else: return self.serial2player.keys() def playersNotPlaying(self): return [ self.serial2player[serial] for serial in self.serialsNotPlaying() ] def playingCount(self): return len(self.serialsPlaying()) def serialsPlaying(self): if self.isRunning(): return self.player_list else: return [] def playersPlaying(self): return [ self.serial2player[serial] for serial in self.serialsPlaying() ] def allCount(self): return len(self.serial2player) def serialsAllSorted(self): if self.dealer < 0 or self.dealer >= len(self.player_list): player_list = self.serial2player.keys() player_list.sort() return player_list else: # # The list of serials, sort from worst position to best # position (i.e. the dealer) # player_list = self.serial2player.keys() player_list.sort(lambda a,b: int(self.serial2player[a].seat - self.serial2player[b].seat)) # # The dealer is at the beginning of the list, followed by # all the players that would be dealers if he left, in order. # dealers = self.player_list[self.dealer:] + self.player_list[:self.dealer] # # If the dealer left, switch to the next one # while len(dealers) > 0 and dealers[0] not in player_list: dealers.pop(0) # # If at least one player that participated in the last # hand is still registered in the game, it is the dealer. # We use him as a reference point of the best position in # game. # if len(dealers) > 0: dealer_index = player_list.index(dealers[0]) player_list = player_list[dealer_index:] + player_list[:dealer_index] player_list.append(player_list.pop(0)) return player_list def serialsAll(self): return self.serial2player.keys() def playersAll(self): return self.serial2player.values() def inGameCount(self): return len(self.serialsInGame()) def serialsInGame(self): return filter(lambda x: self.serial2player[x].isInGame(), self.player_list) def playersInGame(self): return [ self.serial2player[serial] for serial in self.serialsInGame() ] def allInCount(self): return len(self.serialsAllIn()) def serialsAllIn(self): return filter(lambda x: self.serial2player[x].isAllIn(), self.player_list) def playersAllIn(self): return [ self.serial2player[serial] for serial in self.serialsAllIn() ] def serialsNotFoldShowdownSorted(self): next_to_dealer = self.indexAdd(self.dealer, 1) player_list = self.player_list[next_to_dealer:] + self.player_list[:next_to_dealer] return filter(lambda x: not self.serial2player[x].isFold(), player_list) def playersNotFoldShowdownSorted(self): return [ self.serial2player[serial] for serial in self.serialsNotFoldShowdownSorted() ] def notFoldCount(self): return len(self.serialsNotFold()) def serialsNotFold(self): return filter(lambda x: not self.serial2player[x].isFold(), self.player_list) def playersNotFold(self): return [ self.serial2player[serial] for serial in self.serialsNotFold() ] def playersWinner(self): return map(lambda serial: self.serial2player[serial], self.winners) def isGameEndInformationValid(self): # # Only relevant for a game that has ended and for which we want to know # if all players involved in the last hand are still seated. # if self.state != GAME_STATE_END or len(self.winners) <= 0: return False if filter(lambda serial: not self.serial2player.has_key(serial), self.winners): return False return True # # Game Parameters. # def roundCap(self): if self.isRunning(): return self.betInfo()["cap"] return 0 def betLimits(self, serial): if not self.isRunning(): return 0 info = self.betInfo() highest_bet = self.highestBetNotFold() player = self.serial2player[serial] money = player.money bet = player.bet to_call = highest_bet - bet if self.round_cap_left <= 0: return (0, 0, to_call) # # Figure out the theorical max/min bet, regarless of the # player[serial] bet/money status # if info.has_key("fixed"): fixed = int(info["fixed"]) (min_bet, max_bet) = (fixed, fixed) elif info.has_key("pow_level"): fixed = int(info["pow_level"]) * pow(2, self.getLevel() - 1) (min_bet, max_bet) = (fixed, fixed) else: if info.has_key("min"): if info["min"] == "big": min_bet = self.bigBlind() else: min_bet = int(info["min"]) elif info.has_key("min_pow_level"): min_bet = int(info["min_pow_level"]) * pow(2, self.getLevel() - 1) else: min_bet = 0 min_bet = max(min_bet, self.last_bet) if info.has_key("max"): if re.match("[0-9]+$", info["max"]): max_bet = int(info["max"]) elif info["max"] == "pot": max_bet = max(self.potAndBetsAmount() + to_call, min_bet) else: max_bet = money # # A player can't bet more than he has # min_bet = min(money, min_bet + to_call) max_bet = min(money, max_bet + to_call) return (min_bet, max_bet, to_call) def potAndBetsAmount(self): pot = self.pot for player in self.playersPlaying(): pot += player.bet return pot def autoBlindAnte(self, serial): self.getPlayer(serial).auto_blind_ante = True if self.isBlindAnteRound() and self.getSerialInPosition() == serial: self.autoPayBlindAnte() def noAutoBlindAnte(self, serial): self.getPlayer(serial).auto_blind_ante = False def autoMuck(self, serial, auto_muck): self.getPlayer(serial).auto_muck = auto_muck def payBuyIn(self, serial, amount): if not self.isTournament() and amount > self.maxBuyIn(): if self.verbose > 0: self.error("payBuyIn: maximum buy in is %d and %d is too much" % ( self.maxBuyIn(), amount )) return False player = self.getPlayer(serial) player.money = amount if self.isTournament() or player.money >= self.buyIn(): player.buy_in_payed = True return True else: if self.verbose > 0: self.error("payBuyIn: minimum buy in is %d but %d is not enough" % ( self.buyIn(), player.money )) return False def rebuy(self, serial, amount): player = self.getPlayer(serial) if not player: return False if player.money + amount + player.rebuy > self.maxBuyIn(): return False if self.isPlaying(serial): player.rebuy += amount else: player.money += amount return True def buyIn(self): return self.buy_in def maxBuyIn(self): return self.max_buy_in def bestBuyIn(self): return self.best_buy_in def getParamList(self, name): if name[:4] == "/bet": return self.__betting_structure.headerGetList(name) else: return self.__variant.headerGetList(name) def getParam(self, name): if name[:4] == "/bet": return self.__betting_structure.headerGet(name) else: return self.__variant.headerGet(name) def getParamProperties(self, name): if name[:4] == "/bet": return self.__betting_structure.headerGetProperties(name) else: return self.__variant.headerGetProperties(name) def full(self): return self.allCount() == self.max_players def empty(self): return self.allCount() == 0 def changeState(self, state): if self.verbose >= 1: self.message("changing state %s => %s" % (self.state, state)) self.state = state def isRunning(self): return not ( self.isEndOrNull() or self.state == GAME_STATE_MUCK ) def isEndOrNull(self): return self.state == GAME_STATE_NULL or self.state == GAME_STATE_END def registerCallback(self, callback): if not callback in self.callbacks: self.callbacks.append(callback) def unregisterCallback(self, callback): self.callbacks.remove(callback) def runCallbacks(self, *args): for callback in self.callbacks: callback(self.id, *args) def historyAddNoDuplicate(self, *args): if len(self.turn_history) < 1 or self.turn_history[-1] != args: self.historyAdd(*args) elif self.verbose >= 2: self.message("ignore duplicate history event " + str(args)) def historyAdd(self, *args): self.runCallbacks(*args) self.turn_history.append(args) def updateHistoryEnd(self, winners, showdown_stack): for index in range(-1, - len(self.turn_history), -1): if self.turn_history and self.turn_history[index][0] == "end": self.turn_history[index] = ( "end", winners, showdown_stack ) break def historyGet(self): return self.turn_history def historyReduce(self): index = 0 game_event = None player_list_index = 7 serial2chips_index = 9 position2serial = {} while index < len(self.turn_history): event = self.turn_history[index] type = event[0] if ( type == "showdown" or type == "muck" or ( type == "round" and event[1] != GAME_STATE_BLIND_ANTE ) ): break elif type == "game": game_event = self.turn_history[index] position = 0 for serial in game_event[player_list_index]: position2serial[position] = serial position += 1 index += 1 elif ( type == "sitOut" or type == "wait_blind" ): (type, serial) = event # # del position + sitOut/wait_blind # if index < 1 or self.turn_history[index-1][0] != "position": if self.verbose >= 0: self.message(pformat(self.turn_history)) self.error("unable to update sitOut or wait_blind") # # help unit test : it is not meaningful to do anything on a corrupted # history. Therefore the following line is not doing anything (or # repair anything). It only helps run unit tests. # del self.turn_history[index] else: del self.turn_history[index] del self.turn_history[index - 1] index -= 1 # # remove references to the player who finally # decided to not be part of the turn, either because # he sits out or because he waits for the big blind # game_event[player_list_index].remove(serial) del game_event[serial2chips_index][serial] elif ( type == "blind_request" or type == "ante_request" or type == "player_list" ): # # del, if not the last event # if index < len(self.turn_history) - 1: if type == "player_list": game_event[player_list_index][:] = event[1] del self.turn_history[index] else: index += 1 elif ( type == "wait_for" ): (type, serial, wait_for) = event del self.turn_history[index] # # remove references to the player who is # not in the turn because he must wait for # the late blind # if serial in game_event[player_list_index]: game_event[player_list_index].remove(serial) del game_event[serial2chips_index][serial] else: index += 1 # # Reset the positions of the players to take in account the removed players # for index in xrange(0, min(index, len(self.turn_history))): event = self.turn_history[index] if event[0] == "position" and event[1] >= 0: try: self.turn_history[index] = ( event[0], game_event[player_list_index].index(position2serial[event[1]]) ) except: if self.verbose >= 0: self.message(pformat(self.turn_history)) self.error("unable to update position") def error(self, string): if self.verbose >= 0: self.message("ERROR: " + string) def message(self, string): print self.prefix + "[PokerGame " + str(self.id) + "] " + string class PokerGameServer(PokerGame): def __init__(self, url, dirs): PokerGame.__init__(self, url, True, dirs) # is_directing == True class PokerGameClient(PokerGame): def __init__(self, url, dirs): PokerGame.__init__(self, url, False, dirs) # is_directing == False poker-engine-1.3.6/pokerengine/__init__.py0000644000175000017500000000003111354224223015434 00000000000000version_number = "1.3.6" poker-engine-1.3.6/pokerengine/Makefile.am0000644000175000017500000000226411344205422015370 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # # MAINTAINERCLEANFILES = Makefile.in pokerenginedir = ${pythondir}/pokerengine pokerengine_PYTHON = \ __init__.py \ pokercards.py \ pokerchips.py \ pokerengineconfig.py \ pokergame.py \ pokerrake.py \ pokerprizes.py \ pokertournament.py \ version.py poker-engine-1.3.6/pokerengine/pokercards.py0000644000175000017500000001426111344205422016043 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Henry Precheur (2004) # from types import * from pokereval import PokerEval def visible_card(card): return (card & PokerCards.VALUE_CARD_MASK) def not_visible_card(card): return (card | PokerCards.NOT_VISIBLE_CARD) def is_visible(card): return (card & PokerCards.VISIBLE_CARD_MASK) == PokerCards.VISIBLE_CARD def card_value(card): return (card & PokerCards.VALUE_CARD_MASK) letter2name = { 'A': 'Ace', 'K': 'King', 'Q': 'Queen', 'J': 'Jack', 'T': 'Ten', '9': 'Nine', '8': 'Eight', '7': 'Seven', '6': 'Six', '5': 'Five', '4': 'Four', '3': 'Trey', '2': 'Deuce' } letter2names = { 'A': 'Aces', 'K': 'Kings', 'Q': 'Queens', 'J': 'Jacks', 'T': 'Tens', '9': 'Nines', '8': 'Eights', '7': 'Sevens', '6': 'Sixes', '5': 'Fives', '4': 'Fours', '3': 'Treys', '2': 'Deuces' } class PokerCards: NOCARD = 255 MAX_CARD = 64 # 64 > 52 cards 0x0100 0000 NB_CARD = 52 VALUE_CARD_MASK = MAX_CARD - 1 # 0x0011 1111 VISIBLE_CARD_MASK = 0xC0 # ~(VALUE_CARD_MASK) # ~(0x0011 1111) = 0x1100 0000 VISIBLE_CARD = 0 NOT_VISIBLE_CARD = VISIBLE_CARD_MASK def __init__(self, cards = []): self.set(cards) def __eq__(self, other): if type(self) != type(other): return False cards = self.cards[:] cards.sort() other_cards = other.cards[:] other_cards.sort() return cards == other_cards def __ne__(self, other): return type(self) != type(other) or not self.__eq__(other) def __str__(self): return str([ "Card(%d, %s)" % (x & PokerCards.VALUE_CARD_MASK, (x & PokerCards.VISIBLE_CARD_MASK and "not visible") or "visible") for x in self.cards ]) def __repr__(self): return "%s(%s)" % (self.__class__.__name__, self.cards) def nocard(self): return PokerCards.NOCARD def copy(self): other = PokerCards() other.cards = [ x for x in self.cards ] return other def getValue(self, card): value = None if type(card) is StringType: eval = PokerEval() try: value = eval.string2card(card) except RuntimeError: raise UserWarning, "Invalid card %s" %(card) else: if card != PokerCards.NOCARD: value = card & PokerCards.VALUE_CARD_MASK if (value < 0) or (value >= PokerCards.NB_CARD): raise UserWarning, "Invalid card %s" %(card) value = card return value def set(self, cards): self.cards = [] if isinstance(cards,PokerCards): self.cards = cards.cards[:] return if not type(cards) is ListType: cards = [cards] self.cards = map(self.getValue,cards) def add(self, card, visible): card_value = self.getValue(card) self.cards.append(card_value | ((not visible and PokerCards.NOT_VISIBLE_CARD) or PokerCards.VISIBLE_CARD)) def allVisible(self): for i in xrange(len(self.cards)): self.cards[i] = visible_card(self.cards[i]) def allHidden(self): for i in xrange(len(self.cards)): self.cards[i] = not_visible_card(self.cards[i]) def hasCard(self, value): for card in self.cards: if value == self.nocard(): if card == self.nocard(): return True elif card & PokerCards.VALUE_CARD_MASK == value: return True return False def areVisible(self): for card in self.cards: if card & PokerCards.NOT_VISIBLE_CARD: return False return True def areHidden(self): for card in self.cards: if is_visible(card): return False return True def areAllNocard(self): for card in self.cards: if card != PokerCards.NOCARD: return False return True def setVisible(self, value, visible): if value == self.nocard(): return for i in xrange(len(self.cards)): if self.cards[i] & PokerCards.VALUE_CARD_MASK == value: if visible: self.cards[i] = visible_card(value) else: self.cards[i] = not_visible_card(value) def tolist(self, show_all): result = [] for card in self.cards: if is_visible(card) or show_all and card != PokerCards.NOCARD: result.append(card_value(card)) else: result.append(self.nocard()) return result def toRawList(self): return self.cards[:] def getVisible(self): return filter(lambda card: is_visible(card), self.cards) def isEmpty(self): return len(self.cards) == 0 def len(self): return len(self.cards) def loseNotVisible(self): self.cards = map(lambda card: card & PokerCards.NOT_VISIBLE_CARD and PokerCards.NOCARD or card, self.cards) poker-engine-1.3.6/pokerengine/pokerprizes.py0000644000175000017500000001033011344205422016254 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2008 Bradley M. Kuhn # Copyright (C) 2004, 2005, 2006 Mekensleep # 26 rue des rosiers, 75004 Paris # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Bradley M. Kuhn # from pokerengine.pokerengineconfig import Config class PokerPrizes: """PokerPrizesVirtual base class for PokerPrizes""" def __init__(self, buy_in_amount, player_count = 0, guarantee_amount = 0, config_dirs = None): self.buy_in = buy_in_amount self.player_count = player_count self.guarantee_amount = guarantee_amount def error(self, string): self.message("ERROR " + string) def message(self, string): print "[PokerPrizes] " + string def addPlayer(self): self.player_count += 1 def removePlayer(self): self.player_count -= 1 def getPrizes(self): errStr = "getPrizes NOT IMPLEMENTED IN ABSTRACT BASE CLASS" self.error(errStr) raise NotImplementedError(errStr) class PokerPrizesAlgorithm(PokerPrizes): def getPrizes(self): buy_in = self.buy_in candidates_count = self.player_count if candidates_count < 5: winners = 1 elif candidates_count < 10: winners = 2 elif candidates_count < 20: winners = 3 elif candidates_count < 30: winners = 4 elif candidates_count < 40: winners = 6 elif candidates_count < 50: winners = int(candidates_count * 0.2) elif candidates_count < 200: winners = int(candidates_count * 0.15) else: winners = int(candidates_count * 0.1) prizes = [] prize_pool = max(self.guarantee_amount, buy_in * candidates_count) money_left = prize_pool while winners > 0: if money_left / winners < max(1, prize_pool / 100, int(buy_in * 2.5)): prizes.extend([ money_left / winners ] * winners) winners = 0 else: money_left /= 2 winners -= 1 prizes.append(money_left) rest = prize_pool - sum(prizes) prizes[0] += rest return prizes class PokerPrizesTable(PokerPrizes): def __init__(self, buy_in_amount, player_count = 0, guarantee_amount = 0, config_dirs = ['.'], config_file_name = "poker.payouts.xml"): self._loadPayouts(config_dirs, config_file_name) PokerPrizes.__init__(self, buy_in_amount = buy_in_amount, player_count = player_count, guarantee_amount = guarantee_amount) def _loadPayouts(self, dirs, config_file_name): config = Config(dirs) config.load(config_file_name) self.payouts = [] for node in config.header.xpathEval("/payouts/payout"): properties = config.headerNodeProperties(node) self.payouts.append(( int(properties['max']), map(lambda percent: float(percent) / 100, node.content.split()))) def getPrizes(self): buy_in = self.buy_in for ( maximum, payouts ) in self.payouts: if self.player_count <= maximum: break total = max(self.guarantee_amount, self.player_count * buy_in) prizes = map(lambda percent: int(total * percent), payouts) # # What's left because of rounding errors goes to the tournament winner # prizes[0] += total - sum(prizes) return prizes poker-engine-1.3.6/pokerengine/version.py0000644000175000017500000001326711344205422015400 00000000000000# -*- python -*- # # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # # from types import StringType import re from pokerengine import version_number class Version: verbose = 0 version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)$', re.VERBOSE) upgrade_re = re.compile(r'.*?(\d+\.\d+\.\d+)-(\d+\.\d+\.\d+)', re.VERBOSE) def __init__ (self, vstring=None): if vstring: self.parse(vstring) def __repr__ (self): return "%s ('%s')" % (self.__class__.__name__, str(self)) def __str__ (self): return "%d.%d.%d" % self.version def __hash__(self): return hash(str(self)) def __cmp__ (self, other): if isinstance(other, StringType): other = Version(other) return cmp(self.version, other.version) def __add__(self, num): ver = Version() ver.version = (self.version[0], self.version[1], self.version[2] + num) return ver def __iadd__(self, num): self.version = (self.version[0], self.version[1], self.version[2] + num) return self def sub(ver, num): version = list(ver.version) if version[2] - num < 0: if version[1] - num < 0: if version[0] - num < 0: raise UserWarning, "cannot subtract %d from version %s" % ( num, str(ver) ) else: version[0] -= num else: version[1] -= num else: version[2] -= num ver.version = tuple(version) return ver sub = staticmethod(sub) def __isub__(self, num): return Version.sub(self, num) def __sub__(self, num): return Version.sub(Version(str(self)), num) def major(self): return self.version[0] def medium(self): return self.version[1] def minor(self): return self.version[2] def parse(self, vstring): match = Version.version_re.match(vstring) if not match: raise ValueError, "invalid version number '%s'" % vstring (major, medium, minor) = match.groups() self.version = tuple(map(int, [major, medium, minor])) def upgradeChain(self, desired_version, strings): current_version = self upgrade_matrix = {} for string in strings: match = Version.upgrade_re.match(string) if match: ( version_from, version_to ) = map(Version, match.groups()) if ( ( version_from >= current_version and version_from < desired_version ) and ( version_to > current_version and version_to <= desired_version ) ): upgrade_matrix.setdefault(version_from, {}) if upgrade_matrix[version_from].has_key(version_to): if Version.verbose >= 0: print "Version: duplicate upgrade string (%s => %s) keep %s, ignore %s" % ( version_from, version_to, upgrade_matrix[version_from][version_to], string) else: upgrade_matrix[version_from][version_to] = string # # Each time a version requires an upgrade (presumably for database or configuration # file changes), a string of the kind upgrade-1.0.1-1.0.2 indicates # the availability of an upgrade from version 1.0.1 to version 1.0.2. # # When switching from version 1.0.0 to version 1.0.6, # upgradeChain return upgrade-1.0.1-1.0.2 meaning that this # upgrade must be applied. If there also is an # upgrade-1.0.3-1.0.5, upgradeChain will return ( upgrade-1.0.1-1.0.2, upgrade-1.0.3-1.0.5 ) # meaning that both upgrades must be applied in that order. # # If there was a string upgrade-0.9.0-1.0.0 or # upgrade-3.0.0-3.1.0 in the list of available upgrades, they # would be ignored. # # If there are more than one upgrade from a given version (for instance # upgrade-1.0.0-1.0.1 and upgrade-1.0.0-1.0.4), the one that allows to # upgrade to the highest version is preferred. # chain = [] while current_version != desired_version: candidate_versions = filter(lambda version: version >= current_version, upgrade_matrix.keys()) if candidate_versions: candidate_version = min(candidate_versions) upgrades = upgrade_matrix[candidate_version] current_version = max(upgrades.keys()) chain.append(upgrades[current_version]) else: # # There is not necessarily an upgrade file reaching the desired version, # for instance if there was no change. # break return chain version = Version(version_number) poker-engine-1.3.6/pokerengine/pokertournament.py0000644000175000017500000005534511344205422017153 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2008, 2009 Bradley M. Kuhn # Copyright (C) 2004, 2005, 2006 Mekensleep # 26 rue des rosiers, 75004 Paris # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Bradley M. Kuhn # from math import ceil from types import StringType from pprint import pformat import time, sys, random def tournament_seconds(): return time.time() shuffler = random from pokerengine.pokergame import PokerGameServer from pokerengine import pokerprizes TOURNAMENT_STATE_ANNOUNCED = "announced" TOURNAMENT_STATE_REGISTERING = "registering" TOURNAMENT_STATE_RUNNING = "running" TOURNAMENT_STATE_BREAK_WAIT = "breakwait" TOURNAMENT_STATE_BREAK = "break" TOURNAMENT_STATE_COMPLETE = "complete" TOURNAMENT_STATE_CANCELED = "canceled" def equalizeCandidates(games): # # Games less than 70% full are willing to steal players from other # games. Games that are more than 70% full and that are not # running are willing to provide players to others. # want_players = [] provide_players = [] for game in games: threshold = int(game.max_players * .7) count = game.allCount() if count < threshold: want_players.append([ game.id, game.max_players - count ]) elif game.isEndOrNull(): serials = game.serialsAllSorted() provide_players.append((game.id, serials[:count - threshold])) return ( want_players, provide_players ) def equalizeGames(games, verbose = 0, log_message = None): ( want_players, provide_players ) = equalizeCandidates(games) results = [] if len(want_players) <= 0: return results consumer_index = 0 for (id, serials) in provide_players: want_players.sort(lambda a,b: int(a[1] - b[1])) if want_players[0][1] == 0: # # All satisfied, stop looping # break while len(serials) > 0: distributed = False for i in xrange(len(want_players)): consumer = want_players[consumer_index] consumer_index = ( consumer_index + 1 ) % len(want_players) if consumer[1] > 0: consumer[1] -= 1 serial = serials.pop(0) results.append(( id, consumer[0], serial )) distributed = True if len(serials) <= 0: break if not distributed: break if log_message and verbose > 0 and len(results) > 0: log_message("balanceGames equalizeGames: " + pformat(results)) return results def breakGames(games, verbose = 0, log_message = None): if len(games) < 2: return [] games = games[:] # # Games not running first, then games running. # Each is sorted with games that have least players first. # games.sort(lambda a,b: b.isEndOrNull() - a.isEndOrNull() or int(a.allCount() - b.allCount()) ) to_break = [ { "id": game.id, "seats_left": game.max_players - game.allCount(), "serials": game.serialsAll(), "to_add": [], "running": not game.isEndOrNull() } for game in games ] if verbose > 2: log_message("balanceGames breakGames: %s" % to_break) results = [] while True: result = breakGame(to_break[0], to_break[1:], verbose, log_message) to_break = filter(lambda game: game["seats_left"] > 0, to_break[1:]) if result == False: break results.extend(result) if len(to_break) < 2: break if log_message and verbose > 0 and len(results) > 0: log_message("balanceGames breakGames: " + pformat(results)) return results def breakGame(to_break, to_fill, verbose = 0, log_message = None): # # Can't break a game in which players were moved or # that are running. # if len(to_break["to_add"]) > 0 or to_break["running"]: return False seats_left = sum([ game["seats_left"] for game in to_fill ]) serials = to_break["serials"] id = to_break["id"] # # Don't break a game if there is not enough seats at the # other games # if seats_left < len(serials): return False # # Fill the largest games first, in the hope that the smallest # games can be broken later. # to_fill.reverse() result = [] for game in to_fill: if game["seats_left"] > 0: count = min(game["seats_left"], len(serials)) game["to_add"].extend(serials[:count]) game["seats_left"] -= count result.append((id, game["id"], serials[:count])) serials = serials[count:] if len(serials) <= 0: break; return result class PokerTournament: def __init__(self, *args, **kwargs): self.name = kwargs.get('name', 'no name') self.description_short = kwargs.get('description_short', 'nodescription_short') self.description_long = kwargs.get('description_long', 'nodescription_long') self.serial = kwargs.get('serial', 1) self.verbose = kwargs.get('verbose', 0) self.players_quota = kwargs.get('players_quota', 10) self.players_min = kwargs.get('players_min', 2) self.variant = kwargs.get('variant', 'holdem') self.betting_structure = kwargs.get('betting_structure', 'level-15-30-no-limit') self.dirs = kwargs.get('dirs', []) self.seats_per_game = kwargs.get('seats_per_game', 10) self.sit_n_go = kwargs.get('sit_n_go', 'y') self.register_time = kwargs.get('register_time', 0) self.start_time = kwargs.get('start_time', 0) self.breaks_first = kwargs.get('breaks_first', 7200) self.breaks_interval = kwargs.get('breaks_interval', 3600) self.breaks_duration = kwargs.get('breaks_duration', 300) self.breaks_running_since = -1 self.breaks_since = -1 self.breaks_count = 0 self.buy_in = int(kwargs.get('buy_in', 0)) self.rake = int(kwargs.get('rake', 0)) self.rebuy_delay = kwargs.get('rebuy_delay', 0) self.add_on = kwargs.get('add_on', 0) self.add_on_delay = kwargs.get('add_on_delay', 60) self.prize_min = kwargs.get('prize_min', 0) self.prizes_specs = kwargs.get('prizes_specs', "table") self.rank2prize = None self.finish_time = -1 if type(self.start_time) is StringType: self.start_time = int(time.mktime(time.strptime(self.start_time, "%Y/%m/%d %H:%M"))) self.prefix = "" self.players = [] self.need_balance = False self.registered = 0 self.winners = [] self.state = TOURNAMENT_STATE_ANNOUNCED self.can_register = False self.games = [] self.id2game = {} self.callback_new_state = lambda tournament, old_state, new_state: True self.callback_create_game = lambda tournament: PokerGameServer("poker.%s.xml", tournament.dirs) # I think callback_game_filled() is a misnomer because it's not # about the table being "filled" (i.e., the table could have less # than the max seated at it). What really happens is that the # callback_game_filled() is made when the table is deemed to have # the number of players at it the tourney manager has decided # belong there (which may or may not be "filled"). self.callback_game_filled = lambda tournament, game: True self.callback_destroy_game = lambda tournament, game: True self.callback_move_player = lambda tournament, from_game_id, to_game_id, serial: self.movePlayer(from_game_id, to_game_id, serial) self.callback_remove_player = lambda tournament, game_id, serial: self.removePlayer(game_id, serial) self.callback_cancel = lambda tournament: True self.loadPayouts() self.updateRegistering() def loadPayouts(self): if self.sit_n_go == 'y': player_count = self.players_quota else: player_count = self.registered self.prizes_object = pokerprizes.__dict__['PokerPrizes' + self.prizes_specs.capitalize()](buy_in_amount = self.buy_in, player_count = player_count, guarantee_amount = self.prize_min, config_dirs = self.dirs) def message(self, message): print self.prefix + "[PokerTournament %s] " % self.name + message def canRun(self): if self.start_time < tournament_seconds(): if self.sit_n_go == 'y' and self.registered >= self.players_quota: return True elif self.sit_n_go == 'n': if self.registered >= self.players_min: return True else: return None else: return False else: return False def getRank(self, serial): try: winners_count = len(self.winners) rank_first = self.registered - winners_count return self.winners.index(serial) + rank_first + 1 except: return -1 def updateRegistering(self): if self.state == TOURNAMENT_STATE_ANNOUNCED: now = tournament_seconds() if now - self.register_time > 0.0: self.changeState(TOURNAMENT_STATE_REGISTERING) return -1 else: return self.register_time - now else: if self.verbose > 0: self.message("updateRegistering: should not be called while tournament is not in announced state") return -1 def updateRunning(self): if self.state == TOURNAMENT_STATE_REGISTERING: ready = self.canRun() if ready == True: self.changeState(TOURNAMENT_STATE_RUNNING) elif ready == None: self.changeState(TOURNAMENT_STATE_CANCELED) elif ready == False: pass def remainingBreakSeconds(self): if self.breaks_since > 0: return self.breaks_duration - ( tournament_seconds() - self.breaks_since ) else: return None def updateBreak(self, game_id = None): if self.breaks_duration <= 0: return False if self.state == TOURNAMENT_STATE_RUNNING: running_duration = tournament_seconds() - self.breaks_running_since if self.breaks_count > 0: running_max = self.breaks_interval else: running_max = self.breaks_first if running_duration >= running_max: self.breaks_games_id = [] self.changeState(TOURNAMENT_STATE_BREAK_WAIT) if self.state == TOURNAMENT_STATE_BREAK_WAIT: # # game_id is 0 when updateBreak is called after a table was destroyed # as a side effect of balanceGames # if game_id > 0: self.breaks_games_id.append(game_id) on_break = True for game in self.games: # # games with a single player must not be taken into account because # nothing happens on them. Either it is the last game with a single # player and must be considered ready to enter the break. Or there # are still other tables playing and the game with a single player # may be broken and the player moved to another table when the hand # finishes at one of the other tables. # # If the games with a single player are not ignored, a two game # tournament would enter a deadlock in the following situation: # 1) table T1 finishes its hand and only has one player left # tournament is not on BREAK_WAIT # 2) tournament break time is reached # 3) table T2 finishes its hand, no player is busted. # endTurn is called and tournament enters BREAK_WAIT # T2 is added to the list of tables for which there # is not need to wait before declaring the tournament # on break. Because T1 has only one player left and # all other tables are expecting the break (i.e. no # hand will be played), it can be added to the list # of tables ready for the break. # # if game.id not in self.breaks_games_id and len(game.playersAll()) > 1: on_break = False break if on_break: del self.breaks_games_id self.changeState(TOURNAMENT_STATE_BREAK) if self.state == TOURNAMENT_STATE_BREAK: if self.remainingBreakSeconds() <= 0: self.changeState(TOURNAMENT_STATE_RUNNING) if self.state not in (TOURNAMENT_STATE_RUNNING, TOURNAMENT_STATE_BREAK_WAIT, TOURNAMENT_STATE_BREAK): if self.verbose >= 0: print "PokerTournament:updateBreak: is not supposed to be called while in state %s" % self.state return None return True def changeState(self, state): if self.state == TOURNAMENT_STATE_ANNOUNCED and state == TOURNAMENT_STATE_REGISTERING: self.can_register = True elif self.state == TOURNAMENT_STATE_RUNNING and state == TOURNAMENT_STATE_BREAK_WAIT: pass elif self.state == TOURNAMENT_STATE_BREAK_WAIT and state == TOURNAMENT_STATE_BREAK: self.breaks_since = tournament_seconds() elif self.state == TOURNAMENT_STATE_BREAK and state == TOURNAMENT_STATE_RUNNING: self.breaks_since = -1 self.breaks_running_since = tournament_seconds() elif self.state == TOURNAMENT_STATE_REGISTERING and state == TOURNAMENT_STATE_RUNNING: self.start_time = tournament_seconds() self.breaks_running_since = self.start_time self.createGames() self.can_register = False elif self.state == TOURNAMENT_STATE_REGISTERING and state == TOURNAMENT_STATE_CANCELED: self.can_register = False self.cancel() self.finish_time = tournament_seconds() elif ( self.state in ( TOURNAMENT_STATE_RUNNING, TOURNAMENT_STATE_BREAK_WAIT ) and state == TOURNAMENT_STATE_COMPLETE ): self.finish_time = tournament_seconds() else: if self.verbose >= 0: print "PokerTournament:changeState: cannot change from state %s to state %s" % ( self.state, state ) return if self.verbose > 2: self.message("state change %s => %s" % ( self.state, state )) old_state = self.state self.state = state self.callback_new_state(self, old_state, self.state) def isRegistered(self, serial): return serial in self.players def canRegister(self, serial): if self.can_register and self.registered < self.players_quota: return not self.isRegistered(serial) else: return False def canUnregister(self, serial): return self.isRegistered(serial) and self.state == TOURNAMENT_STATE_REGISTERING def register(self, serial): if self.can_register: self.players.append(serial) self.registered += 1 if self.sit_n_go != 'y': self.prizes_object.addPlayer() self.rank2prize = None if self.state == TOURNAMENT_STATE_REGISTERING: self.updateRunning() elif self.state == TOURNAMENT_STATE_RUNNING: self.sitPlayer(serial) return True else: return False def unregister(self, serial): if self.state == TOURNAMENT_STATE_REGISTERING: self.players.remove(serial) self.registered -= 1 if self.sit_n_go != 'y': self.prizes_object.removePlayer() self.rank2prize = None return True else: return False def cancel(self): if self.state == TOURNAMENT_STATE_REGISTERING: self.callback_cancel(self) self.players = [] self.registered = 0 return True else: return False def sitPlayer(self, serial): pass def removePlayer(self, game_id, serial): game = self.id2game[game_id] game.removePlayer(serial) def movePlayer(self, from_game_id, to_game_id, serial): from_game = self.id2game[from_game_id] to_game = self.id2game[to_game_id] from_game.open() to_game.open() from_player = from_game.getPlayer(serial) to_game.addPlayer(serial) to_player = to_game.getPlayer(serial) to_game.payBuyIn(serial, from_player.money) to_game.sit(serial) to_game.autoBlindAnte(serial) to_player.name = from_player.name to_player.setUserData(from_player.getUserData()) if(from_player.isSitOut()): to_game.sitOut(serial) if(from_player.isBot()): to_game.botPlayer(serial) from_game.removePlayer(serial) from_game.close() to_game.close() def createGames(self): games_count = int(ceil(self.registered / float(self.seats_per_game))) self.players_quota = games_count * self.seats_per_game players = self.players[:] shuffler.shuffle(players) for id in xrange(1, games_count + 1): game = self.callback_create_game(self) game.verbose = self.verbose game.setTime(0) game.setVariant(self.variant) game.setBettingStructure(self.betting_structure) game.setMaxPlayers(self.seats_per_game) if game.id == 0: game.id = id buy_in = game.buyIn() for seat in xrange(self.seats_per_game): if not players: break player = players.pop() game.addPlayer(player) game.payBuyIn(player, buy_in) game.sit(player) game.autoBlindAnte(player) self.games.append(game) self.id2game = dict(zip([ game.id for game in self.games ], self.games)) # Next, need to call balance games, because the table assignment # algorithm above does not account for scenarios where the last # few people end up a table too small. self.balanceGames() # Next, we can now notify via callback that all the games in # self.games have been "filled". for game in self.games: self.callback_game_filled(self, game) game.close() def endTurn(self, game_id): game = self.id2game[game_id] loosers = game.serialsBroke() loosers_count = len(loosers) for serial in loosers: self.winners.insert(0, serial) self.callback_remove_player(self, game_id, serial) if self.verbose > 2: self.message("winners %s" % self.winners) if len(self.winners) + 1 == self.registered: game = self.games[0] player = game.playersAll()[0] self.winners.insert(0, player.serial) self.callback_remove_player(self, game.id, player.serial) money = player.money player.money = 0 expected = game.buyIn() * self.registered if money != expected and self.verbose >= 0: self.message("ERROR winner has %d chips and should have %d chips" % ( money, expected )) if self.verbose > 0: self.message("winners %s" % self.winners) self.callback_destroy_game(self, game) self.games = [] self.id2game = {} self.changeState(TOURNAMENT_STATE_COMPLETE) return False else: if loosers_count > 0 or self.need_balance: self.balanceGames() if self.id2game.has_key(game_id): self.updateBreak(game_id) else: # # This happens if game_id was destroyed by the call to balanceGames above # self.updateBreak(0) return True def balanceGames(self): self.need_balance = False if len(self.games) < 2: return if self.verbose > 2: self.message("balanceGames") to_break = breakGames(self.games, self.verbose, self.message) games_broken = {} for (from_id, to_id, serials) in to_break: for serial in serials: if self.verbose > 2: self.message("balanceGames: player %d moved from %d to %d" % ( serial, from_id, to_id )) if self.state == TOURNAMENT_STATE_REGISTERING: self.movePlayer(from_id, to_id, serial) else: self.callback_move_player(self, from_id, to_id, serial) games_broken[from_id] = True if len(to_break) > 0: for game_id in games_broken.keys(): game = self.id2game[game_id] self.callback_destroy_game(self, game) self.games.remove(game) del self.id2game[game.id] if self.verbose > 0: self.message("balanceGames: broke tables %s" % to_break) return True to_equalize = equalizeGames(self.games, self.verbose, self.message) for (from_id, to_id, serial) in to_equalize: if self.verbose > 2: self.message("balanceGames: player %d moved from %d to %d" % ( serial, from_id, to_id )) if self.state == TOURNAMENT_STATE_REGISTERING: self.movePlayer(from_id, to_id, serial) else: self.callback_move_player(self, from_id, to_id, serial) ( want_players, provide_players ) = equalizeCandidates(self.games) self.need_balance = want_players and not provide_players if self.need_balance and self.verbose > 2: self.message("balanceGames: postponed game equalization") return len(to_equalize) > 0 def prizes(self): if not self.rank2prize: self.rank2prize = self.prizes_object.getPrizes() return self.rank2prize poker-engine-1.3.6/pokerengine/pokerengineconfig.py0000644000175000017500000001435311344205422017404 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import os from os.path import exists, expanduser, abspath, isfile from pokerengine.version import Version, version import re import libxml2 import libxslt class Config: upgrades_repository = None upgrade_dry_run = False verbose = 0 def __init__(self, dirs): self.path = None self.header = None self.doc = None self.dirs = [ expanduser(dir) for dir in dirs ] self.version = version def __del__(self): self.free() def free(self): if self.doc: self.doc.freeDoc() self.doc = None if self.header: self.header.xpathFreeContext() self.header = None def reload(self): self.free() self.doc = libxml2.parseFile(self.path) self.header = self.doc.xpathNewContext() def load(self, path): for dir in self.dirs: tmppath = abspath(expanduser(dir and (dir + "/" + path) or path )) if exists(tmppath): self.path = tmppath break self.free() if self.path: self.doc = libxml2.parseFile(self.path) self.header = self.doc.xpathNewContext() if Config.upgrades_repository: self.checkVersion("poker_engine_version", version, Config.upgrades_repository) return True else: if self.verbose >= 0: print "Config::load: unable to find %s in directories %s" % ( path, self.dirs ) return False def checkVersion(self, version_attribute, software_version, upgrades_repository, default_version = "1.0.5"): version_node = self.header.xpathEval("/child::*/@" + version_attribute) if not version_node: root_node = self.doc.getRootElement() root_node.newProp(version_attribute, default_version) if not self.upgrade_dry_run: self.save() file_version = Version(default_version) if self.verbose > 0: print "Config::checkVersion: " + self.path + ": set default version to " + default_version else: file_version = Version(version_node[0].content) if software_version != file_version: if software_version > file_version: if self.verbose > 0: print "Config::checkVersion: " + str(self.path) + ": launch upgrade from " + str(file_version) + " to " + str(software_version) + " using repository " + str(upgrades_repository) self.upgrade(version_attribute, file_version, software_version, upgrades_repository) return False else: raise Exception, "Config: %s requires an upgrade to software version %s or better" % ( self.path, str(file_version) ) else: if self.verbose > 0: print "Config::checkVersion: " + self.path + ": up to date" return True def upgrade(self, version_attribute, file_version, software_version, upgrades_repository): if upgrades_repository and os.path.exists(upgrades_repository): files = map(lambda file: upgrades_repository + "/" + file, os.listdir(upgrades_repository)) files = filter(lambda file: isfile(file) and ".xsl" in file, files) for file in file_version.upgradeChain(software_version, files): if self.verbose > 0: print "Config::upgrade: " + self.path + " with " + file styledoc = libxml2.parseFile(file) style = libxslt.parseStylesheetDoc(styledoc) result = style.applyStylesheet(self.doc, None) if not self.upgrade_dry_run: style.saveResultToFilename(self.path, result, compression = 0) result.freeDoc() # apparently deallocated by freeStylesheet # styledoc.freeDoc() style.freeStylesheet() if not self.upgrade_dry_run: self.reload() else: if self.verbose > 0: print "Config::upgrade: %s is not a directory, ignored" % str(upgrades_repository) if not self.upgrade_dry_run: self.headerSet("/child::*/@" + version_attribute, str(software_version)) self.save() def save(self): if not self.path: if self.verbose >= 0: print "unable to write back, invalid path" return self.doc.saveFile(self.path) def headerGetList(self, name): result = self.header.xpathEval(name) return [o.content for o in result] def headerGetInt(self, name): string = self.headerGet(name) if re.match("[0-9]+$", string): return int(string) else: return 0 def headerGet(self, name): results = self.header.xpathEval(name) return results and results[0].content or "" def headerSet(self, name, value): results = self.header.xpathEval(name) results[0].setContent(value) def headerGetProperties(self, name): results = [] for node in self.header.xpathEval(name): results.append(self.headerNodeProperties(node)) return results def headerNodeProperties(self, node): result = {} property = node.properties while property != None: result[property.name] = property.content property = property.next return result poker-engine-1.3.6/aclocal.m40000644000175000017500000017143711540702063012700 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, [m4_warning([this file was generated for autoconf 2.67. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # po.m4 serial 17 (gettext-0.18) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl python2.1 python2.0]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(too old)]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. distutils does not exist in dnl Python 1.5, so we fall back to the hardcoded directory if it dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. distutils does not exist in dnl Python 1.5, so we fall back to the hardcoded directory if it dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR poker-engine-1.3.6/pokerconfigupgrade.in0000644000175000017500000001004011344205422015223 00000000000000#!@PYTHON@ # -*- encoding: iso-8859-1; mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os, getopt, stat, string sys.path.insert(0, "@top_srcdir@") def usage(): print """ pokerconfigupgrade [--module=] [--help] [--verbose=] [--dry-run] [--upgrades=] [--reference=] [directory or file.xml] ... """ def my_import(name): mod = __import__(name) components = name.split('.') for comp in components[1:]: mod = getattr(mod, comp) return mod def main(): try: opts, args = getopt.getopt(sys.argv[1:], "hvdumr", ["help", "verbose=", "dry-run", "upgrades=", "module=", "reference=" ]) except getopt.GetoptError: usage() sys.exit(2) upgrades = None configuration_file = None module = "pokerengine.pokerengineconfig" reference = None verbose = 0 dry_run = False for o, a in opts: if o in ("-h", "--help"): usage() sys.exit(0) if o in ("-d", "--dry-run"): dry_run = True if o in ("-u", "--upgrades"): upgrades = a if o in ("-m", "--module"): module = a if o in ("-r", "--reference"): reference = a if o in ("-v", "--verbose"): verbose = int(a) if not upgrades and not reference: print "must specify either --upgrades or --reference" sys.exit(3) if upgrades: config_module = my_import(module) config_class = config_module.__dict__['Config'] files = [] for path in args: if os.path.exists(path): if os.path.isfile(path): files.append(path) elif os.path.isdir(path): files_tmp = map(lambda file: path + "/" + file, os.listdir(path)) files.extend(filter(lambda file: os.path.isfile(file), files_tmp)) else: raise Exception, "The type of the file " + path + " is unknown" else: raise Exception, "File not found " + path files = filter(lambda file: string.find(file, ".xml") >= 0, files) for file in files: mode = os.stat(file)[stat.ST_MODE] if not mode & stat.S_IWUSR: os.chmod(file, mode | 0200) config_class.upgrades_repository = upgrades config_class.verbose = verbose config_class.upgrade_dry_run = dry_run config = config_class(['']) for file in files: config.load(file) if reference: if ( len(args) != 1 or not os.path.isdir(args[0]) ): print "--reference requires a single directory argument, target of the upgrade" sys.exit(4) target = args[0] rsync_verbose = verbose and "-v" or "" rsync_command = "@RSYNC@ --exclude CVS -a " + rsync_verbose + " --ignore-existing " + reference + "/ " + target + "/" if verbose: print rsync_command if not dry_run: if os.system(rsync_command): sys.exit(5) return 0 if __name__ == "__main__": sys.exit(main()) poker-engine-1.3.6/ChangeLog0000644000175000017500000022451011540657677012625 000000000000002011-03-18 Loic Dachary * Release 1.3.6 * debian/rules: clean:: $(DEB_BUILDDIR)/config.status replaced by clean:: debian/stamp-autotools-configure for the sake of packaging-farm * debian/changelog, debian/control, debian/control.breezy, debian/control.dapper, debian/control.edgy, debian/control.etch, debian/control.feisty, debian/control.gutsy, debian/control.hardy, debian/control.hoary, debian/control.intrepid, debian/control.jaunty, debian/control.lenny, debian/control.sarge, debian/control.squeeze, debian/control.unstable, debian/rules: release 1.3.6 and fix bug#616944 2010-04-06 Loic Dachary * debian/control.squeeze: squeeze support 2010-03-29 Loic Dachary * debian/changelog: version bump to 1.3.6 * ChangeLog, Makefile.am: version bump to 1.3.6 * NEWS, conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-001.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml, configure.ac, pokerengine/__init__.py: version bump to 1.3.6 2010-03-25 Johan Euphrosine * configure.ac, poker-engine.pc.in: add pkgdatadir, pkglibdir support in poker-engine.pc.in 2010-03-05 Loic Dachary * Release 1.3.5 * ChangeLog, Makefile.am, configure.ac, debian/copyright, examples/simple.py, pokerconfigupgrade.8.in, pokerconfigupgrade.in, pokerengine/Makefile.am, pokerengine/pokercards.py, pokerengine/pokerchips.py, pokerengine/pokerengineconfig.py, pokerengine/pokergame.py, pokerengine/pokerprizes.py, pokerengine/pokerrake.py, pokerengine/pokertournament.py, pokerengine/version.py, tests/Makefile.am, tests/allin.py.in, tests/blinds.py.in, tests/bugs.py.in, tests/buyin.py.in, tests/chips.py.in, tests/deal.py.in, tests/eval.py.in, tests/history.py.in, tests/libxml2leak.py.in, tests/muck.py.in, tests/positions.py.in, tests/run.in, tests/sit.py.in, tests/test-game.py.in, tests/test-gamehistory.py.in, tests/test-i18n.py.in, tests/test-pokercards.py.in, tests/test-pokerchips.py.in, tests/test-pokerengineconfig.py.in, tests/test-pokerplayer.py.in, tests/test-pokerprizes.py.in, tests/test-pokerrake.py.in, tests/test-pokertournament.py.in, tests/test-version.py.in, tests/testmessages.py, tests/tournament.py.in, tests/upgrades.py.in: update copyrights for 2010 * pokerengine/pokertournament.py, tests/test-pokertournament.py.in: Bug: tourney block in BREAK_WAIT when one of the table has only one player #15488 Fix: assume tables with a single player are ready for a tourney break. * debian/changelog: FTBFS fix 564371 * NEWS, conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-001.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml: bump version 1.3.5 * pokerengine/__init__.py: bump 1.3.5 2010-02-17 Chandan Kudige * po/de.po: Bring in German translations provided by Pokermania on 2009-02-17 into de.po 2009-07-13 Loic Dachary * Release 1.3.4 * pokerengine/pokertournament.py: updateBreak may get a 0 game_id in argument. This turns an implicit tricky case into an explicit exception. It will help remembering it. 2009-07-08 Loic Dachary * pokerengine/pokertournament.py, tests/test-pokertournament.py.in: 1) a tournament enters BREAK_WAIT 2) all tables but table T1 finished their hand 3) the table T1 finishes its hand AND is destroyed as a side effect of a call to balanceGames, because the T1 players are dispatched to the other tables. This is a special case where updateBreak will be called from endTurn with a game_id for a table that is gone. updateBreak must gracefully ignore the fact it is gone and proceed to BREAK state. 2009-07-06 Johan Euphrosine * tests/test-game.py.in: add testBestHandsHoldemFlopStreet 2009-06-08 Loic Dachary * pokerengine/pokertournament.py: is isEndOrNull instead of isRunning when balancing tables because players cannot be moved when in MUCK state. https://gna.org/bugs/index.php?13648 2009-05-30 Loic Dachary * pokerengine/pokertournament.py (PokerTournament.balanceGames), tests/test-pokertournament.py.in (PokerTournamentTestCase.testBalanceGamesRunning): the callback must not be invoked when the tournament is still in state REGISTERING (i.e. the tournament tables are about to be populated) https://gna.org/bugs/?13590 2009-04-10 Loic Dachary * Release 1.3.3 * debian/control, debian/control.unstable: add python-central to source list * debian/changelog: Closes: #517557 * pokerconfigupgrade.in: do not remove files when upgrading * tests/test-game.py.in: typo * ChangeLog: move release tag up 2009-02-05 Bradley M. Kuhn * pokerengine/pokertournament.py (PokerTournament.createGames): Moved callback_game_filled() to be called in a secondary loop after balanceGames() is called. (PokerTournament.__init__): Added clarifying comment on what calback_game_filled() means. (PokerTournament.createGames): call game.close() only after the game_filled() callback. 2009-01-31 Bradley M. Kuhn * tests/test-pokertournament.py.in (PokerTournamentTestCase.testBalanceGames) (PokerTournamentTestCase.testBreakGames) (PokerTournamentTestCase.testEqualizeCandidates) (PokerTournamentTestCase.testEqualizeGames) (PokerTournamentTestCase.testMovePlayer): Reworked tests based on fact that balanceGames() is called by default by createGames(). 2008-12-29 Bradley M. Kuhn * pokerengine/pokertournament.py (PokerTournament.createGames): Call self.balanceGames() at the end of game creation at start of the tourney. * tests/tournament.py.in (TestCreate.test4_tourneyTableStartBalanced): Wrote test. (TestCreate.tourneyTableStartBalancedHelper): Created helper function. 2008-12-27 Loic Dachary * ChangeLog, NEWS, conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-001.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml, debian/changelog, pokerengine/__init__.py: bump to version 1.3.3 2008-12-25 Loic Dachary * Release 1.3.2 * tests/libxml2leak.py.in: It is almost impossible to be precise when watching the vsize of a process. This test suite is not about making sure the process never grows. It is designed to spot cases where the process grows most of the time, i.e. has a significant leak. * tests/libxml2leak.py.in: Keep track of the greater size found so that decreasing memory does not create false positive (i.e. 1000 996 1000 996 1000 996...) * configure.ac, pokerengine/pokerengineconfig.py, tests/Makefile.am, tests/libxml2leak.py.in: libxml2 leaks objects unless a deallocation function is explicitly called. tests are added to check the libxml2 deallocation functions are called where neeeded. 2008-12-22 Loic Dachary * ChangeLog, NEWS, conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-001.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml, debian/changelog, pokerengine/__init__.py: bump version 1.3.2 * conf/poker.level-no-limit.xml: remove misleading definition 2008-12-09 Loic Dachary * Release 1.3.1 * tests/tournament.py.in: calculation of the prize pool must be done on regular tournaments * tests/testmessages.py: remove factory related tests. * tests/test-pokertournament.py.in: rewrite all prizes related tests to exercise the pokertournament logic related to them and leave the tests related to the calculation of the prizes to test-pokerprizes * tests/test-pokerprizes.py.in: remove factory related tests. * pokerengine/pokertournament.py: loadPayouts creates prizes_object with a player_count depending on tie sit_n_go / regular state of the tournament and adds the guarantee_amount = prize_min argument to the constructor. When a tournament goes from TOURNAMENT_STATE_REGISTERING to TOURNAMENT_STATE_CANCELED, set can_register to false. In register and unregister, update the player count and clear the rank2prize cache if a sit_n_go tournament. In prizes, do not return None if not in registering mode. Use pokerprizes.__dict__['xx'] instead of obsoleted factory. * pokerengine/pokerprizes.py: Add config_file_name argument to loadPayouts. Remove PokerPrizesFactory which is replaced by pokerprizes.__dict__['XXX']. Rename functions arguments as foo_bar instead of fooBar. * tests/testmessages.py: remove twisted dependency 2008-12-08 Loic Dachary * tests/Makefile.am, tests/test-pokerprizes.py.in, tests/test-pokertournament.py.in: testmessages is the first script in tests and requires __init__.py to be visible * po/fr.po, po/stamp-po: restore stamp-po wrongly deleted * conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-001.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.level-no-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml: version bump of configuration files to 1.3.1 2008-12-07 Bradley M. Kuhn * pokerengine/Makefile.am (pokerengine_PYTHON): Added pokerprizes.py * tests/tournament.py.in (TestPrizes.test1): Adapted test. * tests/Makefile.am (EXTRA_DIST): added testmessages.py * tests/test-pokertournament.py.in (PokerTournamentTestCase.testPrizes): Adjusted test. (PokerTournamentTestCase.testPrizesAlgorithm): Adjusted test. (PokerTournamentTestCase.testPrizesTable): Adjusted test. * tests/test-pokerprizes.py.in (PokerPrizesTestCase.test01_algorithmPrizeInterface): Added test to cover removePlayer(). (PokerPrizesTestCase.test02_tablePrizeInterface): Added test to cover removePlayer(). * pokerengine/pokerprizes.py (PokerPrizes.removePlayer): Wrote method. * pokerengine/pokertournament.py (PokerTournament.prizes): Adapted to use self.perize_object.prizes() (PokerTournament.register): Added called to prizes_object.addPlayer() (PokerTournament.unregister): Added called to prizes_object.removePlayer() * pokerengine/pokerprizes.py (PokerPrizes.__init__): Added dummy configDirs argument to simplify code in pokertournament.loadPayouts() * pokerengine/pokertournament.py (PokerTournament.prizesAlgorithm, PokerTournament.prizesTable): Removed methods. (PokerTournament.loadPayouts): Switched to use PokerPrizesFactory() * tests/test-pokerprizes.py.in (PokerPrizesTestCase.tearDown): Added method. (PokerPrizesTestCase.setUp): Added method. (PokerPrizesTestCase.test00_factory): Wrote test. * configure.ac (AC_CONFIG_FILES): Added tests/test-pokerprizes.py. 2008-12-06 Bradley M. Kuhn * pokerengine/pokerprizes.py (PokerPrizesFactory): Created class. (PokerPrizes): Created class. (PokerPrizesAlgorithm): Created class, using pokertournament.prizesAlgorithm() as getPrizes() (PokerPrizesTable): Created class, using pokertournament.prizesTable() as getPrizes() * tests/test-pokerprizes.py.in (PokerPrizesTestCase): Created class. (PokerPrizesTestCase.test01_algorithmPrizeInterface): Adapted from PokerTournamentTestCase.testPrizesAlgorithm (PokerPrizesTestCase.test02_tablePrizeInterface): Adapted from PokerTournamentTestCase.testPrizesTable 2008-11-04 Loic Dachary * Release 1.3.0 * debian/control.jaunty: preliminary jaunty support * debian/control.intrepid: intrepid support 2008-10-29 Johan Euphrosine * po/fr.po, po/poker-engine.pot: make update-po in poker-engine * config: add config directory in poker-engine * po/fr.po: update poker-engine french translation 2008-08-26 Bradley M. Kuhn * tests/test-i18n.py.in (PokerI18NTest.testTranslationFails): Added test to make sure old _() is returned. (PokerI18NTest.testUserWrittenTranslationFunction): Added test to make sure old _() is returned. * pokerengine/pokergame.py (init_i18n): Now return the function that was previously the value of _(), so that users of the function can restore it. * tests/blinds.py.in (TestBlinds.test12_fourPlayers_fourSitsOutForALongTime): Decreased number of loop iterations per dachary. (TestBlinds.test11_sixPlayers_fiveSitsOutForALongTime): Decreased number of loop iterations per dachary. (TestBlinds.helperForTest13and14): Decreased number of loop iterations per dachary. * tests/test-i18n.py.in (PokerI18NTest.testUserWrittenTranslationFunction): Wrote test. * pokerengine/pokergame.py (init_i18n): Added user override option for translation function. 2008-08-24 Bradley M. Kuhn * AUTHORS: Added myself to file. * tests/blinds.py.in (TestBlinds.test4_fourPlayers_player4missedBothBlinds_onlyBigRequired): Added test for getMissedRoundCount() (TestBlinds.test5_sixPlayers_missedBothBlinds_bothRequired): Added test for getMissedRoundCount() (TestBlinds.test6_fivePlayers_multiDecline_noHandStarts): Added test for getMissedRoundCount() (TestBlinds.test9_fivePlayers_missedBothBlinds_onlyBigRequired): Added test for getMissedRoundCount() (run): Restored verbosity line accidently deleted previously. (TestBlinds.test12_fourPlayers_fourSitsOutForALongTime): Added test for getMissedRoundCount() (TestBlinds.helperForTest13and14): Added test for getMissedRoundCount() (TestBlinds.test13_sevenPlayers_fiveSitsOutForALongTimeAfterInitialPayment_duringBlinds): Added test for getMissedRoundCount() (TestBlinds.test14_sevenPlayers_fiveSitsOutForALongTimeAfterInitialPayment_beforeBlinds): Added test for getMissedRoundCount() * pokerengine/pokergame.py (PokerPlayer.getMissedRoundCount): Wrote method. 2008-08-23 Bradley M. Kuhn * tests/blinds.py.in (TestBlinds.test11_sixPlayers_fiveSitsOutForALongTime): Added rebuy in each iteration of loop. (PokerPredefinedDecks): brought over deck class from history.py.in (TestBlinds.setUp): Added use of predefined decks. (TestBlinds.test12_fourPlayers_fourSitsOutForALongTime): Wrote test. (TestBlinds.test13_sevenPlayers_fiveSitsOutForALongTimeAfterInitialPayment_duringBlinds): Renamed test. (TestBlinds.test14_sevenPlayers_fiveSitsOutForALongTimeAfterInitialPayment_beforeBlinds): Wrote test. (TestBlinds.helperForTest13and14): Made helper function. 2008-08-22 Bradley M. Kuhn * tests/blinds.py.in (TestBlinds.test11_sixPlayers_fiveSitsOutForALongTime): Wrote test. * pokerengine/pokergame.py (PokerGame.updateBlinds.updateMissed): Reworked logic. 2008-08-17 Bradley M. Kuhn * tests/blinds.py.in (TestBlinds.test4_fourPlayers_missedBoth_onlyBigRequired): Renamed test. (TestBlinds.test9_fivePlayers_missedBothBlinds_onlyBigRequired): Wrote test. (TestBlinds.test10_sixPlayers_missedBothBlinds_bothRequired): Wrote test (TestBlinds.test7_specialTwoWaitForPost): Adapted and renamed. (TestBlinds.test1): Adapted test for missed blind count. (TestBlinds.test2): Adapted test for missed blind count. (TestBlinds.test3): Adapted test for missed blind count. * tests/testmessages.py: Added file, copied from poker-network. * pokerengine/pokergame.py (PokerPlayer.resetMissedBlinds): Wrote method. (PokerGame.updateBlinds): changed player.missed_blinds = None to resetMissedBlinds() call. (PokerGame.initBlindAnte): changed player.missed_blinds = None to resetMissedBlinds() call. (PokerGame.payBlind): changed player.missed_blinds = None to resetMissedBlinds() call. (PokerGame.updateBlinds.updateMissed): Added increment of count. 2008-07-13 Loic Dachary * pokerengine/pokergame.py, tests/test-game.py.in: setMuckableSerials converts its argument into a list and copies it to prevent undesirable side effects if the caller later modifies the list 2008-05-19 Loic Dachary * tests/coverage.py: upgrade from http://nedbatchelder.com/code/modules/coverage.html 2008-05-09 Loic Dachary * AUTHORS: update names and dates 2008-04-28 Loic Dachary * Release 1.2.0 * pokerengine/pokergame.py: V full over W use plural * pokerconfigupgrade.8.in: nroff comments are \" not ''' * debian/copyright: Make lintian happy about the copyright notice. * tests/test-game.py.in: Fix message strings for Full House. * pokerengine/pokergame.py: Vs full of Ws is better than Full Vs over Ws. 2008-04-20 Loic Dachary * debian/control, debian/control.unstable: standard is now 3.7.3 * debian/control: s/python/Python/ * COPYING, ChangeLog, Makefile.am, NEWS, conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-001.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.level-no-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml, configure.ac, debian/changelog, examples/simple.py, pokerconfigupgrade.8.in, pokerconfigupgrade.in, pokerengine/Makefile.am, pokerengine/__init__.py, pokerengine/pokercards.py, pokerengine/pokerchips.py, pokerengine/pokerengineconfig.py, pokerengine/pokerrake.py, pokerengine/pokertournament.py, pokerengine/version.py, tests/Makefile.am, tests/allin.py.in, tests/blinds.py.in, tests/bugs.py.in, tests/buyin.py.in, tests/chips.py.in, tests/deal.py.in, tests/eval.py.in, tests/history.py.in, tests/muck.py.in, tests/positions.py.in, tests/run.in, tests/sit.py.in, tests/test-gamehistory.py.in, tests/test-i18n.py.in, tests/test-pokercards.py.in, tests/test-pokerchips.py.in, tests/test-pokerengineconfig.py.in, tests/test-pokerplayer.py.in, tests/test-pokerrake.py.in, tests/test-pokertournament.py.in, tests/test-version.py.in, tests/tournament.py.in, tests/upgrades.py.in: GPLv2+ to GPLv3+ * pokerengine/pokergame.py, tests/test-game.py.in: implement method minMoney to get the minimum amount of money a user must have to be dealt a hand at the table. 2007-05-16 Loic Dachary * Release 1.1.0 * Support for more distributions. 2007-04-26 Loic Dachary * Release 1.0.25 * pokerengine/pokertournament.py: implement updateBreaks and new states WAIT_BREAK and BREAK. * pokerengine/pokertournament.py: provides old and new states as argument when the changestate callback in invoked * tests/test-pokertournament.py.in: test case for updateBreaks 2007-04-25 Loic Dachary * pokerengine/pokertournament.py: Store tournament break information. 2007-04-20 Loic Dachary * pokerengine/pokertournament.py: Wrap time() calls in seconds() module function for substitution in tests. 2007-03-12 Loic Dachary * Release 1.0.24 * pokerengine/pokergame.py: # # Rationale of player.sit_out_next_turn == False # This condition happens when the player sitout + sit # while not having the position during the blind/ante round it. # In this particular case, instead of instructing her to wait # for the first round, she sits back. This is important because # she was included in the player list at the begining of the turn. # If she is marked wait_for = "first_round", she will be removed # from the player list at the end of the blind/ante round, which # is exactly the opposite of what we want. # 2007-03-06 Loic Dachary * pokerengine/pokergame.py: s/raise/raises/ and update corresponding translations. 2007-02-16 Loic Dachary * pokerengine/pokergame.py: function isEndOrNull : not in a turn END or NULL state. function isInTurn : same as isRunning but includes MUCK state. sitOutNextTurn does not sit_out_next turn if in muck state regardless of the player status. remove useless test self.isRunning() and self.state != GAME_STATE_MUCK. change beginturn warning to include MUCK state. * poker-engine/tests/test-game.py.in: muck state sitout test requires player_list set 2007-02-01 Loic Dachary * Release 1.0.23 * pokerengine/pokergame.py: bugous fold or check must not try to get serial in position as player_list may not exist https://gna.org/bugs/?7809 (bug report of 2007/01/11). * pokerengine/pokergame.py: historyAddNoDuplicate so that position events are not repeated https://gna.org/bugs/?7809 (bug report of 2007/01/03 16:54) http://www.pok3d.com/rt/Ticket/Display.html?id=2106 2007-01-31 Loic Dachary * tests/blinds.py.in, pokerengine/pokergame.py: ignore players entering during the blind round https://gna.org/bugs/?7809 2007-01-26 Loic Dachary * conf/poker.levels-blinds.xml: add more levels 2007-01-26 Loic Dachary * conf/poker.levels-blinds.xml: level 3 big blind was 10 2007-01-25 griim * pokerengine/pokergame.py: i18n support 2007-01-23 Loic Dachary * debian/control.edgy: add python-all & python-central * debian/changelog: add python-all * configure.ac: copyright update * conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-001.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.level-no-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml: version bump * debian/control.edgy: edgy must use pycentral 2007-01-23 Loic Dachary * pokerengine/pokergame.py: fix https://gna.org/support/?1450 Sit out while in muck state must be denied by the server. getPotAmount may return what's in the stack if in muck state. roundCap returns zero if in muck state. * tests/test-game.py.in: test sit out while in muck state * tests/test-game.py.in: testGetPotAmount test the case where the game is not running * pokerengine/__init__.py, debian/changelog, NEWS, ChangeLog: version bump 2007-01-18 Loic Dachary * Release 1.0.22 * tests/history.py.in: Rake is no longer displayed in cents * tests/test-gamehistory.py.in: test history2Resolve safeguard against non existent hands add coverage report to standalone tests emacs invocation * tests/test-game.py.in: testUpdateHistoryEnd * pokerengine/pokergame.py: rake is no longer displayed in cents if a player at showdown does not have cards (happens in client side), history2Resolve silently ignores it refuses to sitOut a player while paying the blinds patch the "end" entry of the history when in client mode (not directing) because the information is not available when the end history event is inserted 2007-01-16 Cedric Pinson * Update gentoo package 2007-01-16 Loic Dachary * tests/test-gamehistory.py.in: specific tests for historyReduce of blind/blind_request entries * tests/test-game.py.in: fix test blinds according to new policy : don't sit out when out of position while the blind/ante phase 2007-01-15 Loic Dachary * pokerengine/pokergame.py: return false status on error for sitout http://www.pok3d.com/rt/Ticket/Display.html?id=1860 and https://gna.org/bugs/?7811 * tests/test-game.py.in: in client, the end of the blindante turn may occur only if the betsEqual predicate returns true otherwise it will be out of sync with the server, therefore the other player must also be allin * pokerengine/pokergame.py: add tolerance to "levels" tag as well as "level" in client, the end of the blindante turn may occur only if the betsEqual predicate returns true otherwise it will be out of sync with the server * conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.level-no-limit.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml: version bump * conf/poker.levels-blinds.xml: implement blind structure as shown at https://gna.org/task/index.php?4231 * conf/poker.level-001.xml: no limit tournament with predefined levels and 10 minutes intervals * Makefile.am: copyright updates 2007-01-10 Loic Dachary * pokerengine/__init__.py, debian/changelog, ChangeLog, NEWS: 1.0.22 version bump 2007-01-08 Loic Dachary * Release 1.0.21 * pokerengine/pokergame.py: use pformat instead of pprint so that messages are formated with the proper prefix 2007-01-07 Loic Dachary * pokerengine/pokergame.py: no missed blinds on tournament tables 2007-01-05 Loic Dachary * debian/python-poker-engine.preinst: don't upgrade version 21 configuration files, just replace them 2007-01-02 Loic Dachary * tests/test-game.py.in: test positions (first & last) when blinds are allin * tests/blinds.py.in: rename test for consistency * pokerengine/pokergame.py: first to talk in round is first in game after big blind last to talk is the player in game just before the player in position * conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.level-no-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml: version bump 2006-12-26 Loic Dachary * pokerengine/pokertournament.py: shuffle players before filling the tables * tests/test-pokertournament.py.in: don't shuffle players 2006-12-14 Loic Dachary * tests/tournament.py.in, tests/test-pokertournament.py.in: rake & buy_in are stored in tournament object * pokerengine/pokertournament.py: rake & buy_in are stored * pokerengine/pokergame.py: indirection for shuffler so that it's easier to replace it 2006-12-13 Loic Dachary * pokerengine/pokertournament.py: update finished_time * tests/tournament.py.in: typo * tests/tournament.py.in: rank prize is cached by buy_in * tests/test-pokertournament.py.in: test tournament canceling and regular tournament launch * pokerengine/pokertournament.py: implement tournament canceling if the number of registered players is below the minimum (2 by default) callback_cancel is run *before* the player list is re-initialized 2006-12-12 Loic Dachary * pokerengine/pokertournament.py, tests/test-pokertournament.py.in: cache per buy_in * pokerengine/pokertournament.py: prize_min sets the minimum prize pool, regardless of the number of players and their buy_in * tests/tournament.py.in, tests/test-pokertournament.py.in: cope with cached prize pool * pokerengine/pokertournament.py: cache prize pool 2006-12-11 Loic Dachary * tests/test-pokertournament.py.in: accomodate changes in tournament.py * pokerengine/pokertournament.py: add the players_min attribute (minimum number of players in a regular tournament) canRun: if registered is above players_min, start regular tournament canRegister: can't register if registered is above quota REGISTERING -> RUNNING is the updateRunning function for use by application 2006-12-04 Loic Dachary * conf/poker.level-15-30-no-limit.xml: small is 1500 2006-12-02 Loic Dachary * debian/changelog, pokerengine/__init__.py, NEWS, ChangeLog: version bump 2006-11-18 Loic Dachary * Release 1.0.20 * tests/test-game.py.in, pokerengine/pokergame.py: Three players pre-flop. Two allin because autopaying the blinds. The third must be given a chance to talk. * conf/poker..01-.02-no-limit.xml, conf/poker..01-.02-pot-limit.xml, conf/poker..02-.04-limit.xml, conf/poker..02-.04-no-limit.xml, conf/poker..02-.04-pot-limit.xml, conf/poker..02..04-limit.xml, conf/poker..05-.10-limit.xml, conf/poker..05-.10-no-limit.xml, conf/poker..05-.10-pot-limit.xml, conf/poker..05..10-limit.xml, conf/poker..10-.25-limit.xml, conf/poker..10-.25-no-limit.xml, conf/poker..10-.25-pot-limit.xml, conf/poker..25-.50-limit.xml, conf/poker..25-.50-no-limit.xml, conf/poker..25-.50-pot-limit.xml, conf/poker..25..50-limit.xml, conf/poker..50-1-limit.xml, conf/poker..50-1-no-limit.xml, conf/poker..50-1-pot-limit.xml, conf/poker..50.1-limit.xml, conf/poker.0-0-limit.xml, conf/poker.1-2-limit.xml, conf/poker.1-2-no-limit.xml, conf/poker.1-2-pot-limit.xml, conf/poker.10-15-limit.xml, conf/poker.10-15-pot-limit.xml, conf/poker.10-20-limit.xml, conf/poker.10-20-no-limit.xml, conf/poker.10-20-pot-limit.xml, conf/poker.100-200-limit.xml, conf/poker.100-200-no-limit.xml, conf/poker.100-200-pot-limit.xml, conf/poker.15-30-limit.xml, conf/poker.150-300-limit.xml, conf/poker.2-4-limit.xml, conf/poker.2-4-no-limit.xml, conf/poker.2-4-pot-limit.xml, conf/poker.200-400-limit.xml, conf/poker.3-6-limit.xml, conf/poker.3-6-no-limit.xml, conf/poker.3-6-pot-limit.xml, conf/poker.30-60-limit.xml, conf/poker.30-60-no-limit.xml, conf/poker.30-60-pot-limit.xml, conf/poker.4-8-limit.xml, conf/poker.5-10-limit.xml, conf/poker.5-10-no-limit.xml, conf/poker.5-10-pot-limit.xml, conf/poker.50-100-limit.xml, conf/poker.50-100-no-limit.xml, conf/poker.50-100-pot-limit.xml, conf/poker.7stud.xml, conf/poker.ante-.04-.08-limit.xml, conf/poker.ante-.10-.20-limit.xml, conf/poker.ante-.25-.50-limit.xml, conf/poker.ante-.50-1-limit.xml, conf/poker.ante-1-2-limit.xml, conf/poker.ante-10-20-limit.xml, conf/poker.ante-2-4-limit.xml, conf/poker.ante-3-6-limit.xml, conf/poker.ante-30-60-limit.xml, conf/poker.ante-5-10-limit.xml, conf/poker.holdem.xml, conf/poker.level-10-15-pot-limit.xml, conf/poker.level-10-20-no-limit.xml, conf/poker.level-15-30-no-limit.xml, conf/poker.level-2-4-limit.xml, conf/poker.level-no-limit.xml, conf/poker.levels-blinds.xml, conf/poker.omaha.xml, conf/poker.omaha8.xml, conf/poker.payouts.xml, conf/poker.razz.xml: version bump 2006-10-12 Loic Dachary * debian/control, debian/control.breezy, debian/control.dapper, debian/control.edgy, debian/control.etch, debian/control.hoary, debian/control.sarge, debian/control.unstable: clean depends 2006-09-22 Cedric Pinson * gentoo/dev-games/poker-engine/poker-engine-1.0.16-r1.ebuild: * gentoo/dev-games/poker-engine/poker-engine-1.0.20-r1.ebuild: update gentoo package 2006-09-18 Loic Dachary * ChangeLog, NEWS, debian/changelog, pokerengine/__init__.py: version bump 2006-09-18 cpinson * gentoo/dev-games/poker-engine/poker-engine-1.0.14-r1.ebuild: remove old package 2006-09-13 Loic Dachary * Release 1.0.19 * tests/test-game.py.in, pokerengine/pokergame.py: use platform.system instead of os.name 2006-09-12 Loic Dachary * debian/changelog: edgy & etch control files * debian/control.etch, debian/control.edgy: edgy & etch * conf/poker.level-10-20-no-limit.xml: 10-20 blinds 2006-09-08 Loic Dachary * conf/poker.level-15-30-no-limit.xml: bb is 30 2006-09-07 Loic Dachary * conf/poker.level-15-30-no-limit.xml: no round cap in no-limit * conf/poker.level-15-30-no-limit.xml: 1500/3000 instead of bugous 1000/1500 * conf/poker.level-no-limit.xml: 10-15 for first level is meaningless 2006-09-07 Loic Dachary * conf/poker.razz.xml: razz * ChangeLog, NEWS, debian/changelog, pokerengine/__init__.py, pokerengine/pokergame.py: version bump 2006-09-04 Loic Dachary * Release 1.0.18 * pokerengine/pokergame.py: uncalled safeguard checks that the value is lower than the pot instead of strictly equal. 2006-08-31 Loic Dachary * debian/changelog, NEWS, ChangeLog, pokerengine/__init__.py: bump version 2006-08-30 Loic Dachary * Release 1.0.17 * tests/test-game.py.in: Adjust tests depending on rake being counted twice. * pokerengine/pokergame.py: subtract rake from pot when win because fold subtrace rake from serial2delta 2006-08-18 Loic Dachary * tests/test-game.py.in: pokercards.PokerCards instead of PokerCards 2006-08-18 Loic Dachary * Release 1.0.16 * pokerengine/pokergame.py: Special case : a player folds on the turn and the only other player left in the game did not bet. There is no reason for the player to fold : he forfeits a pot that he may win. Nevertheless, it can happen. In this case, and only if there is at least one player allin, the only other player left is awarded what looks like an uncalled bet. In this case the uncalled_serial is zero. 2006-08-17 Loic Dachary * tests/test-game.py.in: """ Test Poker Game : player folds (although he could check) while a player is allin and another player is behind him. The turn ends now, the last player is not asked for his action. * pokerengine/pokergame.py: If there is only one player left to talk, it is meaningless to ask for his action, unless he something to call. 2006-08-17 Cedric Pinson * ChangeLog, tests/Makefile.am, tests/bugs.py.in: put the uncalled bug in bugs.py.in and remove bugs.py from make check 2006-08-17 Loic Dachary * pokerengine/pokergame.py (PokerGame.__roundFinished): If there is only one player left to talk, it is meaningless to ask for his action, unless he something to call. 2006-08-16 Cedric Pinson * gentoo/dev-games/poker-engine/poker-engine-1.0.14-r1.ebuild, gentoo/dev-games/poker-engine/poker-engine-1.0.16-r1.ebuild: add ebuild for version 1.0.16 2006-08-14 loic * ChangeLog: *** empty log message *** * tests/test-game.py.in: In test bet to pot, remove useless / impossible tests of bets handled as dead blinds. """ Test Poker Game : Allin with dead blind and lost to the winner although the winner has less money """ """ Test Poker Game : dead blind + a player has uncalled bet and is not the winner. """ * tests/bugs.py.in: Bugs integrated to test-game.py.in * pokerengine/pokergame.py: Dead blinds are not counted as a player contribution to the pot. As a consequence, the dead blinds are awarded to the winner(s) of the first / main pot. money2bet and bet2pot take an additional argument (dead_money) that clarifies the handling of the dead blinds. 2006-08-14 izidor79 * pokerengine/pokergame.py: changed max bet to sys.maxin instead of 10000000 2006-08-14 Loic Dachary * tests/test-game.py.in: In test bet to pot, remove useless / impossible tests of bets handled as dead blinds. """ Test Poker Game : Allin with dead blind and lost to the winner although the winner has less money """ """ Test Poker Game : dead blind + a player has uncalled bet and is not the winner. """ * tests/bugs.py.in: Bugs integrated to test-game.py.in * pokerengine/pokergame.py: Dead blinds are not counted as a player contribution to the pot. As a consequence, the dead blinds are awarded to the winner(s) of the first / main pot. money2bet and bet2pot take an additional argument (dead_money) that clarifies the handling of the dead blinds. 2006-08-14 izidor79 * pokerengine/pokergame.py: changed max bet to sys.maxin instead of 10000000 2006-08-08 proppy * pokerengine/pokergame.py: test fix uncalled bug 2006-08-03 proppy * pokerengine/pokergame.py: reverted * pokerengine/pokergame.py: added winner.dead to self.uncalled to compare against side_pot[winner] 2006-08-02 proppy * tests/bugs.py.in: removed log * tests/bugs.py.in: better values * tests/bugs.py.in: simpler test * tests/bugs.py.in: TestBug -> TestBugUncalled * configure.ac, tests/Makefile.am: added bugs.py * tests/bugs.py.in: added bugs.py for bug entry 2006-07-25 Loic Dachary * pokerengine/pokergame.py: Distribute all the rake. 2006-07-24 Loic Dachary * debian/rules: call autotools with proper version 2006-07-23 Loic Dachary * debian/control.breezy, debian/control.hoary: fix xslt depends for hoary / breezy 2006-07-21 Loic Dachary * debian/rules: dy_python is mandatory * debian/python-poker-engine.postinst: pycentral work must be done before pokerconfigupgrade can be called * debian/control: Add XB-Python-Version although supposed to be for binary only (says http://wiki.debian.org/DebianPython/NewPolicy) * debian/control: explicit list * debian/control: poker-engine-common once existed * configure.ac: define pkgsysconfdir * poker-engine.pc.in: pkgsysconfdir * tests/tournament.py.in: use predefined decks to speed up tournament resolution and avoid random behaviour * ChangeLog: *** empty log message *** * tests/allin.py.in, tests/blinds.py.in, tests/buyin.py.in, tests/chips.py.in, tests/deal.py.in, tests/eval.py.in, tests/history.py.in, tests/run.in, tests/sit.py.in, tests/test-game.py.in, tests/test-gamehistory.py.in, tests/test-pokercards.py.in, tests/test-pokerchips.py.in, tests/test-pokerengineconfig.py.in, tests/test-pokerplayer.py.in, tests/test-pokerrake.py.in, tests/test-pokertournament.py.in, tests/test-version.py.in, tests/tournament.py.in, tests/upgrades.py.in: exit status reflect tests results * tests/positions.py.in: use pre-defined decks to avoid random results in some specific cases * debian/rules: specific name * tests/allin.py.in, tests/blinds.py.in, tests/buyin.py.in, tests/chips.py.in, tests/deal.py.in, tests/eval.py.in, tests/history.py.in, tests/muck.py.in, tests/positions.py.in, tests/run.in, tests/sit.py.in, tests/test-game.py.in, tests/test-gamehistory.py.in, tests/test-pokercards.py.in, tests/test-pokerchips.py.in, tests/test-pokerengineconfig.py.in, tests/test-pokerplayer.py.in, tests/test-pokerrake.py.in, tests/test-pokertournament.py.in, tests/test-version.py.in, tests/tournament.py.in, tests/upgrades.py.in: use non common name for verbose * tests/test-pokerrake.py.in: get from srcdir * tests/Makefile.am: pokerrake.py * pokerengine/pokerengineconfig.py: stringify * debian/control.unstable, debian/rules, debian/control, debian/control.breezy, debian/control.dapper, debian/control.hoary, debian/control.sarge: fix python depends * tests/run.in: test verbosity * Makefile.am: uninstall conf files * ChangeLog: *** empty log message *** * Makefile.am: specific python m4 files are no longer needed * debian/rules: create config dir if needed (because there is no longer custom files in this directory it may be omited by checkout) * ChangeLog, NEWS, debian/python-poker-engine.install, debian/rules.mk: rake implementation * tests/allin.py.in, tests/blinds.py.in, tests/buyin.py.in, tests/chips.py.in, tests/deal.py.in, tests/eval.py.in, tests/history.py.in, tests/muck.py.in, tests/positions.py.in, tests/sit.py.in, tests/test-data/pokerrake.py, tests/test-game.py.in, tests/test-gamehistory.py.in, tests/test-pokercards.py.in, tests/test-pokerchips.py.in, tests/test-pokerengineconfig.py.in, tests/test-pokerplayer.py.in, tests/test-pokertournament.py.in, tests/test-version.py.in, tests/tournament.py.in, tests/upgrades.py.in: control verbosity and individual launching * tests/test-pokerrake.py.in: Poker rake engine. * tests/run.in: Control test verbosity. Only report 100% coverage if default verbosity (i.e. max verbosity) is set. * tests/Makefile.am: Add pokerrake.py, export top_srcdir for tests and kill tests leftovers * debian/rules: Rely on cdbs alone instead of complex rewrite depending on python versions. * pokerengine/version.py: Verbosity control. * pokerengine/pokertournament.py: Sort entries + add pokerrake.py * pokerengine/pokerrake.py: Rake engine. * pokerengine/pokergame.py: Copyright fixes. Set and update uncalled amount and serial field to avoid complex guessing. Implement rake. Allow for negative verbosity. Add last round field to side pots structure. * pokerengine/pokerengineconfig.py: Allow for negative verbosity. * pokerengine/pokerchips.py, pokerengine/pokercards.py: Copyright fixes. * pokerengine/Makefile.am: Sort entries + add pokerrake.py * examples/simple.py: Fix path to run from top level source dir. Buy in is in cent. * debian/python-poker-engine.postrm, debian/python-poker-engine.preinst, debian/python-poker-engine.postinst, debian/python-poker-engine.dirs: Remove python version tweaks. * debian/pycompat: pycentral * debian/control.unstable, debian/control.sarge, debian/control.hoary, debian/control.dapper, debian/control.breezy: Remove python version tweaks * debian/control, pokerconfigupgrade.in, poker-engine.pc.in: Remove python version tweaks. * configure.ac: Remove python version tweaks. Depend on pypoker-eval 132. * Makefile.am: Remove python version tweaks. 2006-06-22 Loic Dachary * Makefile.am, ChangeLog: no arch .pc * Makefile.am (pkgconfigdir): in /usr/share instead of /usr/lib because the package is no-arch Mon Jun 12 2006 Loic Dachary * pokerengine/pokergame.py (PokerGame.endState): set current_round to -2 Most of the time this is done by muckState. But when in heads up with one player having less money than the blind in a tournament, state transition goes directly from blindState to endState. Tue May 23 2006 Loic Dachary * tests/test-*.py.in: reach 100% coverage * pokerengine/pokertournament.py (PokerTournament.endTurn): factorize redundant code * pokerengine/poker{game,cards,chips}.py: #pragma no cover for a few lines that can't be tested Sun May 14 2006 Loic Dachary * Release 1.0.15 * tests/test-*.py.in: many more unit tests * pokerengine/pokercards.py (PokerCards.setVisible): don't alter NOCARD * pokerengine/pokercards.py (PokerCards.hasCard): fix to work with no cards also Fri May 12 2006 Loic Dachary * pokerengine/pokergame.py (PokerGame.playersInPotCount): last_round was always 'total' because this index was added after playersInPotCount implementation. Thu May 11 2006 Loic Dachary * pokerengine/pokergame.py (PokerGame.historyReduce): index for sitOut & wait_blind is incorrect Sat May 06 2006 Loic Dachary * test/test-*.py.in: more coverage tests (95%) Wed May 03 2006 Loic Dachary * pokerengine/pokergame.py (PokerGame.setSeats): player seat set to -1 if an error occurs (PokerGame.cancelState): use GAME_STATE_END macro (PokerGame.waitBigBlind): return if no blind data (PokerGame.blind): return if no blind data (PokerGame.ante): return if no blind data (PokerGame.ante): set amount if amount from info is undefined (PokerGame.disconnectedCount): wrong method name fixed * pokerengine/pokergame.py (__historyResolve2messages): kill the unused card2string method. Tue May 02 2006 Loic Dachary * conf/*.template: add bet/type Wed Apr 26 2006 Loic Dachary * pokerengine/pokerchips.py (PokerChips.convert): if converting from an int and there is a remainder, don't lose it * pokerengine/pokergame.py (PokerGame.money2bet): remove redundant test Mon Apr 24 2006 Loic Dachary * pokerengine/pokergame.py (PokerGame.readableHandValueLong): royal flush tests fix * pokerengine/pokergame.py (PokerGame.possibleActions): return [] instead of False * pokerengine/pokertournament.py (PokerTournament.__init__): init bug fixes * pokerengine/pokertournament.py (PokerTournament.createGames): ok if the tournament players don't divide into an exact number of tables * pokerengine/pokerchips.py (PokerChips.tolist): impossible case raises warning * give up python2.2 support Wed Apr 19 2006 Loic Dachary * Release 1.0.14 * pokerengine/pokerchips.py (PokerChips.__ne__): use isinstance * tests/run.in: tests run individually by make check instead of grouped into a single execution (exhibits errors) Mon Apr 17 2006 Loic Dachary * pokerengine/pokercards.py (letter2names): try & deuce (Christopher Stone ) Sat Apr 08 2006 Loic Dachary * tests/coverage.py: add coverage code from http://nedbatchelder.com/code/modules/coverage.html * tests/tests-*.py.in: 35% unit test coverage * tests/conf/unittest*.xml, upgrade/*.xsl: helpers for unit tests * tests/run.in: run all tests and measure coverage (including non-regression tests). Fri Apr 07 2006 Loic Dachary * pokerengine/pokergame.py (PokerGame.setDealer): don't modify position if an error occured. (PokerGame.noAutoPlayer): auto = False (instead of True !) * pokerengine/pokergame.py (PokerGame.addPlayer): add loads of sanity checks and error reports * pokerengine/pokergame.py (PokerGame.setPosition): don't modify position if an error occured. * pokerengine/pokergame.py (PokerGame.resetSeatsLeft): If the number of player is invalid the seats_left is reset. * pokerengine/pokergame.py (PokerGame.setMaxPlayers): The number max of player is now check and if it is invalid the error is traced and the number is set to 0. * pokerengine/pokergame.py (PokerPlayer.__str__): missing muck Wed Apr 05 2006 Loic Dachary * pokerengine/pokergame.py (PokerGame.setVariant): copy the info dict in backup instead of keeping a reference * pokerengine/pokergame.py (PokerGame.setVariant): use .path not .url Sat Apr 01 2006 Loic Dachary * pokerengine/pokerengineconfig.py (Config.save): don't print none self.path * pokerengine/pokerengineconfig.py (Config.checkVersion): test upgrades_repository * pokerengine/pokercards.py (PokerCards.__eq__): test argument type Thu Mar 30 2006 Loic Dachary * tests/test-version.py.in: unit test for pokerengine/version.py * tests/history.py.in (TestHistory.test1): fix history test Wed Mar 22 2006 Loic Dachary * Release 1.0.13 * Makefile.am (buildconf): fix bugous limit structure Sun Mar 12 2006 Loic Dachary * Release 1.0.12 * configure.ac: accept python2.2, abort if rsync missing * pokerconfigupgrade.in: use string.find for python2.2 compatibility * pokerengine/poker{chips,game,tournament}.py, tests/chips.py.in: define sum function for python2.2 * pokerengine/pokergame.py: define uniq function and otherwise avoid usage of fromkeys dictionary method * pokerengine/pokergame.py(serialsAllSorted): sort keys to avoid hash key algorithm dependency (may ruin non regression tests) * tests/deal.py.in: do not rely on assertEqual with single argument (does not work in python2.2) * tests/tournament.py.in: fix equalizeGames output results to take advantage of sorted results. Mon Feb 27 2006 proppy * pokerengine/pokergame.py (PokerGameClient): removed skin_level Fri Feb 10 2006 Loic Dachary * pokerengine/version.py (Version.__{sub,add}__): arithmetic on versions Wed Jan 20 2006 Benoit Treins * conf/*: removed showdown round from variants * pokerengine/tests/muck.py.in: created * pokerengine/pokergame.py: added muck logic Wed Jan 19 2006 Benoit Treins * pokerengine/pokergame.py: changed first test in call check fold raise functions (may raise error message) Tue Jan 03 2006 Loic Dachary * tests/upgrades.py.in: fix PYTHONPATH bug that gave precedence to the installed version instead of the version from the source tree Mon Jan 02 2006 Loic Dachary * pokerengine/pokergame.py (PokerGame.setBettingStructure): by default and if negative, round cap is set to maxint (PokerGame.betLimits): if minimum bet is "big" instead of a number, set the minimum bet to the big blind. Thu Nov 24 2005 Loic Dachary * Release 1.0.11 * pokerengine/pokertournament.py (PokerTournament.__init__): default is fixed payout tables * conf/poker.payouts.xml: fixed payout tables * tests/tournament.py.in (TestPrizes.test1): test fixed payout structure Wed Nov 23 2005 Loic Dachary * pokerengine/pokertournament.py (PokerTournament.endTurn): attempt to balance tables when a player is eliminated OR a table does not have enough players * pokerengine/pokertournament.py (PokerTournament.balanceGames): remember that a need to move players was not satisfied * pokerengine/pokertournament.py (equalizeCompute): separate function for computing games in need of equalization Tue Nov 22 2005 Loic Dachary * pokerengine/pokergame.py (PokerGame.setBettingStructure): set best_buy_in and default values for buy-in and max-buy-in Wed Oct 26 2005 Loic Dachary * pokerengine/pokergame.py (__historyResolve2messages, history2messages): convert cents amounts for display Tue Oct 18 2005 Loic Dachary * Release 1.0.10 * pokerengine/pokerchips.py: s/tokens/chips/ * pokerengine/pokerchips.py (PokerChips.int2chips): if the amount is a multiple of a given chip, stick to it Mon Oct 17 2005 Loic Dachary * pokerengine/pokertournament.py (PokerTournament.movePlayer): also transfert user data. * pokerengine/pokerchips.py (PokerChips.tostring): convert to string representing the decimal amount (PokerChips.tofloat): convert to the float representing the decimal amount instead of the cents amount * pokerengine/pokerchips.py: the remainder field contains the rest of the chip stack. If the chips values do not include a chip of value 1, the amount that is lower than the smallest chip is stored in the remainder field. * pokerengine/pokerchips.py (PokerChips.tolist): convert to standalone list * conf/poker.*.xml: all amounts expressed in cents or 1/100 * pokerengine/pokergame.py (PokerGame.__init__): self.unit : smallest chip value fitting with the betting structure pokerengine/pokergame.py (PokerGame.getChipUnit): * Makefile.am (all-local): run upgrades if conf directory is writeable (that is, not when doing a distcheck) * pokerengine/pokergame.py (PokerGame.moneyMap): convenience function replacing chipsMap * pokerengine/pokergame.py: amounts are no longer stored in chips but in cents Fri Oct 14 2005 Loic Dachary * pokerengine/pokergame.py (PokerPlayer.getUserData): user_data field defined for the caller to store per-player data Thu Oct 13 2005 Loic Dachary * pokerconfigupgrade.in: do not prepend path components that are already present in sys.path. Prevents giving priority to standard path over PYTHONPATH. Fri Sep 30 2005 Loic Dachary * Release 1.0.9 * pokerengine/pokergame.py (PokerGame.buildPlayerList): exclude players with wait_for = "first_round". This is only meaningful when set before starting the game and allows the caller to exclude players for the next game while allowing it to join the game after the next game. * pokerengine/pokergame.py (PokerGame.playersBeginTurn): do not reset wait_for if "first_round". It may be used to exclude players from the blind/ante round and will be reset to False when the blind/ante round is over. * pokerengine/pokergame.py (PokerGame.initRound): s/sitPlayersWait/acceptPlayersWait/ Thu Sep 29 2005 Loic Dachary * pokerengine/pokergame.py (PokerGame.updateBlinds): change wait_for "late" to False when forbiding missed blind. * tests/blinds.py.in (TestBlinds.test0): Two players came in and are waiting for the late blind because they attempted to enter either on the small blind or the dealer position. Fake this situation instead of playing hands that will lead to the same because it introduces an complexity that is not necessary. This case can happen indeed although very rarely. * pokerengine/pokergame.py (PokerPlayer.isMissedBlind): return false if "n/a" * poker-engine/conf/*no-limit*: minimum bet does not vary Sat Sep 24 2005 Loic Dachary * Release 1.0.8 * pokerconfigupgrade.in: add python installation directory in python path Wed Sep 21 2005 Loic Dachary * bootstrap: do not run autoheader * pokerclient2d/*.c: add getopt Fri Aug 26 2005 Loic Dachary * Release 1.0.7 * pokerengine/pokerengineconfig.py (Config.upgrade): ignore missing upgrade repository, as if it was empty, instead of crashing. Tue Aug 16 2005 Loic Dachary * Release 1.0.6 * debian/python2.3-poker-engine.postinst: run pokerconfigupgrade after installation. * pokerconfigupgrade.8.in: new * pokerconfigupgrade.in: command line utility to upgrade configuration files Mon Aug 15 2005 Loic Dachary * upgrades: repository of XSL sheets upgrading confgiruation files * tests/upgrades.py.in: apply all upgrades from the 1.0.5 files stored in tests/conf * tests/conf: 1.0.5 configuration files from which upgrades can be applied. * pokerengine/pokerengineconfig.py (Config.upgrade): XSL based upgrade system starting from version 1.0.5 and up. * pokerengine/version.py.in: version class for comparison and upgrade matrix helper * tests/*.py -> test/*.py.in: allow builds/tests in directory separated from tests. Wed Aug 03 2005 Loic Dachary * pokerengine/pokergame.py (PokerGame.is{Ante,Blind}Requested): predicate on the blind / ante status of a given player Wed Aug 03 2005 Loic Dachary * Release 1.0.5 * pokerengine/pokergame.py (PokerGame.getLatestPotContributions): helper function added. * pokerengine/pokergame.py (PokerGame.updatePots): compute total pot contributions. * pokerengine/pokergame.py (PokerGame.distributeMoney): compute total serial2share that replaces winner2share and serial2delta for each player (net win/loss). Sat Jul 16 2005 Loic Dachary * debian/control (Section): s/libs/python/ in sections. Wed Jul 13 2005 Loic Dachary * Release 1.0.4 * pokerengine/pokergame.py (PokerGame.sitOut): do not set the dealer seat if less than two players sit. * pokerengine/pokergame.py (PokerGame.sit): set first_turn to True if less than two players. Tue Jul 05 2005 Loic Dachary * Release 1.0.3 * tests/sit.py: sitin/sitout tests * pokerengine/pokergame.py (PokerGame.sitPlayersWaitingForFirstRound): if a player sits while others are paying the blinds, he must not be included in the player list. Tue Jun 28 2005 Loic Dachary * pokerengine/pokergame.py (PokerGame.isGameEndInformationValid): can the showdown of the previous game be displayed Fri Jun 24 2005 Loic Dachary * Release 1.0.2 * pokerengine/pokergame.py (PokerGame.callNraise): split self.bet call to avoid autoplayer infinite recursion Fri Jun 24 2005 Loic Dachary * pokerengine/pokergame.py (PokerGame.sitOutNextTurn): sit_request and for client usage, allow client to update sit_out_next_hand in advance. Wed Jun 15 2005 Loic Dachary * Release 1.0.1 Thu May 05 2005 Loic Dachary * pokerengine/pokertournament.py: tournament logic imported from former tournament client * tests/tournament.py: new tournament logic non regression tests * tests/blinds.py: new blind logic non regression tests Wed May 04 2005 Loic Dachary * pokerengine/pokergame.py (PokerGame.payBuyIn): do not set the buy in flag if the amount is less than the minimum. This check should also be done by the application and is added as a safeguard. * pokerengine/pokergame.py (PokerGame.sitOut): reset dealer sit if only one player in game. * pokerengine/pokergame.py (PokerGame.sit): refuse to sit if buy in is not yet payed. Tue May 03 2005 Loic Dachary * pokerengine/pokergame.py (PokerGame.isBroke): return False if the serial does not exist. The rationale being that a player not participating in the game cannot be broke. Allows for simpler tests from the application, avoiding a check to make sure the player is indeed seated at the table. Thu Apr 28 2005 Loic Dachary * Release 1.0.0 Local Variables: compile-command: "svn update ; svn2cl --group-by-day --authors=$(echo $HOME)/.svn2cl --stdout | head -2000 | sed -n '0,/^2009-04-01/p'" End: poker-engine-1.3.6/configure.ac0000644000175000017500000000727111354224223013320 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Process this file with autoconf to produce a configure script. AC_PREREQ(2.54) AC_INIT(poker-engine, [esyscmd(perl -n -e "print if(s/^version_number = \"(.*)\".*/\1/s)" pokerengine/__init__.py)]) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE() AC_CONFIG_SRCDIR([pokerengine/pokergame.py]) # Checks for programs. AC_PROG_MAKE_SET AC_PATH_PROG(RSYNC, [rsync]) if test -z "$RSYNC" ; then AC_MSG_ERROR(rsync is needed to install poker-engine) fi AM_MAINTAINER_MODE AM_PATH_PYTHON([2.3]) pkgsysconfdir=$sysconfdir/$PACKAGE AC_SUBST(pkgsysconfdir, [$pkgsysconfdir]) pkglibdir=$libexecdir/$PACKAGE AC_SUBST(pkglibdir, [$pkglibdir]) pkgdatadir=$datadir/$PACKAGE AC_SUBST(pkgdatadir, [$pkgdatadir]) AC_SUBST(POKER_ENGINE_PKGDATADIR, [`eval eval eval echo $pkgdatadir`]) AC_SUBST(POKER_ENGINE_PKGLIBDIR, [`eval eval eval echo $pkglibdir`]) AC_SUBST(POKER_ENGINE_PKGSYSCONFDIR, [`eval eval eval echo $pkgsysconfdir`]) PKG_CHECK_MODULES(PYPOKER_EVAL, pypoker-eval >= 132.0,, [AC_MSG_ERROR(pypoker-eval is a mandatory library)]) python_script=" import imp import sys path = list() modules = sys.argv.pop(1) for module in modules.split('.'): (file, pathname, info) = imp.find_module(module, sys.path + path) sys.stdout.write(pathname + ' ') path = list(( pathname, )) " for module in libxml2 libxslt pokereval ; do AC_MSG_CHECKING([wether python module $module is available]) if $PYTHON -c "$python_script" $module ; then AC_MSG_RESULT([... yes]) else AC_MSG_ERROR([failed]) fi done # i18n AM_PO_SUBDIRS # Generate files AC_CONFIG_FILES([tests/run pokerconfigupgrade], [chmod 555 $ac_file]) AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) AC_CONFIG_FILES([Makefile poker-engine.pc pokerconfigupgrade.8 pokerengine/Makefile tests/allin.py tests/blinds.py tests/buyin.py tests/bugs.py tests/chips.py tests/deal.py tests/eval.py tests/history.py tests/muck.py tests/positions.py tests/sit.py tests/tournament.py tests/upgrades.py tests/libxml2leak.py tests/test-gamehistory.py tests/test-pokercards.py tests/test-pokerengineconfig.py tests/test-pokertournament.py tests/test-pokerprizes.py tests/test-game.py tests/test-pokerchips.py tests/test-pokerrake.py tests/test-pokerplayer.py tests/test-version.py tests/test-i18n.py tests/Makefile], [chmod -w $ac_file]) AC_OUTPUT poker-engine-1.3.6/README0000644000175000017500000000040110604022723011674 00000000000000poker-engine is a python library that implements poker rules according to variants and betting structures specified in configuration files. It designed to be used by a multiplayer poker server, a poker AI or a poker client. Loic Dachary poker-engine-1.3.6/NEWS0000644000175000017500000000512411354224223011524 00000000000000Release 1.3.6 pkg-config defines pkgdata. Release 1.3.5 Bug fixes. Tourney block in BREAK_WAIT when one of the table has only one player https://gna.org/bugs/index.php?15488 Release 1.3.4 Fix bug that blocks a tournament in breakwait state. Fix bug that prevented balancing tables at the beginning of a tournament. Fix bug that invoked extra callbacks when balancing tables at the beginning of a tournament. Fix bug that balanced games while waiting for decisions to muck. Release 1.3.3 Bug fixes. Release 1.3.2 Bug fixes. Release 1.3.1 Translations in 7 languages. Release 1.3.0 Bug fixes. Release 1.2.0 minMoney method. Upgrade GPLv2 to GPLv3 Release 1.1.0 Bug fixes. Release 1.0.25 Implementation of tournament breaks. Bug fixes. Release 1.0.24 Bug fixes. Release 1.0.23 Bug fixes. Internationalization with french translation. Release 1.0.22 Bug fixes. New tournament structure. Release 1.0.21 Guaranteed prize pool tournaments. Tournaments cancelation if minimum number of players not reached. Tournament API change. Bug fixes. Release 1.0.20 Bug fixes. Release 1.0.19 Bug fixes. Release 1.0.18 Bug fixes. Release 1.0.17 Fix major rake bug. Release 1.0.16 Major repackaging using pycentral when possible. 100% test coverage. Release 1.0.15 More unit tests, major bug fixes. Release 1.0.14 Gentoo packaging Unit tests (35% code coverage) Release 1.0.13 Fix bug in limit games structures. Release 1.0.12 Added muck control to game logic. Bug fixes. Release 1.0.11 Fixed payout structure for tournaments. Reworked betting structure Fix multi-table balancing bug Chips are in cents Release 1.0.10 Per player application information field. Release 1.0.9 No limit bet structure fixes. Rare blind bug fix. The application can exclude a player from the next game. Release 1.0.8 Rework installation and packages. Release 1.0.7 Do not crash if upgrade directory does not exist. Release 1.0.6 Versioning and migration system for XML configuration files. Release 1.0.5 Showdown stacks summarizes total wins and losses explicitly (serial2share, serial2delta), the application does not need to recompute them. Fix bug occuring when a turn is cancelled because only one player payed the blind and other players sit at the table while the other player(s) declined to pay the blind. Release 1.0.4 Fix dealer button bug in head to head situations. Release 1.0.3 Fix bug when a player sit while others are paying the blinds. Release 1.0.1 Multi table tournaments support Major bug fixes Release 1.0.0 Initial release as a standalone project after extraction from poker3d poker-engine-1.3.6/po/0002755000175000017500000000000011540702124011521 500000000000000poker-engine-1.3.6/po/poker-engine.pot0000644000175000017500000001436411540702106014556 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR http://www.pokersource.info # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: pokerengine/pokergame.py:311 #, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "" #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "" #: pokerengine/pokergame.py:322 #, python-format msgid " wins %(side)s " msgstr "" #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "" #: pokerengine/pokergame.py:328 #, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "" #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "" #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "" #: pokerengine/pokergame.py:348 #, python-format msgid "%(serial)s waiting for " msgstr "" #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "" #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "" #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "" #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "" #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "" #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "" #: pokerengine/pokergame.py:396 #, python-format msgid " and %(dead)d dead" msgstr "" #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "" #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "" #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "" #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "" #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "" #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "" #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "" #: pokerengine/pokergame.py:431 #, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "" #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "" #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "" #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "" #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "" #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "" #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "" #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "" #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "" #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr "" #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "" #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "" #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "" #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "" #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "" #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "" #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "" #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "" #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "" #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "" #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "" #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "" #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "" #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "" #: po/raw.string:1 msgid "hi" msgstr "" #: po/raw.string:2 msgid "low" msgstr "" #: po/raw.string:4 msgid "Ace" msgstr "" #: po/raw.string:5 msgid "King" msgstr "" #: po/raw.string:6 msgid "Queen" msgstr "" #: po/raw.string:7 msgid "Jack" msgstr "" #: po/raw.string:8 msgid "Ten" msgstr "" #: po/raw.string:9 msgid "Nine" msgstr "" #: po/raw.string:10 msgid "Eight" msgstr "" #: po/raw.string:11 msgid "Seven" msgstr "" #: po/raw.string:12 msgid "Six" msgstr "" #: po/raw.string:13 msgid "Five" msgstr "" #: po/raw.string:14 msgid "Four" msgstr "" #: po/raw.string:15 msgid "Trey" msgstr "" #: po/raw.string:16 msgid "Deuce" msgstr "" #: po/raw.string:18 msgid "Aces" msgstr "" #: po/raw.string:19 msgid "Kings" msgstr "" #: po/raw.string:20 msgid "Queens" msgstr "" #: po/raw.string:21 msgid "Jacks" msgstr "" #: po/raw.string:22 msgid "Tens" msgstr "" #: po/raw.string:23 msgid "Nines" msgstr "" #: po/raw.string:24 msgid "Eights" msgstr "" #: po/raw.string:25 msgid "Sevens" msgstr "" #: po/raw.string:26 msgid "Sixes" msgstr "" #: po/raw.string:27 msgid "Fives" msgstr "" #: po/raw.string:28 msgid "Fours" msgstr "" #: po/raw.string:29 msgid "Treys" msgstr "" #: po/raw.string:30 msgid "Deuces" msgstr "" poker-engine-1.3.6/po/sv.po0000644000175000017500000002274011540702115012434 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:31+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #58068 (sv) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s visas %(value)s för %(side)s" # Translation #58069 (sv) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s muck förlorar sin hand" # Translation #58070 (sv) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "vinner %(side)s" # Translation #58071 (sv) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "vinnarna delar pÃ¥ potten %(pot)s" # Translation #58072 (sv) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d odd chips)" # Translation #58073 (sv) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s receives %(amount)s" # Translation #58074 (sv) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #58075 (sv) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s väntar pÃ¥" # Translation #58076 (sv) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d spelare" # Translation #58077 (sv) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Anslagstavla: %(board)s" # Translation #58078 (sv) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Kortspelare %(name)s: %(card)s" # Translation #58079 (sv) #: pokerengine/pokergame.py:370 #, fuzzy, python-format msgid "Board: %(cards)s" msgstr "Anslagstavla: %(card)s" # Translation #58080 (sv) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cards player %(name)s: %(cards)s" # Translation #58081 (sv) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Spelavgift %(amount)s" # Translation #58082 (sv) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "och %(dead)d dead" # Translation #58083 (sv) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s betalar %(amount)s blind%(deadmsg)s" # Translation #58084 (sv) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s betalar %(amount)s ante" # Translation #58085 (sv) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s satsar all in" # Translation #58086 (sv) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s gör en call pÃ¥ %(amount)s" # Translation #58087 (sv) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s checkar" # Translation #58088 (sv) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s gör en fold" # Translation #58089 (sv) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s höjer %(amount)s" # Translation #58090 (sv) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s Ã¥tervänder till %(name)s)" # Translation #58091 (sv) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "rundan avbruten %(message)s" # Translation #58092 (sv) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s tar emot %(amount)s (alla andra har foldat)" # Translation #58093 (sv) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s tar emot %(amount)d udda chips" # Translation #58094 (sv) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "skickar tillbaka satsning pÃ¥ %(amount)s till %(name)s utan call" # Translation #58095 (sv) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s gÃ¥r ut" # Translation #58096 (sv) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "Hjulet" # Translation #58097 (sv) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Höga kort %(card)s" # Translation #58098 (sv) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Ett par i %(card)s" # Translation #58099 (sv) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kickar" # Translation #58100 (sv) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "TvÃ¥ par i %(card1)s och %(card2)s" # Translation #58101 (sv) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Tre %(card)s" # Translation #58102 (sv) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straight i %(card1)s till %(card2)s" # Translation #58103 (sv) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Färg %(card)s i höga kort" # Translation #58104 (sv) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss full av %(card2)ss" # Translation #58105 (sv) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Fyra lika %(card)s" # Translation #58106 (sv) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #58107 (sv) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s i höga kort" # Translation #58108 (sv) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Par i %(card)s" # Translation #58109 (sv) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Par i %(card1)s och %(card2)s" # Translation #58110 (sv) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Triss i %(card)s" # Translation #58111 (sv) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straight %(card)s i höga kort" # Translation #58112 (sv) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Fyra lika i %(card)s" # Translation #58113 (sv) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight flush" # Translation #58114 (sv) #: po/raw.string:1 msgid "hi" msgstr "hög" # Translation #58115 (sv) #: po/raw.string:2 msgid "low" msgstr "lÃ¥g" # Translation #58116 (sv) #: po/raw.string:4 msgid "Ace" msgstr "Ess" # Translation #58117 (sv) #: po/raw.string:5 msgid "King" msgstr "Kung" # Translation #58118 (sv) #: po/raw.string:6 msgid "Queen" msgstr "Dam" # Translation #58119 (sv) #: po/raw.string:7 msgid "Jack" msgstr "Knekt" # Translation #58120 (sv) #: po/raw.string:8 msgid "Ten" msgstr "Tia" # Translation #58121 (sv) #: po/raw.string:9 msgid "Nine" msgstr "Nia" # Translation #58122 (sv) #: po/raw.string:10 msgid "Eight" msgstr "Ã…tta" # Translation #58123 (sv) #: po/raw.string:11 msgid "Seven" msgstr "Sjua" # Translation #58124 (sv) #: po/raw.string:12 msgid "Six" msgstr "Sexa" # Translation #58125 (sv) #: po/raw.string:13 msgid "Five" msgstr "Femma" # Translation #58126 (sv) #: po/raw.string:14 msgid "Four" msgstr "Fyra" # Translation #58127 (sv) #: po/raw.string:15 msgid "Trey" msgstr "Treor" # Translation #58128 (sv) #: po/raw.string:16 msgid "Deuce" msgstr "TvÃ¥a" # Translation #58129 (sv) #: po/raw.string:18 msgid "Aces" msgstr "Ess" # Translation #58130 (sv) #: po/raw.string:19 msgid "Kings" msgstr "Kungar" # Translation #58131 (sv) #: po/raw.string:20 msgid "Queens" msgstr "Damer" # Translation #58132 (sv) #: po/raw.string:21 msgid "Jacks" msgstr "Knektar" # Translation #58133 (sv) #: po/raw.string:22 msgid "Tens" msgstr "Tior" # Translation #58134 (sv) #: po/raw.string:23 msgid "Nines" msgstr "Nior" # Translation #58135 (sv) #: po/raw.string:24 msgid "Eights" msgstr "Ã…ttor" # Translation #58136 (sv) #: po/raw.string:25 msgid "Sevens" msgstr "Sjuor" # Translation #58137 (sv) #: po/raw.string:26 msgid "Sixes" msgstr "Sexor" # Translation #58138 (sv) #: po/raw.string:27 msgid "Fives" msgstr "Femmor" # Translation #58139 (sv) #: po/raw.string:28 msgid "Fours" msgstr "Fyror" # Translation #58140 (sv) #: po/raw.string:29 msgid "Treys" msgstr "Treor" # Translation #58141 (sv) #: po/raw.string:30 msgid "Deuces" msgstr "TvÃ¥or" poker-engine-1.3.6/po/fr_BE.po0000644000175000017500000002300111540702112012745 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" # Translation #54326 (fr) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s montre %(value)s comme %(side)s" # Translation #54327 (fr) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s se couche" # Translation #54328 (fr) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "gagne avec la %(side)s" # Translation #54329 (fr) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "les gagnants se partagent le pot de %(pot)s" # Translation #54330 (fr) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(moins %(chips_left)d restant)" # Translation #54331 (fr) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s reçoit %(amount)s" # Translation #54332 (fr) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "main #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #54333 (fr) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s attend pour" # Translation #54334 (fr) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d joueurs" # Translation #54335 (fr) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Tableau : %(board)s" # Translation #54336 (fr) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cartes de %(name)s : %(card)s" # Translation #54337 (fr) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Tableau : %(cards)s" # Translation #54338 (fr) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cartes de %(name)s : %(cards)s" # Translation #54339 (fr) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Commission %(amount)s" # Translation #54340 (fr) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "et %(dead)d d'argent mort" # Translation #54341 (fr) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s paye %(amount)s de blind%(deadmsg)s" # Translation #54342 (fr) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s paye %(amount)s d'ante" # Translation #54343 (fr) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s fais tapis" # Translation #54344 (fr) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s suit %(amount)s" # Translation #54345 (fr) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s passe" # Translation #54346 (fr) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s se couche" # Translation #54347 (fr) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s relance de %(amount)s" # Translation #54348 (fr) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s redonné à %(name)s)" # Translation #54349 (fr) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "tour annulé%(message)s" # Translation #54350 (fr) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s reçoit %(amount)s (les autres joueurs se sont couchés)" # Translation #54351 (fr) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s recoit %(amount)d (rocks restants)" # Translation #54352 (fr) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "retour de %(amount)s à %(name)s (mise non-suivie)" # Translation #54353 (fr) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s se lève" # Translation #54354 (fr) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "La roue" # Translation #54355 (fr) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Carte haute %(card)s" # Translation #54356 (fr) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Paire %(card)s" # Translation #54357 (fr) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s pour kicker" # Translation #54358 (fr) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Double paire : paire %(card1)s et paire %(card2)s" # Translation #54359 (fr) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Brelan %(card)s" # Translation #54360 (fr) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Suite, %(card1)s à %(card2)s" # Translation #54361 (fr) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Couleur, hauteur %(card)s" # Translation #54362 (fr) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "Full aux %(card1)s par les %(card2)s" # Translation #54363 (fr) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Carré %(card)s" # Translation #54364 (fr) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Quinte flush royale" # Translation #54365 (fr) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Suite, hauteur %(card)s" # Translation #54366 (fr) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Paire %(card)s" # Translation #54367 (fr) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Double paire : paire %(card1)s et paire %(card2)s" # Translation #54368 (fr) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Brelan %(card)s" # Translation #54369 (fr) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Suite, hauteur %(card)s" # Translation #54370 (fr) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Carré %(card)s" # Translation #54371 (fr) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Quinte flush" # Translation #54372 (fr) #: po/raw.string:1 msgid "hi" msgstr "main la plus haute" # Translation #54373 (fr) #: po/raw.string:2 msgid "low" msgstr "main la plus basse" # Translation #54374 (fr) #: po/raw.string:4 msgid "Ace" msgstr "As" # Translation #54375 (fr) #: po/raw.string:5 msgid "King" msgstr "Roi" # Translation #54376 (fr) #: po/raw.string:6 msgid "Queen" msgstr "Dame" # Translation #54377 (fr) #: po/raw.string:7 msgid "Jack" msgstr "Valet" # Translation #54378 (fr) #: po/raw.string:8 msgid "Ten" msgstr "Dix" # Translation #54379 (fr) #: po/raw.string:9 msgid "Nine" msgstr "Neuf" # Translation #54380 (fr) #: po/raw.string:10 msgid "Eight" msgstr "Huit" # Translation #54381 (fr) #: po/raw.string:11 msgid "Seven" msgstr "Sept" # Translation #54382 (fr) #: po/raw.string:12 msgid "Six" msgstr "Six" # Translation #54383 (fr) #: po/raw.string:13 msgid "Five" msgstr "Cinq" # Translation #54384 (fr) #: po/raw.string:14 msgid "Four" msgstr "Quatre" # Translation #54385 (fr) #: po/raw.string:15 msgid "Trey" msgstr "Trois" # Translation #54386 (fr) #: po/raw.string:16 msgid "Deuce" msgstr "Deux" # Translation #54387 (fr) #: po/raw.string:18 msgid "Aces" msgstr "d'As" # Translation #54388 (fr) #: po/raw.string:19 msgid "Kings" msgstr "de Roi" # Translation #54389 (fr) #: po/raw.string:20 msgid "Queens" msgstr "de Dame" # Translation #54390 (fr) #: po/raw.string:21 msgid "Jacks" msgstr "de Valet" # Translation #54391 (fr) #: po/raw.string:22 msgid "Tens" msgstr "de Dix" # Translation #54392 (fr) #: po/raw.string:23 msgid "Nines" msgstr "de Neuf" # Translation #54393 (fr) #: po/raw.string:24 msgid "Eights" msgstr "de Huit" # Translation #54394 (fr) #: po/raw.string:25 msgid "Sevens" msgstr "de Sept" # Translation #54395 (fr) #: po/raw.string:26 msgid "Sixes" msgstr "de Six" # Translation #54396 (fr) #: po/raw.string:27 msgid "Fives" msgstr "de Cinq" # Translation #54397 (fr) #: po/raw.string:28 msgid "Fours" msgstr "de Quatre" # Translation #54398 (fr) #: po/raw.string:29 msgid "Treys" msgstr "de Trois" # Translation #54399 (fr) #: po/raw.string:30 msgid "Deuces" msgstr "de Deux" poker-engine-1.3.6/po/Makefile.in0000644000175000017500000005236011540702065013516 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2003-2006 Free Software Foundation, Inc. # This file is in the public domain. # # Makefile configuration - processed by automake. VPATH = @srcdir@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = po DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgdatadir = @pkgdatadir@ pkglibdir = @pkglibdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = msgmerge PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POKER_ENGINE_PKGDATADIR = @POKER_ENGINE_PKGDATADIR@ POKER_ENGINE_PKGLIBDIR = @POKER_ENGINE_PKGLIBDIR@ POKER_ENGINE_PKGSYSCONFDIR = @POKER_ENGINE_PKGSYSCONFDIR@ PYPOKER_EVAL_CFLAGS = @PYPOKER_EVAL_CFLAGS@ PYPOKER_EVAL_LIBS = @PYPOKER_EVAL_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RSYNC = @RSYNC@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pkgsysconfdir = @pkgsysconfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # List of files which contain translatable strings. POTFILES = \ pokerengine/pokergame.py \ po/raw.string # Usually the message domain is the same as the package name. DOMAIN = poker-engine # These options get passed to xgettext. XGETTEXT_OPTIONS = # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = http://www.pokersource.info # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = http://www.pokersource.info # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS = @POTFILES_DEPS@ # This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) POFILES = @POFILES@ # This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) GMOFILES = @GMOFILES@ # This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) UPDATEPOFILES = @UPDATEPOFILES@ # This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) DUMMYPOFILES = @DUMMYPOFILES@ # This is computed as # $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) CATALOGS = @CATALOGS@ SUFFIXES = .po .gmo .mo .sed .sin .nop .po-create .po-update MOSTLYCLEANFILES = remove-potcdate.sed stamp-poT core core.* \ *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po \ *.o DISTCLEANFILES = *.mo stamp-po MAINTAINERCLEANFILES = stamp-po $(GMOFILES) EXTRA_DIST = remove-potcdate.sin LINGUAS $(POFILES) $(GMOFILES) all: all-am .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu po/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu po/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile all-local installdirs: installdirs-local install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-local maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-local .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all-local: all-local-@USE_NLS@ all-local-yes: stamp-po all-local-no: # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed if test -n '$(MSGID_BUGS_ADDRESS)'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ $(POTFILES) test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ else \ $(MAKE) $${lang}.po-create; \ fi install-data-local: install-data-local-@USE_NLS@ install-data-local-no: all-local install-data-local-yes: all-local $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done installdirs-local: installdirs-local-@USE_NLS@ installdirs-local-no: installdirs-local-yes: $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done uninstall-local: uninstall-local-@USE_NLS@ uninstall-local-no: uninstall-local-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done html ID: # Hidden from automake, but really activated. Works around an automake-1.5 bug. #distdir: distdir1 distdir1: $(MAKE) update-po if test -f $(srcdir)/$(DOMAIN).pot; then \ for file in $(DOMAIN).pot stamp-po; do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ cp -p $$d/$$file $(distdir)/$$file || exit 1; \ done; \ fi update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: poker-engine-1.3.6/po/fi.po0000644000175000017500000002266311540702112012403 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #54820 (fi) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s shows %(value)s for %(side)s" # Translation #54821 (fi) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s mucks loosing hand" # Translation #54822 (fi) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "wins %(side)s" # Translation #54823 (fi) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "voittajat jakavat potin %(pot)s" # Translation #54824 (fi) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d odd chips)" # Translation #54825 (fi) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s receives %(amount)s" # Translation #54826 (fi) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #54827 (fi) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s waiting for" # Translation #54828 (fi) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d players" # Translation #54829 (fi) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Pöytäkortit: %(board)s" # Translation #54830 (fi) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cards player %(name)s: %(card)s" # Translation #54831 (fi) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Board: %(cards)s" # Translation #54832 (fi) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cards player %(name)s: %(cards)s" # Translation #54833 (fi) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Rake %(amount)s" # Translation #54834 (fi) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "and %(dead)d dead" # Translation #54835 (fi) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s pays %(amount)s blind%(deadmsg)s" # Translation #54836 (fi) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s pays %(amount)s ante" # Translation #54837 (fi) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s is all in" # Translation #54838 (fi) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s calls %(amount)s" # Translation #54839 (fi) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s checks" # Translation #54840 (fi) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s folds" # Translation #54841 (fi) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s raises %(amount)s" # Translation #54842 (fi) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s returned to %(name)s)" # Translation #54843 (fi) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "turn canceled%(message)s" # Translation #54844 (fi) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s receives %(amount)s (everyone else folded)" # Translation #54845 (fi) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s receives %(amount)d odd chips" # Translation #54846 (fi) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "returning uncalled bet %(amount)s to %(name)s" # Translation #54847 (fi) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s sits out" # Translation #54848 (fi) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "Paras mahdollinen käsi" # Translation #54849 (fi) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "High card %(card)s" # Translation #54850 (fi) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "A pair of %(card)s" # Translation #54851 (fi) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #54852 (fi) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Two pairs %(card1)s and %(card2)s" # Translation #54853 (fi) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Three of a kind %(card)s" # Translation #54854 (fi) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straight %(card1)s to %(card2)s" # Translation #54855 (fi) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s high" # Translation #54856 (fi) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss full of %(card2)ss" # Translation #54857 (fi) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Four of a kind %(card)s" # Translation #54858 (fi) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #54859 (fi) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s high" # Translation #54860 (fi) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Pair of %(card)s" # Translation #54861 (fi) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Pairs of %(card1)s and %(card2)s" # Translation #54862 (fi) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Trips %(card)s" # Translation #54863 (fi) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straight %(card)s high" # Translation #54864 (fi) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Quads %(card)s" # Translation #54865 (fi) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Värisuora" # Translation #54866 (fi) #: po/raw.string:1 msgid "hi" msgstr "hi" # Translation #54867 (fi) #: po/raw.string:2 msgid "low" msgstr "low" # Translation #54868 (fi) #: po/raw.string:4 msgid "Ace" msgstr "Ässä" # Translation #54869 (fi) #: po/raw.string:5 msgid "King" msgstr "Kunkku" # Translation #54870 (fi) #: po/raw.string:6 msgid "Queen" msgstr "Kuningatar" # Translation #54871 (fi) #: po/raw.string:7 msgid "Jack" msgstr "Jätkä" # Translation #54872 (fi) #: po/raw.string:8 msgid "Ten" msgstr "Kymppi" # Translation #54873 (fi) #: po/raw.string:9 msgid "Nine" msgstr "Ysi" # Translation #54874 (fi) #: po/raw.string:10 msgid "Eight" msgstr "Kasi" # Translation #54875 (fi) #: po/raw.string:11 msgid "Seven" msgstr "Seiska" # Translation #54876 (fi) #: po/raw.string:12 msgid "Six" msgstr "Kutonen" # Translation #54877 (fi) #: po/raw.string:13 msgid "Five" msgstr "Vitonen" # Translation #54878 (fi) #: po/raw.string:14 msgid "Four" msgstr "Nelonen" # Translation #54879 (fi) #: po/raw.string:15 msgid "Trey" msgstr "Trey" # Translation #54880 (fi) #: po/raw.string:16 msgid "Deuce" msgstr "Deuce" # Translation #54881 (fi) #: po/raw.string:18 msgid "Aces" msgstr "Ässät" # Translation #54882 (fi) #: po/raw.string:19 msgid "Kings" msgstr "Kunkut" # Translation #54883 (fi) #: po/raw.string:20 msgid "Queens" msgstr "Kuningattaret" # Translation #54884 (fi) #: po/raw.string:21 msgid "Jacks" msgstr "Jätkät" # Translation #54885 (fi) #: po/raw.string:22 msgid "Tens" msgstr "Kympit" # Translation #54886 (fi) #: po/raw.string:23 msgid "Nines" msgstr "Ysit" # Translation #54887 (fi) #: po/raw.string:24 msgid "Eights" msgstr "Kasit" # Translation #54888 (fi) #: po/raw.string:25 msgid "Sevens" msgstr "Seiskat" # Translation #54889 (fi) #: po/raw.string:26 msgid "Sixes" msgstr "Kutoset" # Translation #54890 (fi) #: po/raw.string:27 msgid "Fives" msgstr "Vitoset" # Translation #54891 (fi) #: po/raw.string:28 msgid "Fours" msgstr "Neloset" # Translation #54892 (fi) #: po/raw.string:29 msgid "Treys" msgstr "Treys" # Translation #54893 (fi) #: po/raw.string:30 msgid "Deuces" msgstr "Deuces" poker-engine-1.3.6/po/nl.po0000644000175000017500000002273411540702114012417 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:31+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #55763 (nl) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s toont %(value)s voor %(side)s" # Translation #55764 (nl) #: pokerengine/pokergame.py:313 #, fuzzy, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name) verbergt verliezende hand" # Translation #55765 (nl) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "wint %(side)s" # Translation #55767 (nl) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "winnaars verdelen een pot van %(pot)s" # Translation #55768 (nl) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d odd chips)" # Translation #55858 (nl) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s ontvangt %(amount)s" # Translation #55866 (nl) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #55868 (nl) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s wachten op" # Translation #55873 (nl) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d spelers" # Translation #55879 (nl) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Bord: %(board)s" # Translation #55882 (nl) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Kaarten van %(name)s: %(card)s" # Translation #55883 (nl) #: pokerengine/pokergame.py:370 #, fuzzy, python-format msgid "Board: %(cards)s" msgstr "Bord: %(card)s" # Translation #55885 (nl) #: pokerengine/pokergame.py:375 #, fuzzy, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Kaarten van %(name)s: %(card)s" # Translation #55886 (nl) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Inschrijvingsgeld %(amount)s" # Translation #55897 (nl) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "en %(dead)d dead" # Translation #55903 (nl) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s betaalt %(amount)s blind%(deadmsg)s" # Translation #55916 (nl) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s betaalt %(amount)s ante" # Translation #55932 (nl) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s gaat all-in" # Translation #55942 (nl) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s callt %(amount)s" # Translation #55951 (nl) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s volgt" # Translation #55953 (nl) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s past" # Translation #55958 (nl) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s verhoogt %(amount)s" # Translation #55960 (nl) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s teruggegeven aan %(name)s)" # Translation #55965 (nl) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "Toer afgezegd%(message)s" # Translation #55971 (nl) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s ontvangt %(amount)s (alle anderen hebben gepast)" # Translation #55981 (nl) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s ontvangt %(amount)d resterende chips" # Translation #56161 (nl) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "Inzet niet gevolgd - %(amount)s teruggegeven aan %(name)s" # Translation #56169 (nl) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s staat op" # Translation #56172 (nl) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "Het rad" # Translation #56173 (nl) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "High card %(card)s" # Translation #56174 (nl) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Een paar van %(card)s" # Translation #56178 (nl) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #56185 (nl) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Twee paar %(card1)s en %(card2)s" # Translation #56187 (nl) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Three of a kind %(card)s" # Translation #56189 (nl) #: pokerengine/pokergame.py:2959 #, fuzzy, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straat %(card1) tot %(card2)s" # Translation #56193 (nl) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s hoog" # Translation #56199 (nl) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss full van %(card2)ss" # Translation #56203 (nl) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Carré %(card)s" # Translation #56205 (nl) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #56207 (nl) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s hoog" # Translation #56210 (nl) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Paar van %(card)s" # Translation #56212 (nl) #: pokerengine/pokergame.py:2986 #, fuzzy, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Paar van %(card1) en %(card2)s" # Translation #56213 (nl) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Trips %(card)s" # Translation #56215 (nl) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straat %(card)s hoog" # Translation #56217 (nl) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Quads %(card)s" # Translation #56218 (nl) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight flush" # Translation #56219 (nl) #: po/raw.string:1 msgid "hi" msgstr "hoog" # Translation #56224 (nl) #: po/raw.string:2 msgid "low" msgstr "laag" # Translation #56225 (nl) #: po/raw.string:4 msgid "Ace" msgstr "Aas" # Translation #56226 (nl) #: po/raw.string:5 msgid "King" msgstr "Koning" # Translation #56228 (nl) #: po/raw.string:6 msgid "Queen" msgstr "Koningin" # Translation #56230 (nl) #: po/raw.string:7 msgid "Jack" msgstr "Boer" # Translation #56231 (nl) #: po/raw.string:8 msgid "Ten" msgstr "Tien" # Translation #56233 (nl) #: po/raw.string:9 msgid "Nine" msgstr "Negen" # Translation #56235 (nl) #: po/raw.string:10 msgid "Eight" msgstr "Acht" # Translation #56238 (nl) #: po/raw.string:11 msgid "Seven" msgstr "Zeven" # Translation #56239 (nl) #: po/raw.string:12 msgid "Six" msgstr "Zes" # Translation #56241 (nl) #: po/raw.string:13 msgid "Five" msgstr "Vijf" # Translation #56242 (nl) #: po/raw.string:14 msgid "Four" msgstr "Vier" # Translation #56243 (nl) #: po/raw.string:15 msgid "Trey" msgstr "Drie" # Translation #56245 (nl) #: po/raw.string:16 msgid "Deuce" msgstr "Twee" # Translation #56250 (nl) #: po/raw.string:18 msgid "Aces" msgstr "Azen" # Translation #56251 (nl) #: po/raw.string:19 msgid "Kings" msgstr "Koningen" # Translation #56252 (nl) #: po/raw.string:20 msgid "Queens" msgstr "Koninginnen" # Translation #56253 (nl) #: po/raw.string:21 msgid "Jacks" msgstr "Boeren" # Translation #56254 (nl) #: po/raw.string:22 msgid "Tens" msgstr "Tienen" # Translation #56255 (nl) #: po/raw.string:23 msgid "Nines" msgstr "Negens" # Translation #56256 (nl) #: po/raw.string:24 msgid "Eights" msgstr "Achten" # Translation #56257 (nl) #: po/raw.string:25 msgid "Sevens" msgstr "Zevens" # Translation #56258 (nl) #: po/raw.string:26 msgid "Sixes" msgstr "Zessen" # Translation #56259 (nl) #: po/raw.string:27 msgid "Fives" msgstr "Vijfen" # Translation #56260 (nl) #: po/raw.string:28 msgid "Fours" msgstr "Vieren" # Translation #56261 (nl) #: po/raw.string:29 msgid "Treys" msgstr "Drieën" # Translation #56262 (nl) #: po/raw.string:30 msgid "Deuces" msgstr "Tweeën" poker-engine-1.3.6/po/en_US.po0000644000175000017500000002256211540702111013013 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #58366 (en) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s shows %(value)s for %(side)s" # Translation #58367 (en) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s mucks loosing hand" # Translation #58368 (en) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "wins %(side)s" # Translation #58369 (en) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "winners share a pot of %(pot)s" # Translation #58371 (en) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d odd chips)" # Translation #58372 (en) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s receives %(amount)s" # Translation #58373 (en) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #58374 (en) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s waiting for" # Translation #58375 (en) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d players" # Translation #58376 (en) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Board: %(board)s" # Translation #58377 (en) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cards player %(name)s: %(card)s" # Translation #58378 (en) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Board: %(cards)s" # Translation #58379 (en) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cards player %(name)s: %(cards)s" # Translation #58380 (en) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Rake %(amount)s" # Translation #58381 (en) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "and %(dead)d dead" # Translation #58382 (en) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s pays %(amount)s blind%(deadmsg)s" # Translation #58383 (en) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s pays %(amount)s ante" # Translation #58384 (en) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s is all in" # Translation #58385 (en) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s calls %(amount)s" # Translation #58386 (en) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s checks" # Translation #58387 (en) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s folds" # Translation #58388 (en) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s raises %(amount)s" # Translation #58389 (en) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s returned to %(name)s)" # Translation #58390 (en) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "turn canceled%(message)s" # Translation #58391 (en) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s receives %(amount)s (everyone else folded)" # Translation #58392 (en) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s receives %(amount)d odd chips" # Translation #58393 (en) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "returning uncalled bet %(amount)s to %(name)s" # Translation #58394 (en) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s sits out" # Translation #58395 (en) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "The wheel" # Translation #58396 (en) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "High card %(card)s" # Translation #58397 (en) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "A pair of %(card)s" # Translation #58398 (en) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #58399 (en) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Two pairs %(card1)s and %(card2)s" # Translation #58400 (en) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Three of a kind %(card)s" # Translation #58401 (en) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straight %(card1)s to %(card2)s" # Translation #58402 (en) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s high" # Translation #58403 (en) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss full of %(card2)ss" # Translation #58404 (en) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Four of a kind %(card)s" # Translation #58405 (en) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #58406 (en) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s high" # Translation #58407 (en) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Pair of %(card)s" # Translation #58408 (en) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Pairs of %(card1)s and %(card2)s" # Translation #58409 (en) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Trips %(card)s" # Translation #58410 (en) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straight %(card)s high" # Translation #58411 (en) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Quads %(card)s" # Translation #58412 (en) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight flush" # Translation #58413 (en) #: po/raw.string:1 msgid "hi" msgstr "hi" # Translation #58414 (en) #: po/raw.string:2 msgid "low" msgstr "low" # Translation #58415 (en) #: po/raw.string:4 msgid "Ace" msgstr "Ace" # Translation #58416 (en) #: po/raw.string:5 msgid "King" msgstr "King" # Translation #58417 (en) #: po/raw.string:6 msgid "Queen" msgstr "Queen" # Translation #58418 (en) #: po/raw.string:7 msgid "Jack" msgstr "Jack" # Translation #58419 (en) #: po/raw.string:8 msgid "Ten" msgstr "Ten" # Translation #58420 (en) #: po/raw.string:9 msgid "Nine" msgstr "Nine" # Translation #58421 (en) #: po/raw.string:10 msgid "Eight" msgstr "Eight" # Translation #58422 (en) #: po/raw.string:11 msgid "Seven" msgstr "Seven" # Translation #58423 (en) #: po/raw.string:12 msgid "Six" msgstr "Six" # Translation #58424 (en) #: po/raw.string:13 msgid "Five" msgstr "Five" # Translation #58425 (en) #: po/raw.string:14 msgid "Four" msgstr "Four" # Translation #58426 (en) #: po/raw.string:15 msgid "Trey" msgstr "Trey" # Translation #58427 (en) #: po/raw.string:16 msgid "Deuce" msgstr "Deuce" # Translation #58428 (en) #: po/raw.string:18 msgid "Aces" msgstr "Aces" # Translation #58429 (en) #: po/raw.string:19 msgid "Kings" msgstr "Kings" # Translation #58430 (en) #: po/raw.string:20 msgid "Queens" msgstr "Queens" # Translation #58431 (en) #: po/raw.string:21 msgid "Jacks" msgstr "Jacks" # Translation #58432 (en) #: po/raw.string:22 msgid "Tens" msgstr "Tens" # Translation #58433 (en) #: po/raw.string:23 msgid "Nines" msgstr "Nines" # Translation #58434 (en) #: po/raw.string:24 msgid "Eights" msgstr "Eights" # Translation #58435 (en) #: po/raw.string:25 msgid "Sevens" msgstr "Sevens" # Translation #58436 (en) #: po/raw.string:26 msgid "Sixes" msgstr "Sixes" # Translation #58437 (en) #: po/raw.string:27 msgid "Fives" msgstr "Fives" # Translation #58438 (en) #: po/raw.string:28 msgid "Fours" msgstr "Fours" # Translation #58439 (en) #: po/raw.string:29 msgid "Treys" msgstr "Treys" # Translation #58440 (en) #: po/raw.string:30 msgid "Deuces" msgstr "Deuces" poker-engine-1.3.6/po/nb.po0000644000175000017500000002256611540702114012410 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:31+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #56402 (nb) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s viser %(value)s for %(side)s" # Translation #56404 (nb) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s skjuler tapende hÃ¥nd" # Translation #56412 (nb) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "vinner %(side)s" # Translation #56415 (nb) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "vinnere deler en pott pÃ¥ %(pot)s" # Translation #56419 (nb) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d odd chips)" # Translation #56421 (nb) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s fÃ¥r %(amount)s" # Translation #56425 (nb) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #56430 (nb) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s venter pÃ¥" # Translation #56438 (nb) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d spillere" # Translation #56440 (nb) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Board: %(board)s" # Translation #56443 (nb) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Kort spiller %(name)s: %(card)s" # Translation #56444 (nb) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Board: %(cards)s" # Translation #56445 (nb) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Kort spiller %(name)s: %(cards)s" # Translation #56455 (nb) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Spilleavgift %(amount)s" # Translation #56457 (nb) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "og %(dead)d dead" # Translation #56464 (nb) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s betaler %(amount)s blind%(deadmsg)s" # Translation #56467 (nb) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s betaler %(amount)s ante" # Translation #56470 (nb) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s er all in" # Translation #56478 (nb) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s caller %(amount)s" # Translation #56479 (nb) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s checks" # Translation #56480 (nb) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s folder" # Translation #56481 (nb) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s raiser %(amount)s" # Translation #56483 (nb) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s returnerte til %(name)s)" # Translation #56485 (nb) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "Runde avlyst%(message)s" # Translation #56488 (nb) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s fÃ¥r %(amount)s (resten foldet)" # Translation #56516 (nb) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s fÃ¥r %(amount)d gjenværende chips" # Translation #56532 (nb) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "returnerer uncalled bet %(amount)s til %(name)s" # Translation #56535 (nb) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s stÃ¥r over" # Translation #56537 (nb) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "Hjulet" # Translation #56541 (nb) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, fuzzy, python-format msgid "High card %(card)s" msgstr "Høyeste kort" # Translation #56542 (nb) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Et par %(card)s" # Translation #56544 (nb) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #56546 (nb) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "To par %(card1)s og %(card2)s" # Translation #56547 (nb) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Tre like %(card)s" # Translation #56551 (nb) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straight %(card1)s til %(card2)s" # Translation #56642 (nb) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s høy" # Translation #56646 (nb) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss full av %(card2)ss" # Translation #56647 (nb) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Fire like %(card)s" # Translation #56649 (nb) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #56651 (nb) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s høy" # Translation #56652 (nb) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Pair i %(card)s" # Translation #56656 (nb) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Par i %(card1)s og %(card2)s" # Translation #56663 (nb) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Tre like %(card)s" # Translation #56664 (nb) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straight %(card)s høy" # Translation #56667 (nb) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Fire like %(card)s" # Translation #56669 (nb) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight flush" # Translation #56671 (nb) #: po/raw.string:1 msgid "hi" msgstr "høy" # Translation #56672 (nb) #: po/raw.string:2 msgid "low" msgstr "lav" # Translation #56674 (nb) #: po/raw.string:4 msgid "Ace" msgstr "Ess" # Translation #56676 (nb) #: po/raw.string:5 msgid "King" msgstr "Konge" # Translation #56678 (nb) #: po/raw.string:6 msgid "Queen" msgstr "Dame" # Translation #56679 (nb) #: po/raw.string:7 msgid "Jack" msgstr "Knekt" # Translation #56680 (nb) #: po/raw.string:8 msgid "Ten" msgstr "Ti" # Translation #56681 (nb) #: po/raw.string:9 msgid "Nine" msgstr "Ni" # Translation #56682 (nb) #: po/raw.string:10 msgid "Eight" msgstr "Ã…tte" # Translation #56683 (nb) #: po/raw.string:11 msgid "Seven" msgstr "Sju" # Translation #56685 (nb) #: po/raw.string:12 msgid "Six" msgstr "Seks" # Translation #56686 (nb) #: po/raw.string:13 msgid "Five" msgstr "Fem" # Translation #56687 (nb) #: po/raw.string:14 msgid "Four" msgstr "Fire" # Translation #56697 (nb) #: po/raw.string:15 msgid "Trey" msgstr "Tre" # Translation #56704 (nb) #: po/raw.string:16 msgid "Deuce" msgstr "To" # Translation #56705 (nb) #: po/raw.string:18 msgid "Aces" msgstr "Ess" # Translation #56707 (nb) #: po/raw.string:19 msgid "Kings" msgstr "Konger" # Translation #56708 (nb) #: po/raw.string:20 msgid "Queens" msgstr "Damer" # Translation #56710 (nb) #: po/raw.string:21 msgid "Jacks" msgstr "Knekter" # Translation #56714 (nb) #: po/raw.string:22 msgid "Tens" msgstr "Tiere" # Translation #56715 (nb) #: po/raw.string:23 msgid "Nines" msgstr "Niere" # Translation #56716 (nb) #: po/raw.string:24 msgid "Eights" msgstr "Ã…ttere" # Translation #56720 (nb) #: po/raw.string:25 msgid "Sevens" msgstr "Sjuere" # Translation #56722 (nb) #: po/raw.string:26 msgid "Sixes" msgstr "Seksere" # Translation #56723 (nb) #: po/raw.string:27 msgid "Fives" msgstr "Femmere" # Translation #56724 (nb) #: po/raw.string:28 msgid "Fours" msgstr "Firere" # Translation #56741 (nb) #: po/raw.string:29 msgid "Treys" msgstr "Treere" # Translation #56743 (nb) #: po/raw.string:30 msgid "Deuces" msgstr "Toere" poker-engine-1.3.6/po/fr.gmo0000644000175000017500000001052111540702120012545 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { Žš $) N g v ‰  ° ,Ð ý + H Ad ¦ !¸ Ú ñ 0Nmrz‡Œ”®µ ÅÏäêó÷þ 1L\ai“˜ ¤«Ã áî )/81H9z´Ç2Ú +%(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n>1; Full aux %(card1)s par les %(card2)s%(name)s suit %(amount)s%(name)s passe%(name)s se couche%(name)s fais tapis%(name)s se couche%(name)s paye %(amount)s d'ante%(name)s paye %(amount)s de blind%(deadmsg)s%(name)s relance de %(amount)s%(name)s recoit %(amount)d (rocks restants)%(name)s reçoit %(amount)s%(name)s reçoit %(amount)s (les autres joueurs se sont couchés)%(name)s se lève%(name)s, %(len_pockets)d joueurs, %(card)s pour kickerPaire %(card)sAsd'AsTableau : %(board)sTableau : %(cards)sCartes de %(name)s : %(card)sCartes de %(name)s : %(cards)sDeuxde DeuxHuitde HuitCinqde CinqCouleur, hauteur %(card)sQuatreCarré %(card)sde QuatreCarte haute %(card)sValetde ValetRoide RoiNeufde NeufPaire %(card)sDouble paire : paire %(card1)s et paire %(card2)sCarré %(card)sDamede DameCommission %(amount)sQuinte flush royaleSeptde SeptSixde SixSuite, hauteur %(card)sSuite, %(card1)s à %(card2)sQuinte flushSuite, hauteur %(card)sDixde DixLa roueBrelan %(card)sTroisde TroisBrelan %(card)sDouble paire : paire %(card1)s et paire %(card2)smain #%(hand_serial)d, %(variant)s, %(betting_structure)smain la plus hautemain la plus basseretour de %(amount)s à %(name)s (mise non-suivie)tour annulé%(message)sles gagnants se partagent le pot de %(pot)spoker-engine-1.3.6/po/sv.gmo0000644000175000017500000001037211540702123012575 00000000000000Þ•D<a\àáÿ)8Kg)…¯&Êñ3B!Tvˆ›Ÿ¤µ Õöü /4LRejpu{€† —¸ÇÍÔ äðöý   > M j n s } – › ¡ !° 9Ò   - A Z y  $( M ^ t ‹ ¬ ,Í ú ' = 4Z  !   Ô ç ë ï  &GMTZagnŠ¢¨¼ÂÊÏÖÚßî !%+ AMRX]c#‚¦$µÚÞã ê÷ý"97qv@{¼!Ø'; 2 7 "?@>.0B$)9/* %&A6(1C -53D,+!4=:8< #%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:31+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss full av %(card2)ss%(name)s gör en call pÃ¥ %(amount)s%(name)s checkar%(name)s gör en fold%(name)s satsar all in%(name)s muck förlorar sin hand%(name)s betalar %(amount)s ante%(name)s betalar %(amount)s blind%(deadmsg)s%(name)s höjer %(amount)s%(name)s tar emot %(amount)d udda chips%(name)s receives %(amount)s%(name)s tar emot %(amount)s (alla andra har foldat)%(name)s gÃ¥r ut%(name)s, %(len_pockets)d spelare, %(card)s kickarEtt par i %(card)sEssEssAnslagstavla: %(board)sKortspelare %(name)s: %(card)sCards player %(name)s: %(cards)sTvÃ¥aTvÃ¥orÃ…ttaÃ…ttorFemmaFemmorFärg %(card)s i höga kortFyraFyra lika %(card)sFyrorHöga kort %(card)sKnektKnektarKungKungarNiaNiorPar i %(card)sPar i %(card1)s och %(card2)sFyra lika i %(card)sDamDamerSpelavgift %(amount)sRoyal flushSjuaSjuorSexaSexorStraight %(card)s i höga kortStraight i %(card1)s till %(card2)sStraight flushStraight flush %(card)s i höga kortTiaTiorHjuletTre %(card)sTreorTreorTriss i %(card)sTvÃ¥ par i %(card1)s och %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shöglÃ¥gskickar tillbaka satsning pÃ¥ %(amount)s till %(name)s utan callrundan avbruten %(message)svinnarna delar pÃ¥ potten %(pot)spoker-engine-1.3.6/po/es.gmo0000644000175000017500000001050011540702117012550 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { š !+ M j x ‹ "ž Á ,â  -* X As µ #É í ÿ *=Zx|‚‡“𬳯Îâçíñ÷ý%:IOV ky†‹’!§ÉÛùþ%*1&B9i£²:Áü*(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; Full de %(card1)ss con %(card2)ss%(name)s sigue a %(amount)s%(name)s pasa%(name)s se retira%(name)s va all in%(name)s esconde la mano perdedora%(name)s paga %(amount)s de ante%(name)s paga %(amount)s de blind%(deadmsg)s%(name)s sube a %(amount)s%(name)s recibe %(amount)d (fichas restantes)%(name)s recibe %(amount)s%(name)s recibe %(amount)s (todos los otros jugadores se retiran)%(name)s se levanta%(name)s, %(len_pockets)d jugadores, %(card)s kickerPar de %(card)sAsAsesResumen: %(board)sResumen: %(cards)scartas de %(name)s: %(card)sCartas de %(name)s: %(cards)sDosDosesOchoOchosCincoCincosColor a %(card)sCuatroPoker de %(card)sCuatroscarta alta %(card)sJotaJotasReyReyesNueveNuevesPar de %(card)sDoble pareja de %(card1)s y %(card2)sPoker %(card)sReinaReinascomisión %(amount)sEscalera realSieteSietesSeisSeisesEscalera al %(card)sEscalera de %(card1)s a %(card2)sEscalera de colorEscalera de color al %(card)sDiezDiecesEscalera A2345Trio de %(card)sTresTresesTrio de %(card)sDoble pareja de %(card1)s y %(card2)smano #%(hand_serial)d, %(variant)s, %(betting_structure)sMano más altaMano más bajadevolución de %(amount)s à %(name)s (apuesta no seguida)turno anulado%(message)slos ganadores comparten el bote de %(pot)spoker-engine-1.3.6/po/fr_CA.po0000644000175000017500000002300111540702113012743 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" # Translation #54326 (fr) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s montre %(value)s comme %(side)s" # Translation #54327 (fr) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s se couche" # Translation #54328 (fr) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "gagne avec la %(side)s" # Translation #54329 (fr) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "les gagnants se partagent le pot de %(pot)s" # Translation #54330 (fr) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(moins %(chips_left)d restant)" # Translation #54331 (fr) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s reçoit %(amount)s" # Translation #54332 (fr) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "main #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #54333 (fr) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s attend pour" # Translation #54334 (fr) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d joueurs" # Translation #54335 (fr) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Tableau : %(board)s" # Translation #54336 (fr) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cartes de %(name)s : %(card)s" # Translation #54337 (fr) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Tableau : %(cards)s" # Translation #54338 (fr) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cartes de %(name)s : %(cards)s" # Translation #54339 (fr) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Commission %(amount)s" # Translation #54340 (fr) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "et %(dead)d d'argent mort" # Translation #54341 (fr) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s paye %(amount)s de blind%(deadmsg)s" # Translation #54342 (fr) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s paye %(amount)s d'ante" # Translation #54343 (fr) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s fais tapis" # Translation #54344 (fr) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s suit %(amount)s" # Translation #54345 (fr) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s passe" # Translation #54346 (fr) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s se couche" # Translation #54347 (fr) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s relance de %(amount)s" # Translation #54348 (fr) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s redonné à %(name)s)" # Translation #54349 (fr) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "tour annulé%(message)s" # Translation #54350 (fr) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s reçoit %(amount)s (les autres joueurs se sont couchés)" # Translation #54351 (fr) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s recoit %(amount)d (rocks restants)" # Translation #54352 (fr) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "retour de %(amount)s à %(name)s (mise non-suivie)" # Translation #54353 (fr) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s se lève" # Translation #54354 (fr) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "La roue" # Translation #54355 (fr) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Carte haute %(card)s" # Translation #54356 (fr) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Paire %(card)s" # Translation #54357 (fr) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s pour kicker" # Translation #54358 (fr) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Double paire : paire %(card1)s et paire %(card2)s" # Translation #54359 (fr) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Brelan %(card)s" # Translation #54360 (fr) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Suite, %(card1)s à %(card2)s" # Translation #54361 (fr) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Couleur, hauteur %(card)s" # Translation #54362 (fr) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "Full aux %(card1)s par les %(card2)s" # Translation #54363 (fr) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Carré %(card)s" # Translation #54364 (fr) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Quinte flush royale" # Translation #54365 (fr) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Suite, hauteur %(card)s" # Translation #54366 (fr) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Paire %(card)s" # Translation #54367 (fr) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Double paire : paire %(card1)s et paire %(card2)s" # Translation #54368 (fr) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Brelan %(card)s" # Translation #54369 (fr) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Suite, hauteur %(card)s" # Translation #54370 (fr) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Carré %(card)s" # Translation #54371 (fr) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Quinte flush" # Translation #54372 (fr) #: po/raw.string:1 msgid "hi" msgstr "main la plus haute" # Translation #54373 (fr) #: po/raw.string:2 msgid "low" msgstr "main la plus basse" # Translation #54374 (fr) #: po/raw.string:4 msgid "Ace" msgstr "As" # Translation #54375 (fr) #: po/raw.string:5 msgid "King" msgstr "Roi" # Translation #54376 (fr) #: po/raw.string:6 msgid "Queen" msgstr "Dame" # Translation #54377 (fr) #: po/raw.string:7 msgid "Jack" msgstr "Valet" # Translation #54378 (fr) #: po/raw.string:8 msgid "Ten" msgstr "Dix" # Translation #54379 (fr) #: po/raw.string:9 msgid "Nine" msgstr "Neuf" # Translation #54380 (fr) #: po/raw.string:10 msgid "Eight" msgstr "Huit" # Translation #54381 (fr) #: po/raw.string:11 msgid "Seven" msgstr "Sept" # Translation #54382 (fr) #: po/raw.string:12 msgid "Six" msgstr "Six" # Translation #54383 (fr) #: po/raw.string:13 msgid "Five" msgstr "Cinq" # Translation #54384 (fr) #: po/raw.string:14 msgid "Four" msgstr "Quatre" # Translation #54385 (fr) #: po/raw.string:15 msgid "Trey" msgstr "Trois" # Translation #54386 (fr) #: po/raw.string:16 msgid "Deuce" msgstr "Deux" # Translation #54387 (fr) #: po/raw.string:18 msgid "Aces" msgstr "d'As" # Translation #54388 (fr) #: po/raw.string:19 msgid "Kings" msgstr "de Roi" # Translation #54389 (fr) #: po/raw.string:20 msgid "Queens" msgstr "de Dame" # Translation #54390 (fr) #: po/raw.string:21 msgid "Jacks" msgstr "de Valet" # Translation #54391 (fr) #: po/raw.string:22 msgid "Tens" msgstr "de Dix" # Translation #54392 (fr) #: po/raw.string:23 msgid "Nines" msgstr "de Neuf" # Translation #54393 (fr) #: po/raw.string:24 msgid "Eights" msgstr "de Huit" # Translation #54394 (fr) #: po/raw.string:25 msgid "Sevens" msgstr "de Sept" # Translation #54395 (fr) #: po/raw.string:26 msgid "Sixes" msgstr "de Six" # Translation #54396 (fr) #: po/raw.string:27 msgid "Fives" msgstr "de Cinq" # Translation #54397 (fr) #: po/raw.string:28 msgid "Fours" msgstr "de Quatre" # Translation #54398 (fr) #: po/raw.string:29 msgid "Treys" msgstr "de Trois" # Translation #54399 (fr) #: po/raw.string:30 msgid "Deuces" msgstr "de Deux" poker-engine-1.3.6/po/Makefile.am0000644000175000017500000002762710562326452013522 00000000000000# Copyright (C) 2003-2006 Free Software Foundation, Inc. # This file is in the public domain. # # Makefile configuration - processed by automake. # List of files which contain translatable strings. POTFILES = \ pokerengine/pokergame.py \ po/raw.string # Usually the message domain is the same as the package name. DOMAIN = poker-engine # These options get passed to xgettext. XGETTEXT_OPTIONS = # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = http://www.pokersource.info # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = http://www.pokersource.info # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS = @POTFILES_DEPS@ # This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) POFILES = @POFILES@ # This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) GMOFILES = @GMOFILES@ # This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) UPDATEPOFILES = @UPDATEPOFILES@ # This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) DUMMYPOFILES = @DUMMYPOFILES@ # This is computed as # $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) CATALOGS = @CATALOGS@ SUFFIXES = .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all-local: all-local-@USE_NLS@ all-local-yes: stamp-po all-local-no: # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed if test -n '$(MSGID_BUGS_ADDRESS)'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ $(POTFILES) test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ else \ $(MAKE) $${lang}.po-create; \ fi install-data-local: install-data-local-@USE_NLS@ install-data-local-no: all-local install-data-local-yes: all-local $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done installdirs-local: installdirs-local-@USE_NLS@ installdirs-local-no: installdirs-local-yes: $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done uninstall-local: uninstall-local-@USE_NLS@ uninstall-local-no: uninstall-local-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done html ID: MOSTLYCLEANFILES = MOSTLYCLEANFILES += remove-potcdate.sed MOSTLYCLEANFILES += stamp-poT MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po MOSTLYCLEANFILES += *.o DISTCLEANFILES = *.mo stamp-po MAINTAINERCLEANFILES = stamp-po $(GMOFILES) EXTRA_DIST = remove-potcdate.sin LINGUAS $(POFILES) $(GMOFILES) # Hidden from automake, but really activated. Works around an automake-1.5 bug. #distdir: distdir1 distdir1: $(MAKE) update-po if test -f $(srcdir)/$(DOMAIN).pot; then \ for file in $(DOMAIN).pot stamp-po; do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ cp -p $$d/$$file $(distdir)/$$file || exit 1; \ done; \ fi update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: poker-engine-1.3.6/po/es.po0000644000175000017500000002276211540702111012413 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #56066 (es) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s muestra %(value)s para %(side)s" # Translation #56075 (es) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s esconde la mano perdedora" # Translation #56076 (es) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "gana %(side)s" # Translation #56078 (es) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "los ganadores comparten el bote de %(pot)s" # Translation #56086 (es) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(menos %(chips_left)d fichas restantes)" # Translation #56107 (es) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s recibe %(amount)s" # Translation #56113 (es) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "mano #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #56121 (es) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s espera para" # Translation #56123 (es) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d jugadores" # Translation #56129 (es) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Resumen: %(board)s" # Translation #56133 (es) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "cartas de %(name)s: %(card)s" # Translation #56141 (es) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Resumen: %(cards)s" # Translation #56146 (es) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cartas de %(name)s: %(cards)s" # Translation #56164 (es) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "comisión %(amount)s" # Translation #56327 (es) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "y %(dead)d de dinero donado" # Translation #56343 (es) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s paga %(amount)s de blind%(deadmsg)s" # Translation #56397 (es) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s paga %(amount)s de ante" # Translation #56399 (es) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s va all in" # Translation #56414 (es) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s sigue a %(amount)s" # Translation #56418 (es) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s pasa" # Translation #56423 (es) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s se retira" # Translation #56428 (es) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s sube a %(amount)s" # Translation #56435 (es) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s devuelto a %(name)s)" # Translation #56436 (es) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "turno anulado%(message)s" # Translation #56441 (es) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s recibe %(amount)s (todos los otros jugadores se retiran)" # Translation #56446 (es) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s recibe %(amount)d (fichas restantes)" # Translation #56453 (es) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "devolución de %(amount)s à %(name)s (apuesta no seguida)" # Translation #56454 (es) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s se levanta" # Translation #56468 (es) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "Escalera A2345" # Translation #56471 (es) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "carta alta %(card)s" # Translation #56475 (es) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Par de %(card)s" # Translation #56482 (es) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #56484 (es) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Doble pareja de %(card1)s y %(card2)s" # Translation #56486 (es) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Trio de %(card)s" # Translation #56487 (es) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Escalera de %(card1)s a %(card2)s" # Translation #56497 (es) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Color a %(card)s" # Translation #56500 (es) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "Full de %(card1)ss con %(card2)ss" # Translation #56504 (es) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Poker de %(card)s" # Translation #56509 (es) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Escalera real" # Translation #56512 (es) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Escalera de color al %(card)s" # Translation #56513 (es) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Par de %(card)s" # Translation #56518 (es) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Doble pareja de %(card1)s y %(card2)s" # Translation #56525 (es) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Trio de %(card)s" # Translation #56528 (es) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Escalera al %(card)s" # Translation #56531 (es) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Poker %(card)s" # Translation #56534 (es) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Escalera de color" # Translation #56536 (es) #: po/raw.string:1 msgid "hi" msgstr "Mano más alta" # Translation #56538 (es) #: po/raw.string:2 msgid "low" msgstr "Mano más baja" # Translation #56548 (es) #: po/raw.string:4 msgid "Ace" msgstr "As" # Translation #56549 (es) #: po/raw.string:5 msgid "King" msgstr "Rey" # Translation #56550 (es) #: po/raw.string:6 msgid "Queen" msgstr "Reina" # Translation #56564 (es) #: po/raw.string:7 msgid "Jack" msgstr "Jota" # Translation #56565 (es) #: po/raw.string:8 msgid "Ten" msgstr "Diez" # Translation #56566 (es) #: po/raw.string:9 msgid "Nine" msgstr "Nueve" # Translation #56567 (es) #: po/raw.string:10 msgid "Eight" msgstr "Ocho" # Translation #56568 (es) #: po/raw.string:11 msgid "Seven" msgstr "Siete" # Translation #56569 (es) #: po/raw.string:12 msgid "Six" msgstr "Seis" # Translation #56571 (es) #: po/raw.string:13 msgid "Five" msgstr "Cinco" # Translation #56572 (es) #: po/raw.string:14 msgid "Four" msgstr "Cuatro" # Translation #56573 (es) #: po/raw.string:15 msgid "Trey" msgstr "Tres" # Translation #56574 (es) #: po/raw.string:16 msgid "Deuce" msgstr "Dos" # Translation #56575 (es) #: po/raw.string:18 msgid "Aces" msgstr "Ases" # Translation #56576 (es) #: po/raw.string:19 msgid "Kings" msgstr "Reyes" # Translation #56578 (es) #: po/raw.string:20 msgid "Queens" msgstr "Reinas" # Translation #56581 (es) #: po/raw.string:21 msgid "Jacks" msgstr "Jotas" # Translation #56582 (es) #: po/raw.string:22 msgid "Tens" msgstr "Dieces" # Translation #56583 (es) #: po/raw.string:23 msgid "Nines" msgstr "Nueves" # Translation #56584 (es) #: po/raw.string:24 msgid "Eights" msgstr "Ochos" # Translation #56586 (es) #: po/raw.string:25 msgid "Sevens" msgstr "Sietes" # Translation #56587 (es) #: po/raw.string:26 msgid "Sixes" msgstr "Seises" # Translation #56588 (es) #: po/raw.string:27 msgid "Fives" msgstr "Cincos" # Translation #56589 (es) #: po/raw.string:28 msgid "Fours" msgstr "Cuatros" # Translation #56590 (es) #: po/raw.string:29 msgid "Treys" msgstr "Treses" # Translation #56591 (es) #: po/raw.string:30 msgid "Deuces" msgstr "Doses" poker-engine-1.3.6/po/pt.gmo0000644000175000017500000001042711540702122012570 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { š + K e t … ™ ¹ /Ù  ," O Aj ¬ #¾ â ô  1Nlqx}ƒ‰¤«»Ã×Þæêïôú )9>D Yejpuz#“·Æãçíô  9A{Š;šÖ'ï(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:31+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; Full de %(card1)ss e %(card2)ss%(name)s calls %(amount)s%(name)s passa%(name)s desiste%(name)s vai all-in%(name)s elimina mão perdedora%(name)s paga %(amount)s d'ante%(name)s paga %(amount)s da casadela%(deadmsg)s%(name)s sobe %(amount)s%(name)s recebe %(amount)d (fichas em sobra)%(name)s recebe %(amount)s%(name)s recebe %(amount)s (todos os outros jogadores desistiram)%(name)s sits out%(name)s, %(len_pockets)d jogadores, %(card)s kickerPar de %(card)sÃsAsesQuadro: %(board)sQuadro: %(cards)sCartas de %(name)s: %(card)sCartas de %(name)s: %(cards)sDoisDuquesOitoOitosCincoCincosFlush %(card)s altoQuatroQuadra %(card)sQuatrosCarta alta %(card)sValeteValetesReiReisNoveNovesPar de %(card)sPares de %(card1)s e %(card2)sQuadra %(card)sDamaDamasComissão %(amount)sRoyal flushSeteSetesSeisSeisSequência %(card)s altaSequência de %(card1)s a %(card2)sStraight flushStraight flush %(card)s altoDezDezesA rodaTrinca %(card)sTrêsTrêsTrinca %(card)sDois pares %(card1)s e %(card2)smão #%(hand_serial)d, %(variant)s, %(betting_structure)sMão mais altaMão mais baixadevolução de %(amount)s a %(name)s (aposta não igualada)turno anulado%(message)sVencedores partilham um pote de %(pot)spoker-engine-1.3.6/po/de.po0000644000175000017500000002271611540702110012372 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2010-02-12 17:02+0100\n" "Last-Translator: Lord Byron \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #55533 (de) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s zeigt %(value)s für %(side)s" # Translation #55535 (de) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s verbirgt Verlierer-Hand" # Translation #55536 (de) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "gewinnt %(side)s" # Translation #55537 (de) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "Gewinner teilen einen Pot von %(pot)s" # Translation #55538 (de) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d odd chips)" # Translation #55539 (de) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s bekommt %(amount)s" # Translation #55540 (de) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "Hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #55541 (de) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s warten auf" # Translation #55542 (de) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d Spieler" # Translation #55543 (de) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Board: %(board)s" # Translation #55544 (de) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Karten Spieler %(name)s: %(card)s" # Translation #55545 (de) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Board: %(cards)s" # Translation #55546 (de) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Karten Spieler %(name)s: %(cards)s" # Translation #55547 (de) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Einsatz %(amount)s" # Translation #55548 (de) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "und %(dead)d dead" # Translation #55552 (de) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s zahlt %(amount)s blind %(deadmsg)s" # Translation #55553 (de) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s zahlt %(amount)s ante" # Translation #55554 (de) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s ist all in" # Translation #55555 (de) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s geht mit %(amount)s" # Translation #55556 (de) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s passt" # Translation #55557 (de) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s passt" # Translation #55558 (de) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s erhöht %(amount)s" # Translation #55559 (de) #: pokerengine/pokergame.py:431 #, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s gehen zurück an %(name)s)" # Translation #55560 (de) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "Turnier abgesagt %(message)s" # Translation #55563 (de) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s bekommt%(amount)s (alle anderen haben gepasst)" # Translation #55566 (de) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s bekommt %(amount)d übrig gebliebene Chips" # Translation #55569 (de) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "Nicht mitgegangener Einsatz %(amount)s an %(name)s zurückgegeben" # Translation #55570 (de) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s setzt aus" # Translation #55571 (de) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "Wheel" # Translation #55572 (de) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Hohe Karte %(card)s" # Translation #55573 (de) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Ein Paar %(card)s" # Translation #55574 (de) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s Kicker" # Translation #55575 (de) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Zwei Paar %(card1)s und %(card2)s" # Translation #55580 (de) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Drilling %(card)s Karten" # Translation #55581 (de) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straße %(card1)s zu %(card2)s" # Translation #55582 (de) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s hoch" # Translation #55583 (de) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "Full House, %(card1)s und %(card2)s" # Translation #55584 (de) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Vierling %(card)s" # Translation #55585 (de) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal Flush" # Translation #55586 (de) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight Flush %(card)s hoch" # Translation #55587 (de) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Paar %(card)s" # Translation #55588 (de) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Zwei Paare, %(card1)s und %(card2)s" # Translation #55589 (de) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Drilling %(card)s" # Translation #55590 (de) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straight %(card)s hoch" # Translation #55591 (de) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Quads %(card)s" # Translation #55592 (de) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight Flush" # Translation #55593 (de) #: po/raw.string:1 msgid "hi" msgstr "hoch" # Translation #55594 (de) #: po/raw.string:2 msgid "low" msgstr "niedrig" # Translation #55595 (de) #: po/raw.string:4 msgid "Ace" msgstr "Ass" # Translation #55596 (de) #: po/raw.string:5 msgid "King" msgstr "König" # Translation #55597 (de) #: po/raw.string:6 msgid "Queen" msgstr "Dame" # Translation #55598 (de) #: po/raw.string:7 msgid "Jack" msgstr "Bube" # Translation #55599 (de) #: po/raw.string:8 msgid "Ten" msgstr "Zehn" # Translation #55600 (de) #: po/raw.string:9 msgid "Nine" msgstr "Neun" # Translation #55601 (de) #: po/raw.string:10 msgid "Eight" msgstr "Acht" # Translation #55602 (de) #: po/raw.string:11 msgid "Seven" msgstr "Sieben" # Translation #55603 (de) #: po/raw.string:12 msgid "Six" msgstr "Sechs" # Translation #55604 (de) #: po/raw.string:13 msgid "Five" msgstr "Fünf" # Translation #55605 (de) #: po/raw.string:14 msgid "Four" msgstr "Vier" # Translation #55606 (de) #: po/raw.string:15 msgid "Trey" msgstr "Drei" # Translation #55607 (de) #: po/raw.string:16 msgid "Deuce" msgstr "Zwei" # Translation #55608 (de) #: po/raw.string:18 msgid "Aces" msgstr "Asse" # Translation #55609 (de) #: po/raw.string:19 msgid "Kings" msgstr "Könige" # Translation #55610 (de) #: po/raw.string:20 msgid "Queens" msgstr "Damen" # Translation #55611 (de) #: po/raw.string:21 msgid "Jacks" msgstr "Buben" # Translation #55612 (de) #: po/raw.string:22 msgid "Tens" msgstr "Zehner" # Translation #55613 (de) #: po/raw.string:23 msgid "Nines" msgstr "Neuner" # Translation #55615 (de) #: po/raw.string:24 msgid "Eights" msgstr "Achter" # Translation #55616 (de) #: po/raw.string:25 msgid "Sevens" msgstr "Siebener" # Translation #55618 (de) #: po/raw.string:26 msgid "Sixes" msgstr "Sechsen" # Translation #55619 (de) #: po/raw.string:27 msgid "Fives" msgstr "Fünfer" # Translation #55620 (de) #: po/raw.string:28 msgid "Fours" msgstr "Vierer" # Translation #55621 (de) #: po/raw.string:29 msgid "Treys" msgstr "Dreier" # Translation #55622 (de) #: po/raw.string:30 msgid "Deuces" msgstr "Zweier" poker-engine-1.3.6/po/remove-potcdate.sin0000644000175000017500000000066010562050353015255 00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } poker-engine-1.3.6/po/en_CA.po0000644000175000017500000002256211540702110012746 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #58366 (en) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s shows %(value)s for %(side)s" # Translation #58367 (en) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s mucks loosing hand" # Translation #58368 (en) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "wins %(side)s" # Translation #58369 (en) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "winners share a pot of %(pot)s" # Translation #58371 (en) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d odd chips)" # Translation #58372 (en) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s receives %(amount)s" # Translation #58373 (en) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #58374 (en) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s waiting for" # Translation #58375 (en) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d players" # Translation #58376 (en) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Board: %(board)s" # Translation #58377 (en) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cards player %(name)s: %(card)s" # Translation #58378 (en) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Board: %(cards)s" # Translation #58379 (en) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cards player %(name)s: %(cards)s" # Translation #58380 (en) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Rake %(amount)s" # Translation #58381 (en) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "and %(dead)d dead" # Translation #58382 (en) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s pays %(amount)s blind%(deadmsg)s" # Translation #58383 (en) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s pays %(amount)s ante" # Translation #58384 (en) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s is all in" # Translation #58385 (en) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s calls %(amount)s" # Translation #58386 (en) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s checks" # Translation #58387 (en) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s folds" # Translation #58388 (en) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s raises %(amount)s" # Translation #58389 (en) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s returned to %(name)s)" # Translation #58390 (en) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "turn canceled%(message)s" # Translation #58391 (en) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s receives %(amount)s (everyone else folded)" # Translation #58392 (en) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s receives %(amount)d odd chips" # Translation #58393 (en) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "returning uncalled bet %(amount)s to %(name)s" # Translation #58394 (en) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s sits out" # Translation #58395 (en) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "The wheel" # Translation #58396 (en) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "High card %(card)s" # Translation #58397 (en) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "A pair of %(card)s" # Translation #58398 (en) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #58399 (en) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Two pairs %(card1)s and %(card2)s" # Translation #58400 (en) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Three of a kind %(card)s" # Translation #58401 (en) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straight %(card1)s to %(card2)s" # Translation #58402 (en) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s high" # Translation #58403 (en) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss full of %(card2)ss" # Translation #58404 (en) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Four of a kind %(card)s" # Translation #58405 (en) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #58406 (en) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s high" # Translation #58407 (en) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Pair of %(card)s" # Translation #58408 (en) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Pairs of %(card1)s and %(card2)s" # Translation #58409 (en) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Trips %(card)s" # Translation #58410 (en) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straight %(card)s high" # Translation #58411 (en) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Quads %(card)s" # Translation #58412 (en) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight flush" # Translation #58413 (en) #: po/raw.string:1 msgid "hi" msgstr "hi" # Translation #58414 (en) #: po/raw.string:2 msgid "low" msgstr "low" # Translation #58415 (en) #: po/raw.string:4 msgid "Ace" msgstr "Ace" # Translation #58416 (en) #: po/raw.string:5 msgid "King" msgstr "King" # Translation #58417 (en) #: po/raw.string:6 msgid "Queen" msgstr "Queen" # Translation #58418 (en) #: po/raw.string:7 msgid "Jack" msgstr "Jack" # Translation #58419 (en) #: po/raw.string:8 msgid "Ten" msgstr "Ten" # Translation #58420 (en) #: po/raw.string:9 msgid "Nine" msgstr "Nine" # Translation #58421 (en) #: po/raw.string:10 msgid "Eight" msgstr "Eight" # Translation #58422 (en) #: po/raw.string:11 msgid "Seven" msgstr "Seven" # Translation #58423 (en) #: po/raw.string:12 msgid "Six" msgstr "Six" # Translation #58424 (en) #: po/raw.string:13 msgid "Five" msgstr "Five" # Translation #58425 (en) #: po/raw.string:14 msgid "Four" msgstr "Four" # Translation #58426 (en) #: po/raw.string:15 msgid "Trey" msgstr "Trey" # Translation #58427 (en) #: po/raw.string:16 msgid "Deuce" msgstr "Deuce" # Translation #58428 (en) #: po/raw.string:18 msgid "Aces" msgstr "Aces" # Translation #58429 (en) #: po/raw.string:19 msgid "Kings" msgstr "Kings" # Translation #58430 (en) #: po/raw.string:20 msgid "Queens" msgstr "Queens" # Translation #58431 (en) #: po/raw.string:21 msgid "Jacks" msgstr "Jacks" # Translation #58432 (en) #: po/raw.string:22 msgid "Tens" msgstr "Tens" # Translation #58433 (en) #: po/raw.string:23 msgid "Nines" msgstr "Nines" # Translation #58434 (en) #: po/raw.string:24 msgid "Eights" msgstr "Eights" # Translation #58435 (en) #: po/raw.string:25 msgid "Sevens" msgstr "Sevens" # Translation #58436 (en) #: po/raw.string:26 msgid "Sixes" msgstr "Sixes" # Translation #58437 (en) #: po/raw.string:27 msgid "Fives" msgstr "Fives" # Translation #58438 (en) #: po/raw.string:28 msgid "Fours" msgstr "Fours" # Translation #58439 (en) #: po/raw.string:29 msgid "Treys" msgstr "Treys" # Translation #58440 (en) #: po/raw.string:30 msgid "Deuces" msgstr "Deuces" poker-engine-1.3.6/po/fr_FX.po0000644000175000017500000002300111540702113012775 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" # Translation #54326 (fr) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s montre %(value)s comme %(side)s" # Translation #54327 (fr) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s se couche" # Translation #54328 (fr) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "gagne avec la %(side)s" # Translation #54329 (fr) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "les gagnants se partagent le pot de %(pot)s" # Translation #54330 (fr) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(moins %(chips_left)d restant)" # Translation #54331 (fr) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s reçoit %(amount)s" # Translation #54332 (fr) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "main #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #54333 (fr) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s attend pour" # Translation #54334 (fr) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d joueurs" # Translation #54335 (fr) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Tableau : %(board)s" # Translation #54336 (fr) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cartes de %(name)s : %(card)s" # Translation #54337 (fr) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Tableau : %(cards)s" # Translation #54338 (fr) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cartes de %(name)s : %(cards)s" # Translation #54339 (fr) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Commission %(amount)s" # Translation #54340 (fr) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "et %(dead)d d'argent mort" # Translation #54341 (fr) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s paye %(amount)s de blind%(deadmsg)s" # Translation #54342 (fr) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s paye %(amount)s d'ante" # Translation #54343 (fr) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s fais tapis" # Translation #54344 (fr) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s suit %(amount)s" # Translation #54345 (fr) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s passe" # Translation #54346 (fr) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s se couche" # Translation #54347 (fr) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s relance de %(amount)s" # Translation #54348 (fr) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s redonné à %(name)s)" # Translation #54349 (fr) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "tour annulé%(message)s" # Translation #54350 (fr) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s reçoit %(amount)s (les autres joueurs se sont couchés)" # Translation #54351 (fr) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s recoit %(amount)d (rocks restants)" # Translation #54352 (fr) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "retour de %(amount)s à %(name)s (mise non-suivie)" # Translation #54353 (fr) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s se lève" # Translation #54354 (fr) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "La roue" # Translation #54355 (fr) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Carte haute %(card)s" # Translation #54356 (fr) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Paire %(card)s" # Translation #54357 (fr) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s pour kicker" # Translation #54358 (fr) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Double paire : paire %(card1)s et paire %(card2)s" # Translation #54359 (fr) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Brelan %(card)s" # Translation #54360 (fr) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Suite, %(card1)s à %(card2)s" # Translation #54361 (fr) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Couleur, hauteur %(card)s" # Translation #54362 (fr) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "Full aux %(card1)s par les %(card2)s" # Translation #54363 (fr) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Carré %(card)s" # Translation #54364 (fr) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Quinte flush royale" # Translation #54365 (fr) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Suite, hauteur %(card)s" # Translation #54366 (fr) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Paire %(card)s" # Translation #54367 (fr) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Double paire : paire %(card1)s et paire %(card2)s" # Translation #54368 (fr) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Brelan %(card)s" # Translation #54369 (fr) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Suite, hauteur %(card)s" # Translation #54370 (fr) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Carré %(card)s" # Translation #54371 (fr) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Quinte flush" # Translation #54372 (fr) #: po/raw.string:1 msgid "hi" msgstr "main la plus haute" # Translation #54373 (fr) #: po/raw.string:2 msgid "low" msgstr "main la plus basse" # Translation #54374 (fr) #: po/raw.string:4 msgid "Ace" msgstr "As" # Translation #54375 (fr) #: po/raw.string:5 msgid "King" msgstr "Roi" # Translation #54376 (fr) #: po/raw.string:6 msgid "Queen" msgstr "Dame" # Translation #54377 (fr) #: po/raw.string:7 msgid "Jack" msgstr "Valet" # Translation #54378 (fr) #: po/raw.string:8 msgid "Ten" msgstr "Dix" # Translation #54379 (fr) #: po/raw.string:9 msgid "Nine" msgstr "Neuf" # Translation #54380 (fr) #: po/raw.string:10 msgid "Eight" msgstr "Huit" # Translation #54381 (fr) #: po/raw.string:11 msgid "Seven" msgstr "Sept" # Translation #54382 (fr) #: po/raw.string:12 msgid "Six" msgstr "Six" # Translation #54383 (fr) #: po/raw.string:13 msgid "Five" msgstr "Cinq" # Translation #54384 (fr) #: po/raw.string:14 msgid "Four" msgstr "Quatre" # Translation #54385 (fr) #: po/raw.string:15 msgid "Trey" msgstr "Trois" # Translation #54386 (fr) #: po/raw.string:16 msgid "Deuce" msgstr "Deux" # Translation #54387 (fr) #: po/raw.string:18 msgid "Aces" msgstr "d'As" # Translation #54388 (fr) #: po/raw.string:19 msgid "Kings" msgstr "de Roi" # Translation #54389 (fr) #: po/raw.string:20 msgid "Queens" msgstr "de Dame" # Translation #54390 (fr) #: po/raw.string:21 msgid "Jacks" msgstr "de Valet" # Translation #54391 (fr) #: po/raw.string:22 msgid "Tens" msgstr "de Dix" # Translation #54392 (fr) #: po/raw.string:23 msgid "Nines" msgstr "de Neuf" # Translation #54393 (fr) #: po/raw.string:24 msgid "Eights" msgstr "de Huit" # Translation #54394 (fr) #: po/raw.string:25 msgid "Sevens" msgstr "de Sept" # Translation #54395 (fr) #: po/raw.string:26 msgid "Sixes" msgstr "de Six" # Translation #54396 (fr) #: po/raw.string:27 msgid "Fives" msgstr "de Cinq" # Translation #54397 (fr) #: po/raw.string:28 msgid "Fours" msgstr "de Quatre" # Translation #54398 (fr) #: po/raw.string:29 msgid "Treys" msgstr "de Trois" # Translation #54399 (fr) #: po/raw.string:30 msgid "Deuces" msgstr "de Deux" poker-engine-1.3.6/po/en_US.gmo0000644000175000017500000001032411540702117013156 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { š + I c s ‚ • ± )Ï ù & ; 3X Œ !ž À Ò å é î ÿ  0QW^dkpvЧ­ÀÅËÐÖÛá ò"(/ ?KQX\by™¨ÅÉ ÎØñöü! 9-gj-nœµ(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)spoker-engine-1.3.6/po/it.gmo0000644000175000017500000001042011540702121012551 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { š + I b y ˆ › » +Û  +$ P 1k  #® Ò ä ÷ ü #?\`dinu|’š¬´ÎÓØÛÞãè'û#5;A Xdjptx®¾Ýãéò &9C } ‡2’Å/à(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss full di %(card2)ss%(name)s vede %(amount)s%(name)s bussa (check)%(name)s passa%(name)s va all in%(name)s mucks la mano perdente%(name)s paga %(amount)s l'ante%(name)s paga %(amount)s il buio%(deadmsg)s%(name)s rilancia %(amount)s%(name)s riceve %(amount)d (chips restanti)%(name)s riceve %(amount)s%(name)s riceve %(amount)s (everyone else folded)%(name)s si alza%(name)s, %(len_pockets)d giocatori, %(card)s kickerCoppia di %(card)sAssoAssiBoard: %(board)sBoard: %(cards)sCarte di %(name)s: %(card)sCarte di %(name)s: %(cards)sDueDueOttoOttoCinqueCinqueColore, %(card)s alteQuattroPoker di %(card)sQuattroCarta più alta: %(card)sJackJackReReNoveNoveCoppia di %(card)sDoppia coppia di %(card1)s e %(card2)sPoker di %(card)sDonnaDonneCommissione %(amount)sScala realeSetteSetteSeiSeiScala di %(card)s alteScala da %(card1)s a %(card2)sScala di coloreScala di colore, %(card)s alteDieciDieciLa ruotaTris di %(card)sTreTreTris di %(card)sDoppia coppia di %(card1)s e %(card2)smano #%(hand_serial)d, %(variant)s, %(betting_structure)smano altamano bassapuntata non chiamata %(amount)s ritorna a %(name)sturno annullato%(message)si vincitori si spartiscono un piatto di %(pot)spoker-engine-1.3.6/po/fr.po0000644000175000017500000002370211540702112012407 00000000000000# translation of fr.po to # translation of poker2d.po to # French translations for pokerclient package. # Copyright (C) 2006 THE pokerclient'S COPYRIGHT HOLDER # This file is distributed under the same license as the pokerclient package. # # griim , 2006. # Johan Euphrosine , 2008. # Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" # Translation #54326 (fr) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s montre %(value)s comme %(side)s" # Translation #54327 (fr) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s se couche" # Translation #54328 (fr) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "gagne avec la %(side)s" # Translation #54329 (fr) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "les gagnants se partagent le pot de %(pot)s" # Translation #54330 (fr) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(moins %(chips_left)d restant)" # Translation #54331 (fr) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s reçoit %(amount)s" # Translation #54332 (fr) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "main #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #54333 (fr) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s attend pour" # Translation #54334 (fr) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d joueurs" # Translation #54335 (fr) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Tableau : %(board)s" # Translation #54336 (fr) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cartes de %(name)s : %(card)s" # Translation #54337 (fr) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Tableau : %(cards)s" # Translation #54338 (fr) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cartes de %(name)s : %(cards)s" # Translation #54339 (fr) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Commission %(amount)s" # Translation #54340 (fr) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "et %(dead)d d'argent mort" # Translation #54341 (fr) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s paye %(amount)s de blind%(deadmsg)s" # Translation #54342 (fr) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s paye %(amount)s d'ante" # Translation #54343 (fr) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s fais tapis" # Translation #54344 (fr) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s suit %(amount)s" # Translation #54345 (fr) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s passe" # Translation #54346 (fr) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s se couche" # Translation #54347 (fr) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s relance de %(amount)s" # Translation #54348 (fr) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s redonné à %(name)s)" # Translation #54349 (fr) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "tour annulé%(message)s" # Translation #54350 (fr) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s reçoit %(amount)s (les autres joueurs se sont couchés)" # Translation #54351 (fr) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s recoit %(amount)d (rocks restants)" # Translation #54352 (fr) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "retour de %(amount)s à %(name)s (mise non-suivie)" # Translation #54353 (fr) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s se lève" # Translation #54354 (fr) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "La roue" # Translation #54355 (fr) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Carte haute %(card)s" # Translation #54356 (fr) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Paire %(card)s" # Translation #54357 (fr) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s pour kicker" # Translation #54358 (fr) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Double paire : paire %(card1)s et paire %(card2)s" # Translation #54359 (fr) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Brelan %(card)s" # Translation #54360 (fr) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Suite, %(card1)s à %(card2)s" # Translation #54361 (fr) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Couleur, hauteur %(card)s" # Translation #54362 (fr) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "Full aux %(card1)s par les %(card2)s" # Translation #54363 (fr) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Carré %(card)s" # Translation #54364 (fr) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Quinte flush royale" # Translation #54365 (fr) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Suite, hauteur %(card)s" # Translation #54366 (fr) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Paire %(card)s" # Translation #54367 (fr) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Double paire : paire %(card1)s et paire %(card2)s" # Translation #54368 (fr) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Brelan %(card)s" # Translation #54369 (fr) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Suite, hauteur %(card)s" # Translation #54370 (fr) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Carré %(card)s" # Translation #54371 (fr) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Quinte flush" # Translation #54372 (fr) #: po/raw.string:1 msgid "hi" msgstr "main la plus haute" # Translation #54373 (fr) #: po/raw.string:2 msgid "low" msgstr "main la plus basse" # Translation #54374 (fr) #: po/raw.string:4 msgid "Ace" msgstr "As" # Translation #54375 (fr) #: po/raw.string:5 msgid "King" msgstr "Roi" # Translation #54376 (fr) #: po/raw.string:6 msgid "Queen" msgstr "Dame" # Translation #54377 (fr) #: po/raw.string:7 msgid "Jack" msgstr "Valet" # Translation #54378 (fr) #: po/raw.string:8 msgid "Ten" msgstr "Dix" # Translation #54379 (fr) #: po/raw.string:9 msgid "Nine" msgstr "Neuf" # Translation #54380 (fr) #: po/raw.string:10 msgid "Eight" msgstr "Huit" # Translation #54381 (fr) #: po/raw.string:11 msgid "Seven" msgstr "Sept" # Translation #54382 (fr) #: po/raw.string:12 msgid "Six" msgstr "Six" # Translation #54383 (fr) #: po/raw.string:13 msgid "Five" msgstr "Cinq" # Translation #54384 (fr) #: po/raw.string:14 msgid "Four" msgstr "Quatre" # Translation #54385 (fr) #: po/raw.string:15 msgid "Trey" msgstr "Trois" # Translation #54386 (fr) #: po/raw.string:16 msgid "Deuce" msgstr "Deux" # Translation #54387 (fr) #: po/raw.string:18 msgid "Aces" msgstr "d'As" # Translation #54388 (fr) #: po/raw.string:19 msgid "Kings" msgstr "de Roi" # Translation #54389 (fr) #: po/raw.string:20 msgid "Queens" msgstr "de Dame" # Translation #54390 (fr) #: po/raw.string:21 msgid "Jacks" msgstr "de Valet" # Translation #54391 (fr) #: po/raw.string:22 msgid "Tens" msgstr "de Dix" # Translation #54392 (fr) #: po/raw.string:23 msgid "Nines" msgstr "de Neuf" # Translation #54393 (fr) #: po/raw.string:24 msgid "Eights" msgstr "de Huit" # Translation #54394 (fr) #: po/raw.string:25 msgid "Sevens" msgstr "de Sept" # Translation #54395 (fr) #: po/raw.string:26 msgid "Sixes" msgstr "de Six" # Translation #54396 (fr) #: po/raw.string:27 msgid "Fives" msgstr "de Cinq" # Translation #54397 (fr) #: po/raw.string:28 msgid "Fours" msgstr "de Quatre" # Translation #54398 (fr) #: po/raw.string:29 msgid "Treys" msgstr "de Trois" # Translation #54399 (fr) #: po/raw.string:30 msgid "Deuces" msgstr "de Deux" # Translation #51216 (fr) #~ msgid "Full house, %(card1)s over %(card2)s" #~ msgstr "Full aux %(card1)s par les %(card2)s" poker-engine-1.3.6/po/fr_CA.gmo0000644000175000017500000001052111540702120013110 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { Žš $) N g v ‰  ° ,Ð ý + H Ad ¦ !¸ Ú ñ 0Nmrz‡Œ”®µ ÅÏäêó÷þ 1L\ai“˜ ¤«Ã áî )/81H9z´Ç2Ú +%(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n>1; Full aux %(card1)s par les %(card2)s%(name)s suit %(amount)s%(name)s passe%(name)s se couche%(name)s fais tapis%(name)s se couche%(name)s paye %(amount)s d'ante%(name)s paye %(amount)s de blind%(deadmsg)s%(name)s relance de %(amount)s%(name)s recoit %(amount)d (rocks restants)%(name)s reçoit %(amount)s%(name)s reçoit %(amount)s (les autres joueurs se sont couchés)%(name)s se lève%(name)s, %(len_pockets)d joueurs, %(card)s pour kickerPaire %(card)sAsd'AsTableau : %(board)sTableau : %(cards)sCartes de %(name)s : %(card)sCartes de %(name)s : %(cards)sDeuxde DeuxHuitde HuitCinqde CinqCouleur, hauteur %(card)sQuatreCarré %(card)sde QuatreCarte haute %(card)sValetde ValetRoide RoiNeufde NeufPaire %(card)sDouble paire : paire %(card1)s et paire %(card2)sCarré %(card)sDamede DameCommission %(amount)sQuinte flush royaleSeptde SeptSixde SixSuite, hauteur %(card)sSuite, %(card1)s à %(card2)sQuinte flushSuite, hauteur %(card)sDixde DixLa roueBrelan %(card)sTroisde TroisBrelan %(card)sDouble paire : paire %(card1)s et paire %(card2)smain #%(hand_serial)d, %(variant)s, %(betting_structure)smain la plus hautemain la plus basseretour de %(amount)s à %(name)s (mise non-suivie)tour annulé%(message)sles gagnants se partagent le pot de %(pot)spoker-engine-1.3.6/po/nb.gmo0000644000175000017500000001023511540702121012540 00000000000000Þ•D<a\àáÿ)8Kg)…¯&Êñ3B!Tvˆ›Ÿ¤µÆ æ !&,@E]chnsy~„ •¶ÅËÒ âîôûÿ  < K h l q { ” ™ Ÿ !® 9Ð   - ? X w  & A Q a t “ ,´ á +ü ( (A j "~ ¡ ³ à Ç Ë Ü í .17=EIQej}„Š’˜Ÿ¢¨¸Õèíó "'/ Fgv“–œ£µ¹ÀÒ9ð*//3c!{'; 2 7 "?@>.0B$)9* % &A/(1C -536,+4D=:8<!#%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:31+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss full av %(card2)ss%(name)s caller %(amount)s%(name)s checks%(name)s folder%(name)s er all in%(name)s skjuler tapende hÃ¥nd%(name)s betaler %(amount)s ante%(name)s betaler %(amount)s blind%(deadmsg)s%(name)s raiser %(amount)s%(name)s fÃ¥r %(amount)d gjenværende chips%(name)s fÃ¥r %(amount)s%(name)s fÃ¥r %(amount)s (resten foldet)%(name)s stÃ¥r over%(name)s, %(len_pockets)d spillere, %(card)s kickerEt par %(card)sEssEssBoard: %(board)sBoard: %(cards)sKort spiller %(name)s: %(card)sKort spiller %(name)s: %(cards)sToToereÃ…tteÃ…ttereFemFemmereFlush %(card)s høyFireFire like %(card)sFirereKnektKnekterKongeKongerNiNierePair i %(card)sPar i %(card1)s og %(card2)sFire like %(card)sDameDamerSpilleavgift %(amount)sRoyal flushSjuSjuereSeksSeksereStraight %(card)s høyStraight %(card1)s til %(card2)sStraight flushStraight flush %(card)s høyTiTiereHjuletTre like %(card)sTreTreereTre like %(card)sTo par %(card1)s og %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shøylavreturnerer uncalled bet %(amount)s til %(name)sRunde avlyst%(message)svinnere deler en pott pÃ¥ %(pot)spoker-engine-1.3.6/po/it.po0000644000175000017500000002266011540702113012417 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #56163 (it) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s mostra %(value)s per %(side)s" # Translation #56167 (it) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s mucks la mano perdente" # Translation #56168 (it) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "vince %(side)s" # Translation #56171 (it) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "i vincitori si spartiscono un piatto di %(pot)s" # Translation #56177 (it) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(meno %(chips_left)d chips restanti)" # Translation #56190 (it) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s riceve %(amount)s" # Translation #56408 (it) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "mano #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #56411 (it) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s aspetta per" # Translation #56413 (it) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d giocatori" # Translation #56416 (it) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Board: %(board)s" # Translation #56420 (it) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Carte di %(name)s: %(card)s" # Translation #56422 (it) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Board: %(cards)s" # Translation #56424 (it) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Carte di %(name)s: %(cards)s" # Translation #56437 (it) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Commissione %(amount)s" # Translation #56448 (it) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "e %(dead)d dead" # Translation #56450 (it) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s paga %(amount)s il buio%(deadmsg)s" # Translation #56452 (it) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s paga %(amount)s l'ante" # Translation #56456 (it) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s va all in" # Translation #56458 (it) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s vede %(amount)s" # Translation #56459 (it) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s bussa (check)" # Translation #56463 (it) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s passa" # Translation #56466 (it) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s rilancia %(amount)s" # Translation #56474 (it) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s tornati a %(name)s)" # Translation #56476 (it) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "turno annullato%(message)s" # Translation #56477 (it) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s riceve %(amount)s (everyone else folded)" # Translation #56494 (it) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s riceve %(amount)d (chips restanti)" # Translation #56501 (it) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "puntata non chiamata %(amount)s ritorna a %(name)s" # Translation #56502 (it) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s si alza" # Translation #56505 (it) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "La ruota" # Translation #56507 (it) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Carta più alta: %(card)s" # Translation #56522 (it) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Coppia di %(card)s" # Translation #56526 (it) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #56527 (it) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Doppia coppia di %(card1)s e %(card2)s" # Translation #56529 (it) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Tris di %(card)s" # Translation #56533 (it) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Scala da %(card1)s a %(card2)s" # Translation #56539 (it) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Colore, %(card)s alte" # Translation #56540 (it) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss full di %(card2)ss" # Translation #56543 (it) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Poker di %(card)s" # Translation #56545 (it) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Scala reale" # Translation #57264 (it) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Scala di colore, %(card)s alte" # Translation #57265 (it) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Coppia di %(card)s" # Translation #57266 (it) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Doppia coppia di %(card1)s e %(card2)s" # Translation #57267 (it) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Tris di %(card)s" # Translation #57268 (it) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Scala di %(card)s alte" # Translation #57269 (it) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Poker di %(card)s" # Translation #57270 (it) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Scala di colore" # Translation #57271 (it) #: po/raw.string:1 msgid "hi" msgstr "mano alta" # Translation #57272 (it) #: po/raw.string:2 msgid "low" msgstr "mano bassa" # Translation #57273 (it) #: po/raw.string:4 msgid "Ace" msgstr "Asso" # Translation #57274 (it) #: po/raw.string:5 msgid "King" msgstr "Re" # Translation #57275 (it) #: po/raw.string:6 msgid "Queen" msgstr "Donna" # Translation #57276 (it) #: po/raw.string:7 msgid "Jack" msgstr "Jack" # Translation #57277 (it) #: po/raw.string:8 msgid "Ten" msgstr "Dieci" # Translation #57278 (it) #: po/raw.string:9 msgid "Nine" msgstr "Nove" # Translation #57279 (it) #: po/raw.string:10 msgid "Eight" msgstr "Otto" # Translation #57280 (it) #: po/raw.string:11 msgid "Seven" msgstr "Sette" # Translation #57281 (it) #: po/raw.string:12 msgid "Six" msgstr "Sei" # Translation #57282 (it) #: po/raw.string:13 msgid "Five" msgstr "Cinque" # Translation #57283 (it) #: po/raw.string:14 msgid "Four" msgstr "Quattro" # Translation #57284 (it) #: po/raw.string:15 msgid "Trey" msgstr "Tre" # Translation #57285 (it) #: po/raw.string:16 msgid "Deuce" msgstr "Due" # Translation #57286 (it) #: po/raw.string:18 msgid "Aces" msgstr "Assi" # Translation #57287 (it) #: po/raw.string:19 msgid "Kings" msgstr "Re" # Translation #57288 (it) #: po/raw.string:20 msgid "Queens" msgstr "Donne" # Translation #57289 (it) #: po/raw.string:21 msgid "Jacks" msgstr "Jack" # Translation #57290 (it) #: po/raw.string:22 msgid "Tens" msgstr "Dieci" # Translation #57291 (it) #: po/raw.string:23 msgid "Nines" msgstr "Nove" # Translation #57292 (it) #: po/raw.string:24 msgid "Eights" msgstr "Otto" # Translation #57293 (it) #: po/raw.string:25 msgid "Sevens" msgstr "Sette" # Translation #57294 (it) #: po/raw.string:26 msgid "Sixes" msgstr "Sei" # Translation #57295 (it) #: po/raw.string:27 msgid "Fives" msgstr "Cinque" # Translation #57296 (it) #: po/raw.string:28 msgid "Fours" msgstr "Quattro" # Translation #57297 (it) #: po/raw.string:29 msgid "Treys" msgstr "Tre" # Translation #57298 (it) #: po/raw.string:30 msgid "Deuces" msgstr "Due" poker-engine-1.3.6/po/nl.gmo0000644000175000017500000000761311540702122012561 00000000000000Þ•@Y€Ÿ¹ÉØë) 3&Nu3’Æ!Øú #(9Y_flsx~’—¯µÈÍÓØÞãéú  &28?CI`oŒ •Ÿ¸½Ã!Ò9ô. 1 -5 c | › , K e t ‚ — ,¸ å - 0 9M ‡ !™ » Í ã ç ì ü   ( - 4 9 @ T Y i p ƒ ˆ  – Ÿ ¥ ¬ ¾ Í Ö â ÿ  #8Gdipx‘–ž ­9Î 9L%e3&*!/%6<=:78'>501 9#? "2($ - .) ;@ +,4%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sCards player %(name)s: %(card)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:31+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss full van %(card2)ss%(name)s callt %(amount)s%(name)s volgt%(name)s past%(name)s gaat all-in%(name)s betaalt %(amount)s ante%(name)s betaalt %(amount)s blind%(deadmsg)s%(name)s verhoogt %(amount)s%(name)s ontvangt %(amount)d resterende chips%(name)s ontvangt %(amount)s%(name)s ontvangt %(amount)s (alle anderen hebben gepast)%(name)s staat op%(name)s, %(len_pockets)d spelers, %(card)s kickerEen paar van %(card)sAasAzenBord: %(board)sKaarten van %(name)s: %(card)sTweeTweeënAchtAchtenVijfVijfenFlush %(card)s hoogVierCarré %(card)sVierenHigh card %(card)sBoerBoerenKoningKoningenNegenNegensPaar van %(card)sQuads %(card)sKoninginKoninginnenInschrijvingsgeld %(amount)sRoyal flushZevenZevensZesZessenStraat %(card)s hoogStraight flushStraight flush %(card)s hoogTienTienenHet radThree of a kind %(card)sDrieDrieënTrips %(card)sTwee paar %(card1)s en %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shooglaagInzet niet gevolgd - %(amount)s teruggegeven aan %(name)sToer afgezegd%(message)swinnaars verdelen een pot van %(pot)spoker-engine-1.3.6/po/fr_BE.gmo0000644000175000017500000001052111540702120013113 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { Žš $) N g v ‰  ° ,Ð ý + H Ad ¦ !¸ Ú ñ 0Nmrz‡Œ”®µ ÅÏäêó÷þ 1L\ai“˜ ¤«Ã áî )/81H9z´Ç2Ú +%(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n>1; Full aux %(card1)s par les %(card2)s%(name)s suit %(amount)s%(name)s passe%(name)s se couche%(name)s fais tapis%(name)s se couche%(name)s paye %(amount)s d'ante%(name)s paye %(amount)s de blind%(deadmsg)s%(name)s relance de %(amount)s%(name)s recoit %(amount)d (rocks restants)%(name)s reçoit %(amount)s%(name)s reçoit %(amount)s (les autres joueurs se sont couchés)%(name)s se lève%(name)s, %(len_pockets)d joueurs, %(card)s pour kickerPaire %(card)sAsd'AsTableau : %(board)sTableau : %(cards)sCartes de %(name)s : %(card)sCartes de %(name)s : %(cards)sDeuxde DeuxHuitde HuitCinqde CinqCouleur, hauteur %(card)sQuatreCarré %(card)sde QuatreCarte haute %(card)sValetde ValetRoide RoiNeufde NeufPaire %(card)sDouble paire : paire %(card1)s et paire %(card2)sCarré %(card)sDamede DameCommission %(amount)sQuinte flush royaleSeptde SeptSixde SixSuite, hauteur %(card)sSuite, %(card1)s à %(card2)sQuinte flushSuite, hauteur %(card)sDixde DixLa roueBrelan %(card)sTroisde TroisBrelan %(card)sDouble paire : paire %(card1)s et paire %(card2)smain #%(hand_serial)d, %(variant)s, %(betting_structure)smain la plus hautemain la plus basseretour de %(amount)s à %(name)s (mise non-suivie)tour annulé%(message)sles gagnants se partagent le pot de %(pot)spoker-engine-1.3.6/po/fi.gmo0000644000175000017500000001042511540702117012545 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { š + I c s ‚ • ± )Ï ù & ; 3X Œ !ž À Ò å ì ô   >_elqw‡›£»ÃÖÞçîõùþ 0 ? JX ht{ƒ‹“ª ÊÕòù16<!K9m§ª-®Üõ(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sÄssäÄssätPöytäkortit: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesKasiKasitVitonenVitosetFlush %(card)s highNelonenFour of a kind %(card)sNelosetHigh card %(card)sJätkäJätkätKunkkuKunkutYsiYsitPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sKuningatarKuningattaretRake %(amount)sRoyal flushSeiskaSeiskatKutonenKutosetStraight %(card)s highStraight %(card1)s to %(card2)sVärisuoraStraight flush %(card)s highKymppiKympitParas mahdollinen käsiThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)svoittajat jakavat potin %(pot)spoker-engine-1.3.6/po/de.gmo0000644000175000017500000001062211540702116012535 00000000000000Þ•FLa|"$B\l{Žª)Èò& 43Q…!—¹ËÞâçø  )JPW]dioƒˆ ¦¹¾ÄÉÏÔÚ ë  ! ( 8 D J Q U [ r ’ ¡ ¾ Â Ç Ñ ê ï õ ! 9& ` c -g • ® Í &k #’ ¶ Ó â ñ  & +E q 3 Á 7Ý !(J\nrwˆ!™"»Þãêïöü/6JOU\di p#~¢±¶¼ ÏÛâëñù/>[`gm†‹’!¤9ÆA O%l)= 4 9<$AB@02 D&+;, '!(C1*3E 758.-#6F?/:>" % (%(amount)s returned to %(name)s)%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2010-02-12 17:02+0100 Last-Translator: Lord Byron Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; (%(amount)s gehen zurück an %(name)s)Full House, %(card1)s und %(card2)s%(name)s geht mit %(amount)s%(name)s passt%(name)s passt%(name)s ist all in%(name)s verbirgt Verlierer-Hand%(name)s zahlt %(amount)s ante%(name)s zahlt %(amount)s blind %(deadmsg)s%(name)s erhöht %(amount)s%(name)s bekommt %(amount)d übrig gebliebene Chips%(name)s bekommt %(amount)s%(name)s bekommt%(amount)s (alle anderen haben gepasst)%(name)s setzt aus%(name)s, %(len_pockets)d Spieler, %(card)s KickerEin Paar %(card)sAssAsseBoard: %(board)sBoard: %(cards)sKarten Spieler %(name)s: %(card)sKarten Spieler %(name)s: %(cards)sZweiZweierAchtAchterFünfFünferFlush %(card)s hochVierVierling %(card)sViererHohe Karte %(card)sBubeBubenKönigKönigeNeunNeunerPaar %(card)sZwei Paare, %(card1)s und %(card2)sQuads %(card)sDameDamenEinsatz %(amount)sRoyal FlushSiebenSiebenerSechsSechsenStraight %(card)s hochStraße %(card1)s zu %(card2)sStraight FlushStraight Flush %(card)s hochZehnZehnerWheelDrilling %(card)s KartenDreiDreierDrilling %(card)sZwei Paar %(card1)s und %(card2)sHand #%(hand_serial)d, %(variant)s, %(betting_structure)shochniedrigNicht mitgegangener Einsatz %(amount)s an %(name)s zurückgegebenTurnier abgesagt %(message)sGewinner teilen einen Pot von %(pot)spoker-engine-1.3.6/po/LINGUAS0000644000175000017500000000013711113110673012463 00000000000000# List of available translation da de en en_CA en_US es fi fr fr_BE fr_CA fr_FX it nb nl pt sv poker-engine-1.3.6/po/en.gmo0000644000175000017500000001032411540702116012546 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { š + I c s ‚ • ± )Ï ù & ; 3X Œ !ž À Ò å é î ÿ  0QW^dkpvЧ­ÀÅËÐÖÛá ò"(/ ?KQX\by™¨ÅÉ ÎØñöü! 9-gj-nœµ(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)spoker-engine-1.3.6/po/pt.po0000644000175000017500000002270011540702114012422 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:31+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #54985 (pt) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s mostra %(value)s para %(side)s" # Translation #54986 (pt) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s elimina mão perdedora" # Translation #54987 (pt) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "ganha com %(side)s" # Translation #54988 (pt) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "Vencedores partilham um pote de %(pot)s" # Translation #54989 (pt) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(menos %(chips_left)d fichas em sobra)" # Translation #54990 (pt) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s recebe %(amount)s" # Translation #54991 (pt) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "mão #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #54995 (pt) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s espera para" # Translation #54997 (pt) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d jogadores" # Translation #54998 (pt) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Quadro: %(board)s" # Translation #54999 (pt) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cartas de %(name)s: %(card)s" # Translation #55000 (pt) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Quadro: %(cards)s" # Translation #55001 (pt) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cartas de %(name)s: %(cards)s" # Translation #55002 (pt) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Comissão %(amount)s" # Translation #55003 (pt) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "e %(dead)d dead" # Translation #55010 (pt) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s paga %(amount)s da casadela%(deadmsg)s" # Translation #55017 (pt) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s paga %(amount)s d'ante" # Translation #55020 (pt) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s vai all-in" # Translation #55022 (pt) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s calls %(amount)s" # Translation #55025 (pt) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s passa" # Translation #55028 (pt) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s desiste" # Translation #55056 (pt) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s sobe %(amount)s" # Translation #55059 (pt) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s devolvido a %(name)s)" # Translation #55062 (pt) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "turno anulado%(message)s" # Translation #55068 (pt) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s recebe %(amount)s (todos os outros jogadores desistiram)" # Translation #55071 (pt) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s recebe %(amount)d (fichas em sobra)" # Translation #55081 (pt) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "devolução de %(amount)s a %(name)s (aposta não igualada)" # Translation #55083 (pt) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s sits out" # Translation #55085 (pt) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "A roda" # Translation #55088 (pt) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Carta alta %(card)s" # Translation #55090 (pt) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Par de %(card)s" # Translation #55095 (pt) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #55099 (pt) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Dois pares %(card1)s e %(card2)s" # Translation #55100 (pt) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Trinca %(card)s" # Translation #55101 (pt) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Sequência de %(card1)s a %(card2)s" # Translation #55104 (pt) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s alto" # Translation #55107 (pt) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "Full de %(card1)ss e %(card2)ss" # Translation #55109 (pt) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Quadra %(card)s" # Translation #55111 (pt) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #55113 (pt) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s alto" # Translation #55115 (pt) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Par de %(card)s" # Translation #55117 (pt) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Pares de %(card1)s e %(card2)s" # Translation #55118 (pt) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Trinca %(card)s" # Translation #55119 (pt) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Sequência %(card)s alta" # Translation #55120 (pt) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Quadra %(card)s" # Translation #55121 (pt) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight flush" # Translation #55123 (pt) #: po/raw.string:1 msgid "hi" msgstr "Mão mais alta" # Translation #55124 (pt) #: po/raw.string:2 msgid "low" msgstr "Mão mais baixa" # Translation #55126 (pt) #: po/raw.string:4 msgid "Ace" msgstr "Ãs" # Translation #55127 (pt) #: po/raw.string:5 msgid "King" msgstr "Rei" # Translation #55129 (pt) #: po/raw.string:6 msgid "Queen" msgstr "Dama" # Translation #55130 (pt) #: po/raw.string:7 msgid "Jack" msgstr "Valete" # Translation #55131 (pt) #: po/raw.string:8 msgid "Ten" msgstr "Dez" # Translation #55133 (pt) #: po/raw.string:9 msgid "Nine" msgstr "Nove" # Translation #55134 (pt) #: po/raw.string:10 msgid "Eight" msgstr "Oito" # Translation #55135 (pt) #: po/raw.string:11 msgid "Seven" msgstr "Sete" # Translation #55136 (pt) #: po/raw.string:12 msgid "Six" msgstr "Seis" # Translation #55137 (pt) #: po/raw.string:13 msgid "Five" msgstr "Cinco" # Translation #55138 (pt) #: po/raw.string:14 msgid "Four" msgstr "Quatro" # Translation #55139 (pt) #: po/raw.string:15 msgid "Trey" msgstr "Três" # Translation #55140 (pt) #: po/raw.string:16 msgid "Deuce" msgstr "Dois" # Translation #55142 (pt) #: po/raw.string:18 msgid "Aces" msgstr "Ases" # Translation #55143 (pt) #: po/raw.string:19 msgid "Kings" msgstr "Reis" # Translation #55144 (pt) #: po/raw.string:20 msgid "Queens" msgstr "Damas" # Translation #55145 (pt) #: po/raw.string:21 msgid "Jacks" msgstr "Valetes" # Translation #55147 (pt) #: po/raw.string:22 msgid "Tens" msgstr "Dezes" # Translation #55148 (pt) #: po/raw.string:23 msgid "Nines" msgstr "Noves" # Translation #55149 (pt) #: po/raw.string:24 msgid "Eights" msgstr "Oitos" # Translation #55150 (pt) #: po/raw.string:25 msgid "Sevens" msgstr "Setes" # Translation #55151 (pt) #: po/raw.string:26 msgid "Sixes" msgstr "Seis" # Translation #55152 (pt) #: po/raw.string:27 msgid "Fives" msgstr "Cincos" # Translation #55154 (pt) #: po/raw.string:28 msgid "Fours" msgstr "Quatros" # Translation #55157 (pt) #: po/raw.string:29 msgid "Treys" msgstr "Três" # Translation #55158 (pt) #: po/raw.string:30 msgid "Deuces" msgstr "Duques" poker-engine-1.3.6/po/da.po0000644000175000017500000002264611540702107012376 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #55102 (da) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s viser %(value)s for %(side)s" # Translation #55103 (da) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s mucker tabende hÃ¥nd" # Translation #55105 (da) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "vinder %(side)s" # Translation #55106 (da) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "vinderne deler en pulje pÃ¥ %(pot)s" # Translation #55108 (da) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d ulige chips)" # Translation #55110 (da) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s modtager %(amount)s" # Translation #55112 (da) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "hÃ¥nd #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #55114 (da) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s venter pÃ¥" # Translation #55116 (da) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d spillere" # Translation #55122 (da) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Board: %(board)s" # Translation #55125 (da) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Kort spiller %(name)s: %(card)s" # Translation #55128 (da) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Board: %(cards)s" # Translation #55132 (da) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Kort spiller %(name)s: %(cards)s" # Translation #55141 (da) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Rake %(amount)s" # Translation #55146 (da) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "og %(dead)d døde" # Translation #55153 (da) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s betaler %(amount)s blind%(deadmsg)s" # Translation #55155 (da) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s betaler %(amount)s ante" # Translation #55156 (da) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s er all-in" # Translation #55159 (da) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s caller %(amount)s" # Translation #55162 (da) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s checker" # Translation #55165 (da) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s folder" # Translation #55169 (da) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s raiser %(amount)s" # Translation #55171 (da) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s returneret til to %(name)s)" # Translation #55175 (da) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "turn aflyst %(message)s" # Translation #55178 (da) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s modtager %(amount)s (alle andre foldede)" # Translation #55181 (da) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s modtager %(amount)d ulige chips" # Translation #55189 (da) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "returnerer uncalled bet %(amount)s til %(name)s" # Translation #55192 (da) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s sidder udenfor" # Translation #55193 (da) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "Wheelet" # Translation #55194 (da) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "Højeste kort %(card)s" # Translation #55195 (da) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "Et par %(card)s" # Translation #55196 (da) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #55197 (da) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "To par %(card1)s og %(card2)s" # Translation #55198 (da) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Tre ens %(card)s" # Translation #55199 (da) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straight %(card1)s til %(card2)s" # Translation #55200 (da) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s bedst" # Translation #55201 (da) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss bestÃ¥ende af %(card2)ss" # Translation #55202 (da) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Fire ens %(card)s" # Translation #55203 (da) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #55204 (da) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s højeste" # Translation #55205 (da) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Et par %(card)s" # Translation #55206 (da) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Par %(card1)s og %(card2)s" # Translation #55207 (da) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Tre ens %(card)s" # Translation #55208 (da) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straight %(card)s bedst" # Translation #55209 (da) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Fire ens %(card)s" # Translation #55210 (da) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight flush" # Translation #55211 (da) #: po/raw.string:1 msgid "hi" msgstr "bedst" # Translation #55212 (da) #: po/raw.string:2 msgid "low" msgstr "dÃ¥rligst" # Translation #55213 (da) #: po/raw.string:4 msgid "Ace" msgstr "Es" # Translation #55214 (da) #: po/raw.string:5 msgid "King" msgstr "Konge" # Translation #55215 (da) #: po/raw.string:6 msgid "Queen" msgstr "Dronning" # Translation #55216 (da) #: po/raw.string:7 msgid "Jack" msgstr "Knægt" # Translation #55217 (da) #: po/raw.string:8 msgid "Ten" msgstr "Ti'er" # Translation #55218 (da) #: po/raw.string:9 msgid "Nine" msgstr "Ni" # Translation #55219 (da) #: po/raw.string:10 msgid "Eight" msgstr "Otte" # Translation #55220 (da) #: po/raw.string:11 msgid "Seven" msgstr "Syv" # Translation #55221 (da) #: po/raw.string:12 msgid "Six" msgstr "Seks" # Translation #55222 (da) #: po/raw.string:13 msgid "Five" msgstr "Fem" # Translation #55223 (da) #: po/raw.string:14 msgid "Four" msgstr "Fire" # Translation #55224 (da) #: po/raw.string:15 msgid "Trey" msgstr "Tre" # Translation #55225 (da) #: po/raw.string:16 msgid "Deuce" msgstr "To'er" # Translation #55226 (da) #: po/raw.string:18 msgid "Aces" msgstr "Esser" # Translation #55227 (da) #: po/raw.string:19 msgid "Kings" msgstr "Konger" # Translation #55228 (da) #: po/raw.string:20 msgid "Queens" msgstr "Dronninger" # Translation #55229 (da) #: po/raw.string:21 msgid "Jacks" msgstr "Knægte" # Translation #55230 (da) #: po/raw.string:22 msgid "Tens" msgstr "Ti'ere" # Translation #55231 (da) #: po/raw.string:23 msgid "Nines" msgstr "Ni'ere" # Translation #55232 (da) #: po/raw.string:24 msgid "Eights" msgstr "Ottere" # Translation #55233 (da) #: po/raw.string:25 msgid "Sevens" msgstr "Syvere" # Translation #55234 (da) #: po/raw.string:26 msgid "Sixes" msgstr "Seksere" # Translation #55235 (da) #: po/raw.string:27 msgid "Fives" msgstr "Femmere" # Translation #55236 (da) #: po/raw.string:28 msgid "Fours" msgstr "Firere" # Translation #55237 (da) #: po/raw.string:29 msgid "Treys" msgstr "Treere" # Translation #55238 (da) #: po/raw.string:30 msgid "Deuces" msgstr "Toere" poker-engine-1.3.6/po/en_CA.gmo0000644000175000017500000001032411540702116013111 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { š + I c s ‚ • ± )Ï ù & ; 3X Œ !ž À Ò å é î ÿ  0QW^dkpvЧ­ÀÅËÐÖÛá ò"(/ ?KQX\by™¨ÅÉ ÎØñöü! 9-gj-nœµ(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)spoker-engine-1.3.6/po/en.po0000644000175000017500000002256211540702110012403 00000000000000# Skyrock Network # Copyright (C) 2002-2008 Orbus group # Devteam # #, fuzzy msgid "" msgstr "" "Project-Id-Version: poker-engine VERSION\n" "Report-Msgid-Bugs-To: http://www.pokersource.info\n" "POT-Creation-Date: 2011-03-18 17:11+0100\n" "PO-Revision-Date: 2008-11-25 16:30+0200\n" "Last-Translator: devteam \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: plurals=2; plural=n != 1;\n" # Translation #58366 (en) #: pokerengine/pokergame.py:311 #, fuzzy, python-format msgid "%(name)s shows %(value)s for %(side)s " msgstr "%(name)s shows %(value)s for %(side)s" # Translation #58367 (en) #: pokerengine/pokergame.py:313 #, python-format msgid "%(name)s mucks loosing hand" msgstr "%(name)s mucks loosing hand" # Translation #58368 (en) #: pokerengine/pokergame.py:322 #, fuzzy, python-format msgid " wins %(side)s " msgstr "wins %(side)s" # Translation #58369 (en) #: pokerengine/pokergame.py:326 #, python-format msgid "winners share a pot of %(pot)s" msgstr "winners share a pot of %(pot)s" # Translation #58371 (en) #: pokerengine/pokergame.py:328 #, fuzzy, python-format msgid " (minus %(chips_left)d odd chips)" msgstr "(minus %(chips_left)d odd chips)" # Translation #58372 (en) #: pokerengine/pokergame.py:332 #, python-format msgid "%(name)s receives %(amount)s" msgstr "%(name)s receives %(amount)s" # Translation #58373 (en) #: pokerengine/pokergame.py:344 #, python-format msgid "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" msgstr "hand #%(hand_serial)d, %(variant)s, %(betting_structure)s" # Translation #58374 (en) #: pokerengine/pokergame.py:348 #, fuzzy, python-format msgid "%(serial)s waiting for " msgstr "%(serial)s waiting for" # Translation #58375 (en) #: pokerengine/pokergame.py:357 #, python-format msgid "%(name)s, %(len_pockets)d players" msgstr "%(name)s, %(len_pockets)d players" # Translation #58376 (en) #: pokerengine/pokergame.py:361 #, python-format msgid "Board: %(board)s" msgstr "Board: %(board)s" # Translation #58377 (en) #: pokerengine/pokergame.py:365 #, python-format msgid "Cards player %(name)s: %(card)s" msgstr "Cards player %(name)s: %(card)s" # Translation #58378 (en) #: pokerengine/pokergame.py:370 #, python-format msgid "Board: %(cards)s" msgstr "Board: %(cards)s" # Translation #58379 (en) #: pokerengine/pokergame.py:375 #, python-format msgid "Cards player %(name)s: %(cards)s" msgstr "Cards player %(name)s: %(cards)s" # Translation #58380 (en) #: pokerengine/pokergame.py:379 #, python-format msgid "Rake %(amount)s" msgstr "Rake %(amount)s" # Translation #58381 (en) #: pokerengine/pokergame.py:396 #, fuzzy, python-format msgid " and %(dead)d dead" msgstr "and %(dead)d dead" # Translation #58382 (en) #: pokerengine/pokergame.py:399 #, python-format msgid "%(name)s pays %(amount)s blind%(deadmsg)s" msgstr "%(name)s pays %(amount)s blind%(deadmsg)s" # Translation #58383 (en) #: pokerengine/pokergame.py:406 #, python-format msgid "%(name)s pays %(amount)s ante" msgstr "%(name)s pays %(amount)s ante" # Translation #58384 (en) #: pokerengine/pokergame.py:410 #, python-format msgid "%(name)s is all in" msgstr "%(name)s is all in" # Translation #58385 (en) #: pokerengine/pokergame.py:414 #, python-format msgid "%(name)s calls %(amount)s" msgstr "%(name)s calls %(amount)s" # Translation #58386 (en) #: pokerengine/pokergame.py:418 #, python-format msgid "%(name)s checks" msgstr "%(name)s checks" # Translation #58387 (en) #: pokerengine/pokergame.py:422 #, python-format msgid "%(name)s folds" msgstr "%(name)s folds" # Translation #58388 (en) #: pokerengine/pokergame.py:426 #, python-format msgid "%(name)s raises %(amount)s" msgstr "%(name)s raises %(amount)s" # Translation #58389 (en) #: pokerengine/pokergame.py:431 #, fuzzy, python-format msgid " (%(amount)s returned to %(name)s)" msgstr "(%(amount)s returned to %(name)s)" # Translation #58390 (en) #: pokerengine/pokergame.py:434 #, python-format msgid "turn canceled%(message)s" msgstr "turn canceled%(message)s" # Translation #58391 (en) #: pokerengine/pokergame.py:442 #, python-format msgid "%(name)s receives %(amount)s (everyone else folded)" msgstr "%(name)s receives %(amount)s (everyone else folded)" # Translation #58392 (en) #: pokerengine/pokergame.py:449 #, python-format msgid "%(name)s receives %(amount)d odd chips" msgstr "%(name)s receives %(amount)d odd chips" # Translation #58393 (en) #: pokerengine/pokergame.py:451 #, python-format msgid "returning uncalled bet %(amount)s to %(name)s" msgstr "returning uncalled bet %(amount)s to %(name)s" # Translation #58394 (en) #: pokerengine/pokergame.py:462 #, python-format msgid "%(name)s sits out" msgstr "%(name)s sits out" # Translation #58395 (en) #: pokerengine/pokergame.py:2947 pokerengine/pokergame.py:2978 msgid "The wheel" msgstr "The wheel" # Translation #58396 (en) #: pokerengine/pokergame.py:2951 pokerengine/pokergame.py:2982 #, python-format msgid "High card %(card)s" msgstr "High card %(card)s" # Translation #58397 (en) #: pokerengine/pokergame.py:2953 #, python-format msgid "A pair of %(card)s" msgstr "A pair of %(card)s" # Translation #58398 (en) #: pokerengine/pokergame.py:2953 pokerengine/pokergame.py:2955 #: pokerengine/pokergame.py:2957 pokerengine/pokergame.py:2965 #, python-format msgid ", %(card)s kicker" msgstr ", %(card)s kicker" # Translation #58399 (en) #: pokerengine/pokergame.py:2955 #, python-format msgid "Two pairs %(card1)s and %(card2)s" msgstr "Two pairs %(card1)s and %(card2)s" # Translation #58400 (en) #: pokerengine/pokergame.py:2957 #, python-format msgid "Three of a kind %(card)s" msgstr "Three of a kind %(card)s" # Translation #58401 (en) #: pokerengine/pokergame.py:2959 #, python-format msgid "Straight %(card1)s to %(card2)s" msgstr "Straight %(card1)s to %(card2)s" # Translation #58402 (en) #: pokerengine/pokergame.py:2961 pokerengine/pokergame.py:2992 #, python-format msgid "Flush %(card)s high" msgstr "Flush %(card)s high" # Translation #58403 (en) #: pokerengine/pokergame.py:2963 pokerengine/pokergame.py:2994 #, python-format msgid "%(card1)ss full of %(card2)ss" msgstr "%(card1)ss full of %(card2)ss" # Translation #58404 (en) #: pokerengine/pokergame.py:2965 #, python-format msgid "Four of a kind %(card)s" msgstr "Four of a kind %(card)s" # Translation #58405 (en) #: pokerengine/pokergame.py:2968 pokerengine/pokergame.py:2999 msgid "Royal flush" msgstr "Royal flush" # Translation #58406 (en) #: pokerengine/pokergame.py:2970 #, python-format msgid "Straight flush %(card)s high" msgstr "Straight flush %(card)s high" # Translation #58407 (en) #: pokerengine/pokergame.py:2984 #, python-format msgid "Pair of %(card)s" msgstr "Pair of %(card)s" # Translation #58408 (en) #: pokerengine/pokergame.py:2986 #, python-format msgid "Pairs of %(card1)s and %(card2)s" msgstr "Pairs of %(card1)s and %(card2)s" # Translation #58409 (en) #: pokerengine/pokergame.py:2988 #, python-format msgid "Trips %(card)s" msgstr "Trips %(card)s" # Translation #58410 (en) #: pokerengine/pokergame.py:2990 #, python-format msgid "Straight %(card)s high" msgstr "Straight %(card)s high" # Translation #58411 (en) #: pokerengine/pokergame.py:2996 #, python-format msgid "Quads %(card)s" msgstr "Quads %(card)s" # Translation #58412 (en) #: pokerengine/pokergame.py:3001 msgid "Straight flush" msgstr "Straight flush" # Translation #58413 (en) #: po/raw.string:1 msgid "hi" msgstr "hi" # Translation #58414 (en) #: po/raw.string:2 msgid "low" msgstr "low" # Translation #58415 (en) #: po/raw.string:4 msgid "Ace" msgstr "Ace" # Translation #58416 (en) #: po/raw.string:5 msgid "King" msgstr "King" # Translation #58417 (en) #: po/raw.string:6 msgid "Queen" msgstr "Queen" # Translation #58418 (en) #: po/raw.string:7 msgid "Jack" msgstr "Jack" # Translation #58419 (en) #: po/raw.string:8 msgid "Ten" msgstr "Ten" # Translation #58420 (en) #: po/raw.string:9 msgid "Nine" msgstr "Nine" # Translation #58421 (en) #: po/raw.string:10 msgid "Eight" msgstr "Eight" # Translation #58422 (en) #: po/raw.string:11 msgid "Seven" msgstr "Seven" # Translation #58423 (en) #: po/raw.string:12 msgid "Six" msgstr "Six" # Translation #58424 (en) #: po/raw.string:13 msgid "Five" msgstr "Five" # Translation #58425 (en) #: po/raw.string:14 msgid "Four" msgstr "Four" # Translation #58426 (en) #: po/raw.string:15 msgid "Trey" msgstr "Trey" # Translation #58427 (en) #: po/raw.string:16 msgid "Deuce" msgstr "Deuce" # Translation #58428 (en) #: po/raw.string:18 msgid "Aces" msgstr "Aces" # Translation #58429 (en) #: po/raw.string:19 msgid "Kings" msgstr "Kings" # Translation #58430 (en) #: po/raw.string:20 msgid "Queens" msgstr "Queens" # Translation #58431 (en) #: po/raw.string:21 msgid "Jacks" msgstr "Jacks" # Translation #58432 (en) #: po/raw.string:22 msgid "Tens" msgstr "Tens" # Translation #58433 (en) #: po/raw.string:23 msgid "Nines" msgstr "Nines" # Translation #58434 (en) #: po/raw.string:24 msgid "Eights" msgstr "Eights" # Translation #58435 (en) #: po/raw.string:25 msgid "Sevens" msgstr "Sevens" # Translation #58436 (en) #: po/raw.string:26 msgid "Sixes" msgstr "Sixes" # Translation #58437 (en) #: po/raw.string:27 msgid "Fives" msgstr "Fives" # Translation #58438 (en) #: po/raw.string:28 msgid "Fours" msgstr "Fours" # Translation #58439 (en) #: po/raw.string:29 msgid "Treys" msgstr "Treys" # Translation #58440 (en) #: po/raw.string:30 msgid "Deuces" msgstr "Deuces" poker-engine-1.3.6/po/fr_FX.gmo0000644000175000017500000001052111540702121013143 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { Žš $) N g v ‰  ° ,Ð ý + H Ad ¦ !¸ Ú ñ 0Nmrz‡Œ”®µ ÅÏäêó÷þ 1L\ai“˜ ¤«Ã áî )/81H9z´Ç2Ú +%(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n>1; Full aux %(card1)s par les %(card2)s%(name)s suit %(amount)s%(name)s passe%(name)s se couche%(name)s fais tapis%(name)s se couche%(name)s paye %(amount)s d'ante%(name)s paye %(amount)s de blind%(deadmsg)s%(name)s relance de %(amount)s%(name)s recoit %(amount)d (rocks restants)%(name)s reçoit %(amount)s%(name)s reçoit %(amount)s (les autres joueurs se sont couchés)%(name)s se lève%(name)s, %(len_pockets)d joueurs, %(card)s pour kickerPaire %(card)sAsd'AsTableau : %(board)sTableau : %(cards)sCartes de %(name)s : %(card)sCartes de %(name)s : %(cards)sDeuxde DeuxHuitde HuitCinqde CinqCouleur, hauteur %(card)sQuatreCarré %(card)sde QuatreCarte haute %(card)sValetde ValetRoide RoiNeufde NeufPaire %(card)sDouble paire : paire %(card1)s et paire %(card2)sCarré %(card)sDamede DameCommission %(amount)sQuinte flush royaleSeptde SeptSixde SixSuite, hauteur %(card)sSuite, %(card1)s à %(card2)sQuinte flushSuite, hauteur %(card)sDixde DixLa roueBrelan %(card)sTroisde TroisBrelan %(card)sDouble paire : paire %(card1)s et paire %(card2)smain #%(hand_serial)d, %(variant)s, %(betting_structure)smain la plus hautemain la plus basseretour de %(amount)s à %(name)s (mise non-suivie)tour annulé%(message)sles gagnants se partagent le pot de %(pot)spoker-engine-1.3.6/po/raw.string0000644000175000017500000000072010562041557013470 00000000000000gettext("hi") gettext("low") gettext("Ace") gettext("King") gettext("Queen") gettext("Jack") gettext("Ten") gettext("Nine") gettext("Eight") gettext("Seven") gettext("Six") gettext("Five") gettext("Four") gettext("Trey") gettext("Deuce") gettext("Aces") gettext("Kings") gettext("Queens") gettext("Jacks") gettext("Tens") gettext("Nines") gettext("Eights") gettext("Sevens") gettext("Sixes") gettext("Fives") gettext("Fours") gettext("Treys") gettext("Deuces") poker-engine-1.3.6/po/da.gmo0000644000175000017500000001037711540702115012537 00000000000000Þ•EDalðñ)9H[w)•¿&Ú3R!d†˜«¯´ÅÖ ö$*16<PUms†‹‘–œ¡§ ¸Ùèîõ     " ( ? _ n ‹  ” ž · ¼  !Ñ 9ó - 0 -4 b { š #+ O j { ‹ ž ¼ ,Ý  (% N 1k  "µ Ø ê ú ý % Eflrw~‚ŠŸ¤¶½ÔÛãéðóú %7 @K [gkrw —¸ Çèîõý*:Hƒ ‰/“Ã#Û(< 3 8 #@A?/1C%*:+ & 'B0)2D .647-,"5E>;9=!$%(card1)ss full of %(card2)ss%(name)s calls %(amount)s%(name)s checks%(name)s folds%(name)s is all in%(name)s mucks loosing hand%(name)s pays %(amount)s ante%(name)s pays %(amount)s blind%(deadmsg)s%(name)s raises %(amount)s%(name)s receives %(amount)d odd chips%(name)s receives %(amount)s%(name)s receives %(amount)s (everyone else folded)%(name)s sits out%(name)s, %(len_pockets)d players, %(card)s kickerA pair of %(card)sAceAcesBoard: %(board)sBoard: %(cards)sCards player %(name)s: %(card)sCards player %(name)s: %(cards)sDeuceDeucesEightEightsFiveFivesFlush %(card)s highFourFour of a kind %(card)sFoursHigh card %(card)sJackJacksKingKingsNineNinesPair of %(card)sPairs of %(card1)s and %(card2)sQuads %(card)sQueenQueensRake %(amount)sRoyal flushSevenSevensSixSixesStraight %(card)s highStraight %(card1)s to %(card2)sStraight flushStraight flush %(card)s highTenTensThe wheelThree of a kind %(card)sTreyTreysTrips %(card)sTwo pairs %(card1)s and %(card2)shand #%(hand_serial)d, %(variant)s, %(betting_structure)shilowreturning uncalled bet %(amount)s to %(name)sturn canceled%(message)swinners share a pot of %(pot)sProject-Id-Version: poker-engine VERSION Report-Msgid-Bugs-To: http://www.pokersource.info POT-Creation-Date: 2011-03-18 17:11+0100 PO-Revision-Date: 2008-11-25 16:30+0200 Last-Translator: devteam Language-Team: Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: plurals=2; plural=n != 1; %(card1)ss bestÃ¥ende af %(card2)ss%(name)s caller %(amount)s%(name)s checker%(name)s folder%(name)s er all-in%(name)s mucker tabende hÃ¥nd%(name)s betaler %(amount)s ante%(name)s betaler %(amount)s blind%(deadmsg)s%(name)s raiser %(amount)s%(name)s modtager %(amount)d ulige chips%(name)s modtager %(amount)s%(name)s modtager %(amount)s (alle andre foldede)%(name)s sidder udenfor%(name)s, %(len_pockets)d spillere, %(card)s kickerEt par %(card)sEsEsserBoard: %(board)sBoard: %(cards)sKort spiller %(name)s: %(card)sKort spiller %(name)s: %(cards)sTo'erToereOtteOttereFemFemmereFlush %(card)s bedstFireFire ens %(card)sFirereHøjeste kort %(card)sKnægtKnægteKongeKongerNiNi'ereEt par %(card)sPar %(card1)s og %(card2)sFire ens %(card)sDronningDronningerRake %(amount)sRoyal flushSyvSyvereSeksSeksereStraight %(card)s bedstStraight %(card1)s til %(card2)sStraight flushStraight flush %(card)s højesteTi'erTi'ereWheeletTre ens %(card)sTreTreereTre ens %(card)sTo par %(card1)s og %(card2)shÃ¥nd #%(hand_serial)d, %(variant)s, %(betting_structure)sbedstdÃ¥rligstreturnerer uncalled bet %(amount)s til %(name)sturn aflyst %(message)svinderne deler en pulje pÃ¥ %(pot)spoker-engine-1.3.6/po/stamp-po0000644000175000017500000000001211117320735013117 00000000000000timestamp poker-engine-1.3.6/examples/0002755000175000017500000000000011540702075012726 500000000000000poker-engine-1.3.6/examples/simple.py0000644000175000017500000000502511344205422014505 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # # # poker-engine # import sys, os sys.path.insert(0, "..") from pokerengine.pokergame import PokerGameServer # # Instantiate a poker engine for a hold'em game with a 10/15 pot limit # betting structure. The variant and betting structure descriptions # will be read from the conf/poker.holdem.xml and conf/poker.10-15-pot-limit.xml # files. # game = PokerGameServer("poker.%s.xml", ['conf', '../conf', '/etc/poker-engine']) game.verbose = 1 game.setVariant("holdem") game.setBettingStructure("10-15-pot-limit") # # The serial numbers of the four players # PLAYER1 = 1 PLAYER2 = 2 PLAYER3 = 3 PLAYER4 = 4 # # Each player sits at the table and buys in 1500. # The blinds are posted automatically, no action is required from # the player. # for serial in xrange(PLAYER1, PLAYER4 + 1): game.addPlayer(serial) game.payBuyIn(serial, 1500*100) game.sit(serial) game.autoBlindAnte(serial) # # Post the blinds and deal the pocket cards. PLAYER1 # is the dealer, PLAYER2 pays the small blind, PLAYER3 # pays the big blind. # game.beginTurn(1) # # PLAYER4 calls under the gun # game.call(PLAYER4) # # The dealer and small blind fold # game.fold(PLAYER1) game.fold(PLAYER2) # # The big blind checks # game.check(PLAYER3) # # PLAYER3 and PLAYER4 check the flop # game.check(PLAYER3) game.check(PLAYER4) # # PLAYER3 and PLAYER4 check the turn # game.check(PLAYER3) game.check(PLAYER4) # # PLAYER3 and PLAYER4 check the river # game.check(PLAYER3) game.check(PLAYER4) # # Print the winner(s) # print "*" * 70 for winner in game.winners: print "The winner is PLAYER%d with %s" % ( winner, game.readablePlayerBestHands(winner) ) poker-engine-1.3.6/configure0000755000175000017500000043521711540702064012747 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67 for poker-engine 1.3.6. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='poker-engine' PACKAGE_TARNAME='poker-engine' PACKAGE_VERSION='1.3.6' PACKAGE_STRING='poker-engine 1.3.6' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="pokerengine/pokergame.py" ac_subst_vars='LTLIBOBJS LIBOBJS XGETTEXT_EXTRA_OPTIONS MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS PYPOKER_EVAL_LIBS PYPOKER_EVAL_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG POKER_ENGINE_PKGSYSCONFDIR POKER_ENGINE_PKGLIBDIR POKER_ENGINE_PKGDATADIR pkgdatadir pkglibdir pkgsysconfdir pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_VERSION PYTHON MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE RSYNC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_nls ' ac_precious_vars='build_alias host_alias target_alias PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PYPOKER_EVAL_CFLAGS PYPOKER_EVAL_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures poker-engine 1.3.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/poker-engine] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of poker-engine 1.3.6:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-nls do not use Native Language Support Some influential environment variables: PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path PYPOKER_EVAL_CFLAGS C compiler flags for PYPOKER_EVAL, overriding pkg-config PYPOKER_EVAL_LIBS linker flags for PYPOKER_EVAL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF poker-engine configure 1.3.6 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by poker-engine $as_me 1.3.6, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5 ; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='poker-engine' VERSION='1.3.6' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Checks for programs. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Extract the first word of "rsync", so it can be a program name with args. set dummy rsync; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_RSYNC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $RSYNC in [\\/]* | ?:[\\/]*) ac_cv_path_RSYNC="$RSYNC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RSYNC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi RSYNC=$ac_cv_path_RSYNC if test -n "$RSYNC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RSYNC" >&5 $as_echo "$RSYNC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$RSYNC" ; then as_fn_error $? "rsync is needed to install poker-engine" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.3" >&5 $as_echo_n "checking whether $PYTHON version >= 2.3... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.3'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "too old" "$LINENO" 5 fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.3" >&5 $as_echo_n "checking for a Python interpreter with version >= 2.3... " >&6; } if test "${am_cv_pathless_PYTHON+set}" = set; then : $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.3'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 $as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PYTHON+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if test "${am_cv_python_version+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version PYTHON_PREFIX='${prefix}' PYTHON_EXEC_PREFIX='${exec_prefix}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if test "${am_cv_python_platform+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if test "${am_cv_python_pythondir+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if test "${am_cv_python_pyexecdir+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi pkgsysconfdir=$sysconfdir/$PACKAGE pkgsysconfdir=$pkgsysconfdir pkglibdir=$libexecdir/$PACKAGE pkglibdir=$pkglibdir pkgdatadir=$datadir/$PACKAGE pkgdatadir=$pkgdatadir POKER_ENGINE_PKGDATADIR=`eval eval eval echo $pkgdatadir` POKER_ENGINE_PKGLIBDIR=`eval eval eval echo $pkglibdir` POKER_ENGINE_PKGSYSCONFDIR=`eval eval eval echo $pkgsysconfdir` if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYPOKER_EVAL" >&5 $as_echo_n "checking for PYPOKER_EVAL... " >&6; } if test -n "$PYPOKER_EVAL_CFLAGS"; then pkg_cv_PYPOKER_EVAL_CFLAGS="$PYPOKER_EVAL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pypoker-eval >= 132.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "pypoker-eval >= 132.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYPOKER_EVAL_CFLAGS=`$PKG_CONFIG --cflags "pypoker-eval >= 132.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYPOKER_EVAL_LIBS"; then pkg_cv_PYPOKER_EVAL_LIBS="$PYPOKER_EVAL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pypoker-eval >= 132.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "pypoker-eval >= 132.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYPOKER_EVAL_LIBS=`$PKG_CONFIG --libs "pypoker-eval >= 132.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYPOKER_EVAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "pypoker-eval >= 132.0" 2>&1` else PYPOKER_EVAL_PKG_ERRORS=`$PKG_CONFIG --print-errors "pypoker-eval >= 132.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYPOKER_EVAL_PKG_ERRORS" >&5 as_fn_error $? "pypoker-eval is a mandatory library" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "pypoker-eval is a mandatory library" "$LINENO" 5 else PYPOKER_EVAL_CFLAGS=$pkg_cv_PYPOKER_EVAL_CFLAGS PYPOKER_EVAL_LIBS=$pkg_cv_PYPOKER_EVAL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi python_script=" import imp import sys path = list() modules = sys.argv.pop(1) for module in modules.split('.'): (file, pathname, info) = imp.find_module(module, sys.path + path) sys.stdout.write(pathname + ' ') path = list(( pathname, )) " for module in libxml2 libxslt pokereval ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether python module $module is available" >&5 $as_echo_n "checking wether python module $module is available... " >&6; } if $PYTHON -c "$python_script" $module ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... yes" >&5 $as_echo "... yes" >&6; } else as_fn_error $? "failed" "$LINENO" 5 fi done # i18n { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.18 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" # Generate files ac_config_files="$ac_config_files tests/run pokerconfigupgrade" ac_config_files="$ac_config_files po/Makefile" ac_config_files="$ac_config_files Makefile poker-engine.pc pokerconfigupgrade.8 pokerengine/Makefile tests/allin.py tests/blinds.py tests/buyin.py tests/bugs.py tests/chips.py tests/deal.py tests/eval.py tests/history.py tests/muck.py tests/positions.py tests/sit.py tests/tournament.py tests/upgrades.py tests/libxml2leak.py tests/test-gamehistory.py tests/test-pokercards.py tests/test-pokerengineconfig.py tests/test-pokertournament.py tests/test-pokerprizes.py tests/test-game.py tests/test-pokerchips.py tests/test-pokerrake.py tests/test-pokerplayer.py tests/test-version.py tests/test-i18n.py tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by poker-engine $as_me 1.3.6, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ poker-engine config.status 1.3.6 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "tests/run") CONFIG_FILES="$CONFIG_FILES tests/run" ;; "pokerconfigupgrade") CONFIG_FILES="$CONFIG_FILES pokerconfigupgrade" ;; "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "poker-engine.pc") CONFIG_FILES="$CONFIG_FILES poker-engine.pc" ;; "pokerconfigupgrade.8") CONFIG_FILES="$CONFIG_FILES pokerconfigupgrade.8" ;; "pokerengine/Makefile") CONFIG_FILES="$CONFIG_FILES pokerengine/Makefile" ;; "tests/allin.py") CONFIG_FILES="$CONFIG_FILES tests/allin.py" ;; "tests/blinds.py") CONFIG_FILES="$CONFIG_FILES tests/blinds.py" ;; "tests/buyin.py") CONFIG_FILES="$CONFIG_FILES tests/buyin.py" ;; "tests/bugs.py") CONFIG_FILES="$CONFIG_FILES tests/bugs.py" ;; "tests/chips.py") CONFIG_FILES="$CONFIG_FILES tests/chips.py" ;; "tests/deal.py") CONFIG_FILES="$CONFIG_FILES tests/deal.py" ;; "tests/eval.py") CONFIG_FILES="$CONFIG_FILES tests/eval.py" ;; "tests/history.py") CONFIG_FILES="$CONFIG_FILES tests/history.py" ;; "tests/muck.py") CONFIG_FILES="$CONFIG_FILES tests/muck.py" ;; "tests/positions.py") CONFIG_FILES="$CONFIG_FILES tests/positions.py" ;; "tests/sit.py") CONFIG_FILES="$CONFIG_FILES tests/sit.py" ;; "tests/tournament.py") CONFIG_FILES="$CONFIG_FILES tests/tournament.py" ;; "tests/upgrades.py") CONFIG_FILES="$CONFIG_FILES tests/upgrades.py" ;; "tests/libxml2leak.py") CONFIG_FILES="$CONFIG_FILES tests/libxml2leak.py" ;; "tests/test-gamehistory.py") CONFIG_FILES="$CONFIG_FILES tests/test-gamehistory.py" ;; "tests/test-pokercards.py") CONFIG_FILES="$CONFIG_FILES tests/test-pokercards.py" ;; "tests/test-pokerengineconfig.py") CONFIG_FILES="$CONFIG_FILES tests/test-pokerengineconfig.py" ;; "tests/test-pokertournament.py") CONFIG_FILES="$CONFIG_FILES tests/test-pokertournament.py" ;; "tests/test-pokerprizes.py") CONFIG_FILES="$CONFIG_FILES tests/test-pokerprizes.py" ;; "tests/test-game.py") CONFIG_FILES="$CONFIG_FILES tests/test-game.py" ;; "tests/test-pokerchips.py") CONFIG_FILES="$CONFIG_FILES tests/test-pokerchips.py" ;; "tests/test-pokerrake.py") CONFIG_FILES="$CONFIG_FILES tests/test-pokerrake.py" ;; "tests/test-pokerplayer.py") CONFIG_FILES="$CONFIG_FILES tests/test-pokerplayer.py" ;; "tests/test-version.py") CONFIG_FILES="$CONFIG_FILES tests/test-version.py" ;; "tests/test-i18n.py") CONFIG_FILES="$CONFIG_FILES tests/test-i18n.py" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; "tests/run":F) chmod 555 $ac_file ;; "pokerconfigupgrade":F) chmod 555 $ac_file ;; "po/Makefile":F) # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" </dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi poker-engine-1.3.6/Makefile.cygwin0000644000175000017500000000005710562320422013762 00000000000000all: mo mo: msgfmt ./po/fr.po -o ./po/fr.mo poker-engine-1.3.6/Makefile.am0000644000175000017500000001403111354224270013060 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # # ACLOCAL_AMFLAGS = -I config SUBDIRS = pokerengine tests po pkgsysconfdir=${sysconfdir}/poker-engine MAINTAINERCLEANFILES = INSTALL Makefile.in aclocal.m4 configure \ $(wildcard config/*) confpokerdir = ${pkgdatadir}/conf dist_confpoker_DATA = \ $(wildcard ${top_srcdir}/conf/*.xml) upgradepokerdir = ${pkgdatadir}/upgrades dist_upgradepoker_DATA = \ $(wildcard ${top_srcdir}/upgrades/*.xsl) EXTRA_DIST = \ examples/simple.py \ po/raw.string \ $(wildcard conf/*.template) \ $(wildcard gentoo/dev-games/poker-eval/*.ebuild) \ Makefile.cygwin pkgconfigdir = ${datadir}/pkgconfig pkgconfig_DATA = poker-engine.pc man_MANS = \ pokerconfigupgrade.8 sbin_SCRIPTS = \ pokerconfigupgrade TESTS_ENVIRONMENT = PYTHONPATH=. @PYTHON@ TESTS = examples/simple.py clean-local: rm -f */*.py[co] rm -fr tests/conftest rm -f tests/.coverage all-local: if [ -w ${srcdir}/conf ] ; then \ ${PYTHON} ${top_builddir}/pokerconfigupgrade --verbose=1 --upgrades=${srcdir}/upgrades ${srcdir}/conf ; \ fi install-data-local: mkdir -p "${DESTDIR}${pkgsysconfdir}" ${PYTHON} ${top_builddir}/pokerconfigupgrade --verbose=1 --upgrades=${srcdir}/upgrades --reference=${srcdir}/conf "${DESTDIR}${pkgsysconfdir}" chmod u+w "${DESTDIR}${pkgsysconfdir}" uninstall-local: rm -f ${DESTDIR}${pkgsysconfdir}/*.{xml,template} rmdir ${DESTDIR}${pkgsysconfdir} buildconf: ( \ echo '.01-.02 .01/.02 1 2 1' ; \ echo '.02-.04 .02/.04 2 4 2' ; \ echo '.05-.10 .05/.10 5 10 5' ; \ echo '.10-.25 .10/.25 12 25 1' ; \ echo '.25-.50 .25/.50 25 50 5' ; \ echo '.50-1 .50/1 50 100 50' ; \ echo '1-2 1/2 100 200 100' ; \ echo '2-4 2/4 200 400 100' ; \ echo '3-6 3/6 300 600 100' ; \ echo '5-10 5/10 500 1000 500' ; \ echo '10-20 10/20 1000 2000 1000' ; \ echo '30-60 30/60 3000 6000 1000' ; \ echo '50-100 50/100 5000 10000 5000' ; \ echo '100-200 100/200 10000 20000 10000' ; \ ) | while read name desc small big unit ; do \ buy_in=`expr $$big \* 10` ; \ best_buy_in=`expr $$big \* 50` ; \ max_buy_in=`expr $$big \* 100` ; \ sed -e "s;_NAME_;$$name;g" -e "s;_DESC_;$$desc;g" -e "s/_UNIT_/$$unit/g" -e "s/_BEST_BUY_IN_/$$best_buy_in/g" -e "s/_MAX_BUY_IN_/$$max_buy_in/g" -e "s/_BUY_IN_/$$buy_in/g" -e "s/_SMALL_/$$small/g" -e "s/_BIG_/$$big/g" < conf/no-limit.template > conf/poker.$${name}-no-limit.xml ; \ done ( \ echo '.01-.02 .01/.02 1 2 1' ; \ echo '.02-.04 .02/.04 2 4 2' ; \ echo '.05-.10 .05/.10 5 10 5' ; \ echo '.10-.25 .10/.25 12 25 1' ; \ echo '.25-.50 .25/.50 25 50 5' ; \ echo '.50-1 .50/1 50 100 50' ; \ echo '1-2 1/2 100 200 100' ; \ echo '2-4 2/4 200 400 100' ; \ echo '3-6 3/6 300 600 100' ; \ echo '5-10 5/10 500 1000 500' ; \ echo '10-20 10/20 1000 2000 1000' ; \ echo '30-60 30/60 3000 6000 1000' ; \ echo '50-100 50/100 5000 10000 5000' ; \ echo '100-200 100/200 10000 20000 10000' ; \ ) | while read name desc small big unit ; do \ buy_in=`expr $$big \* 10` ; \ best_buy_in=`expr $$big \* 50` ; \ max_buy_in=`expr $$big \* 100` ; \ sed -e "s;_NAME_;$$name;g" -e "s;_DESC_;$$desc;g" -e "s/_UNIT_/$$unit/g" -e "s/_BEST_BUY_IN_/$$best_buy_in/g" -e "s/_MAX_BUY_IN_/$$max_buy_in/g" -e "s/_BUY_IN_/$$buy_in/g" -e "s/_SMALL_/$$small/g" -e "s/_BIG_/$$big/g" < conf/pot-limit.template > conf/poker.$${name}-pot-limit.xml ; \ done ( \ echo '.02-.04 .02/.04 1 2 1' ; \ echo '.05-.10 .05/.10 2 5 1' ; \ echo '.10-.25 .10/.25 5 10 5' ; \ echo '.25-.50 .25/.50 12 25 1' ; \ echo '.50-1 .50/1 25 50 5' ; \ echo '1-2 1/2 50 100 50' ; \ echo '2-4 2/4 100 200 100' ; \ echo '3-6 3/6 150 300 50' ; \ echo '5-10 5/10 250 500 50' ; \ echo '10-20 10/20 500 1000 500' ; \ echo '30-60 30/60 1500 3000 500' ; \ echo '50-100 50/100 2500 5000 500' ; \ echo '100-200 100/200 5000 10000 5000' ; \ ) | while read name desc small big unit ; do \ buy_in=`expr $$big \* 5` ; \ best_buy_in=`expr $$big \* 30` ; \ max_buy_in=`expr $$big \* 100000` ; \ big_bet=`expr $$big \* 2` ; \ sed -e "s;_NAME_;$$name;g" -e "s;_DESC_;$$desc;g" -e "s/_UNIT_/$$unit/g" -e "s/_BEST_BUY_IN_/$$best_buy_in/g" -e "s/_MAX_BUY_IN_/$$max_buy_in/g" -e "s/_BUY_IN_/$$buy_in/g" -e "s/_SMALL_/$$small/g" -e "s/_BIG_/$$big/g" -e "s/_BIGBET_/$$big_bet/g" < conf/limit.template > conf/poker.$${name}-limit.xml ; \ done ( \ echo '.04-.08 .04/.08 4 8 1 2 1' ; \ echo '.10-.20 .10/.20 10 20 2 5 2' ; \ echo '.25-.50 .25/.50 25 50 5 10 5' ; \ echo '.50-1 .50/1 50 100 5 25 5' ; \ echo '1-2 1/2 100 200 10 50 10' ; \ echo '2-4 2/4 200 400 25 100 25' ; \ echo '3-6 3/6 300 600 25 150 25' ; \ echo '5-10 5/10 500 1000 50 200 50' ; \ echo '10-20 10/20 1000 2000 100 500 100' ; \ echo '30-60 30/60 3000 6000 500 1500 500' ; \ ) | while read name desc small big ante bringin unit ; do \ buy_in=`expr $$big \* 5` ; \ best_buy_in=`expr $$big \* 30` ; \ max_buy_in=`expr $$big \* 100000` ; \ sed -e "s;_NAME_;$$name;g" -e "s;_DESC_;$$desc;g" -e "s/_UNIT_/$$unit/g" -e "s/_BEST_BUY_IN_/$$best_buy_in/g" -e "s/_MAX_BUY_IN_/$$max_buy_in/g" -e "s/_BUY_IN_/$$buy_in/g" -e "s/_SMALL_/$$small/g" -e "s/_BIG_/$$big/g" -e "s/_ANTE_/$$ante/g" -e "s/_BRINGIN_/$$bringin/g" < conf/ante-limit.template > conf/poker.ante-$${name}-limit.xml ; \ done poker-engine-1.3.6/config/0002755000175000017500000000000011540702075012355 500000000000000poker-engine-1.3.6/config/py-compile0000755000175000017500000001013511540702065014276 00000000000000#!/bin/sh # py-compile - Compile a Python program scriptversion=2009-04-28.21; # UTC # Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . if [ -z "$PYTHON" ]; then PYTHON=python fi basedir= destdir= files= while test $# -ne 0; do case "$1" in --basedir) basedir=$2 if test -z "$basedir"; then echo "$0: Missing argument to --basedir." 1>&2 exit 1 fi shift ;; --destdir) destdir=$2 if test -z "$destdir"; then echo "$0: Missing argument to --destdir." 1>&2 exit 1 fi shift ;; -h|--h*) cat <<\EOF Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." Byte compile some python scripts FILES. Use --destdir to specify any leading directory path to the FILES that you don't want to include in the byte compiled file. Specify --basedir for any additional path information you do want to be shown in the byte compiled file. Example: py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py Report bugs to . EOF exit $? ;; -v|--v*) echo "py-compile $scriptversion" exit $? ;; *) files="$files $1" ;; esac shift done if test -z "$files"; then echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 fi # if basedir was given, then it should be prepended to filenames before # byte compilation. if [ -z "$basedir" ]; then pathtrans="path = file" else pathtrans="path = os.path.join('$basedir', file)" fi # if destdir was given, then it needs to be prepended to the filename to # byte compile but not go into the compiled file. if [ -z "$destdir" ]; then filetrans="filepath = path" else filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" fi $PYTHON -c " import sys, os, py_compile files = '''$files''' sys.stdout.write('Byte-compiling python modules...\n') for file in files.split(): $pathtrans $filetrans if not os.path.exists(filepath) or not (len(filepath) >= 3 and filepath[-3:] == '.py'): continue sys.stdout.write(file) sys.stdout.flush() py_compile.compile(filepath, filepath + 'c', path) sys.stdout.write('\n')" || exit $? # this will fail for python < 1.5, but that doesn't matter ... $PYTHON -O -c " import sys, os, py_compile files = '''$files''' sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') for file in files.split(): $pathtrans $filetrans if not os.path.exists(filepath) or not (len(filepath) >= 3 and filepath[-3:] == '.py'): continue sys.stdout.write(file) sys.stdout.flush() py_compile.compile(filepath, filepath + 'o', path) sys.stdout.write('\n')" 2>/dev/null || : # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: poker-engine-1.3.6/config/missing0000755000175000017500000002623311540702065013677 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: poker-engine-1.3.6/config/install-sh0000755000175000017500000003253711540702065014310 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: poker-engine-1.3.6/COPYING0000644000175000017500000010451311002736270012062 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . poker-engine-1.3.6/conf/0002755000175000017500000000000011540702075012035 500000000000000poker-engine-1.3.6/conf/poker.level-001.xml0000644000175000017500000000175411354224223015225 00000000000000 No limit tournament poker-engine-1.3.6/conf/poker..02-.04-pot-limit.xml0000644000175000017500000000207411354224223016326 00000000000000 Pot limit .02/.04 poker-engine-1.3.6/conf/poker.ante-10-20-limit.xml0000644000175000017500000000175711354224223016323 00000000000000 Limit 10/20 poker-engine-1.3.6/conf/poker.50-100-pot-limit.xml0000644000175000017500000000216711354224223016255 00000000000000 Pot limit 50/100 poker-engine-1.3.6/conf/poker..50-1-no-limit.xml0000644000175000017500000000176011354224223016003 00000000000000 No limit .50/1 poker-engine-1.3.6/conf/poker.10-20-limit.xml0000644000175000017500000000175311354224223015372 00000000000000 Limit 10/20 poker-engine-1.3.6/conf/poker.50-100-no-limit.xml0000644000175000017500000000202211354224223016055 00000000000000 No limit 50/100 poker-engine-1.3.6/conf/poker..02-.04-no-limit.xml0000644000175000017500000000172711354224223016144 00000000000000 No limit .02/.04 poker-engine-1.3.6/conf/poker.3-6-limit.xml0000644000175000017500000000173211354224223015235 00000000000000 Limit 3/6 poker-engine-1.3.6/conf/poker..50.1-limit.xml0000644000175000017500000000173111354224223015370 00000000000000 Limit .50/1 poker-engine-1.3.6/conf/poker..25-.50-limit.xml0000644000175000017500000000172311354224223015534 00000000000000 Limit .25/.50 poker-engine-1.3.6/conf/poker..50-1-limit.xml0000644000175000017500000000172511354224223015372 00000000000000 Limit .50/1 poker-engine-1.3.6/conf/poker.1-2-pot-limit.xml0000644000175000017500000000212411354224223016023 00000000000000 Pot limit 1/2 poker-engine-1.3.6/conf/poker.ante-1-2-limit.xml0000644000175000017500000000173411354224223016156 00000000000000 Limit 1/2 poker-engine-1.3.6/conf/poker.10-15-pot-limit.xml0000644000175000017500000000204511354224223016171 00000000000000 Pot limit 10/15 poker-engine-1.3.6/conf/poker.razz.xml0000644000175000017500000000311311354224223014575 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/conf/poker.3-6-no-limit.xml0000644000175000017500000000175711354224223015656 00000000000000 No limit 3/6 poker-engine-1.3.6/conf/poker.30-60-no-limit.xml0000644000175000017500000000200311354224223015777 00000000000000 No limit 30/60 poker-engine-1.3.6/conf/poker.10-20-pot-limit.xml0000644000175000017500000000215011354224223016162 00000000000000 Pot limit 10/20 poker-engine-1.3.6/conf/poker..01-.02-no-limit.xml0000644000175000017500000000172711354224223016141 00000000000000 No limit .01/.02 poker-engine-1.3.6/conf/poker.ante-.50-1-limit.xml0000644000175000017500000000173011354224223016313 00000000000000 Limit .50/1 poker-engine-1.3.6/conf/poker.1-2-no-limit.xml0000644000175000017500000000175711354224223015650 00000000000000 No limit 1/2 poker-engine-1.3.6/conf/poker.omaha.xml0000644000175000017500000000323211354224223014676 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/conf/poker.200-400-limit.xml0000644000175000017500000000200111354224223015520 00000000000000 Limit 200/400 poker-engine-1.3.6/conf/poker.0-0-limit.xml0000644000175000017500000000166211354224223015226 00000000000000 No blind, no antes poker-engine-1.3.6/conf/poker.100-200-pot-limit.xml0000644000175000017500000000217411354224223016330 00000000000000 Pot limit 100/200 poker-engine-1.3.6/conf/poker.15-30-limit.xml0000644000175000017500000000175511354224223015402 00000000000000 Limit 15/30 poker-engine-1.3.6/conf/poker.150-300-limit.xml0000644000175000017500000000177711354224223015546 00000000000000 Limit 150/300 poker-engine-1.3.6/conf/poker.30-60-pot-limit.xml0000644000175000017500000000215011354224223016170 00000000000000 Pot limit 30/60 poker-engine-1.3.6/conf/poker.omaha8.xml0000644000175000017500000000331011354224223014763 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/conf/no-limit.template0000644000175000017500000000203010427052643015235 00000000000000 No limit _DESC_ poker-engine-1.3.6/conf/poker..02-.04-limit.xml0000644000175000017500000000170511354224223015526 00000000000000 Limit .02/.04 poker-engine-1.3.6/conf/poker.2-4-pot-limit.xml0000644000175000017500000000212411354224223016026 00000000000000 Pot limit 2/4 poker-engine-1.3.6/conf/poker.holdem.xml0000644000175000017500000000305211354224223015061 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/conf/poker..10-.25-pot-limit.xml0000644000175000017500000000211311354224223016322 00000000000000 Pot limit .10/.25 poker-engine-1.3.6/conf/poker..05..10-limit.xml0000644000175000017500000000171411354224223015527 00000000000000 Limit .05/.10 poker-engine-1.3.6/conf/poker.10-15-limit.xml0000644000175000017500000000175411354224223015377 00000000000000 Limit 15/30 poker-engine-1.3.6/conf/poker.ante-5-10-limit.xml0000644000175000017500000000174511354224223016243 00000000000000 Limit 5/10 poker-engine-1.3.6/conf/poker.1-2-limit.xml0000644000175000017500000000173011354224223015225 00000000000000 Limit 1/2 poker-engine-1.3.6/conf/poker.3-6-pot-limit.xml0000644000175000017500000000212411354224223016031 00000000000000 Pot limit 3/6 poker-engine-1.3.6/conf/poker..25..50-limit.xml0000644000175000017500000000172511354224223015537 00000000000000 Limit .25/.50 poker-engine-1.3.6/conf/poker.level-15-30-no-limit.xml0000644000175000017500000000213411354224223017111 00000000000000 No limit 15/30 poker-engine-1.3.6/conf/poker..05-.10-limit.xml0000644000175000017500000000171311354224223015525 00000000000000 Limit .05/.10 poker-engine-1.3.6/conf/poker.levels-blinds.xml0000644000175000017500000000242711354224223016361 00000000000000 poker-engine-1.3.6/conf/poker..05-.10-pot-limit.xml0000644000175000017500000000211111354224223016316 00000000000000 Pot limit .05/.10 poker-engine-1.3.6/conf/poker.50-100-limit.xml0000644000175000017500000000176511354224223015460 00000000000000 Limit 50/100 poker-engine-1.3.6/conf/poker.7stud.xml0000644000175000017500000000312111354224223014654 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/conf/poker.30-60-limit.xml0000644000175000017500000000175511354224223015402 00000000000000 Limit 30/60 poker-engine-1.3.6/conf/poker..02..04-limit.xml0000644000175000017500000000170511354224223015527 00000000000000 Limit .02/.04 poker-engine-1.3.6/conf/poker.5-10-limit.xml0000644000175000017500000000174211354224223015313 00000000000000 Limit 5/10 poker-engine-1.3.6/conf/poker..50-1-pot-limit.xml0000644000175000017500000000212511354224223016165 00000000000000 Pot limit .50/1 poker-engine-1.3.6/conf/poker.ante-3-6-limit.xml0000644000175000017500000000173611354224223016166 00000000000000 Limit 3/6 poker-engine-1.3.6/conf/poker.10-20-no-limit.xml0000644000175000017500000000200311354224223015771 00000000000000 No limit 10/20 poker-engine-1.3.6/conf/poker.2-4-limit.xml0000644000175000017500000000173311354224223015233 00000000000000 Limit 2/4 poker-engine-1.3.6/conf/poker.level-10-20-no-limit.xml0000644000175000017500000000213411354224223017103 00000000000000 No limit 10/20 poker-engine-1.3.6/conf/ante-limit.template0000644000175000017500000000202210427052643015551 00000000000000 Limit _DESC_ poker-engine-1.3.6/conf/poker.level-2-4-limit.xml0000644000175000017500000000203011354224223016327 00000000000000 Limit 2/4 poker-engine-1.3.6/conf/limit.template0000644000175000017500000000201210427052643014623 00000000000000 Limit _DESC_ poker-engine-1.3.6/conf/poker.5-10-no-limit.xml0000644000175000017500000000177611354224223015734 00000000000000 No limit 5/10 poker-engine-1.3.6/conf/pot-limit.template0000644000175000017500000000217610427052643015436 00000000000000 Pot limit _DESC_ poker-engine-1.3.6/conf/poker..01-.02-pot-limit.xml0000644000175000017500000000207411354224223016323 00000000000000 Pot limit .01/.02 poker-engine-1.3.6/conf/poker.ante-.25-.50-limit.xml0000644000175000017500000000172711354224223016465 00000000000000 Limit .25/.50 poker-engine-1.3.6/conf/poker.100-200-limit.xml0000644000175000017500000000177611354224223015537 00000000000000 Limit 100/200 poker-engine-1.3.6/conf/poker.level-10-15-pot-limit.xml0000644000175000017500000000227511354224223017303 00000000000000 Pot limit 10/15 poker-engine-1.3.6/conf/poker.5-10-pot-limit.xml0000644000175000017500000000214311354224223016107 00000000000000 Pot limit 5/10 poker-engine-1.3.6/conf/poker..10-.25-limit.xml0000644000175000017500000000172111354224223015526 00000000000000 Limit .10/.25 poker-engine-1.3.6/conf/poker..05-.10-no-limit.xml0000644000175000017500000000174411354224223016143 00000000000000 No limit .05/.10 poker-engine-1.3.6/conf/poker..25-.50-no-limit.xml0000644000175000017500000000174611354224223016153 00000000000000 No limit .25/.50 poker-engine-1.3.6/conf/poker.payouts.xml0000644000175000017500000000421211354224223015314 00000000000000 100 70 30 50 30 20 40 24 16 12 8 30 20 12.5 9 8 6.5 5 4 3 2 30 19.5 12 8 6.5 5 3.5 2.5 1.75 1.25 1 1 1 1 1 1 1 1 1 1 25 15 10 8 5 4 3 2 1.75 1.25 1 1 1 1 1 1 1 1 1 1 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 20 12.5 9 7 5 4 3 1.75 1.5 1.25 1 1 1 1 1 1 1 1 1 1 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 20 12 9 7 5 4 3 1.75 1.5 1.25 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 20 12 8 6 5 4 2.5 1.75 1.25 1 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 poker-engine-1.3.6/conf/poker.ante-.04-.08-limit.xml0000644000175000017500000000171211354224223016457 00000000000000 Limit .04/.08 poker-engine-1.3.6/conf/poker.ante-.10-.20-limit.xml0000644000175000017500000000172511354224223016452 00000000000000 Limit .10/.20 poker-engine-1.3.6/conf/poker..25-.50-pot-limit.xml0000644000175000017500000000211311354224223016326 00000000000000 Pot limit .25/.50 poker-engine-1.3.6/conf/poker..10-.25-no-limit.xml0000644000175000017500000000174611354224223016147 00000000000000 No limit .10/.25 poker-engine-1.3.6/conf/poker.4-8-limit.xml0000644000175000017500000000173411354224223015242 00000000000000 Limit 4/8 poker-engine-1.3.6/conf/poker.ante-2-4-limit.xml0000644000175000017500000000173611354224223016163 00000000000000 Limit 2/4 poker-engine-1.3.6/conf/poker.ante-30-60-limit.xml0000644000175000017500000000176111354224223016324 00000000000000 Limit 30/60 poker-engine-1.3.6/conf/poker.100-200-no-limit.xml0000644000175000017500000000202711354224223016137 00000000000000 No limit 100/200 poker-engine-1.3.6/conf/poker.2-4-no-limit.xml0000644000175000017500000000175711354224223015653 00000000000000 No limit 2/4 poker-engine-1.3.6/pokerconfigupgrade.8.in0000644000175000017500000000450611344205422015403 00000000000000.\" .\" Copyright (C) 2006 - 2010 Loic Dachary .\" Copyright (C) 2005, 2006 Mekensleep .\" .\" Mekensleep .\" 26 rue des rosiers .\" 75004 Paris .\" licensing@mekensleep.com .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 3 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. .\" .\" Authors: .\" Loic Dachary .\" .TH pokerconfigupgrade 8 local .SH NAME pokerconfigupgrade \- upgrade poker XML configuration files to match the software version .SH SYNOPSIS pokerconfigupgrade [--module=] [--help] [--verbose=] [--dry-run] [--upgrades=] [--reference=] [directory or file.xml] ... .SH DESCRIPTION Apply the XSL files found in the upgrades directory to upgrade the configuration files given in argument to reach the same version as the config software module. .SH OPTIONS .TP .B --upgrades= Get the XSL files from .B . .TP .B --reference= Requires that a single directory is provided in argument. The files that exist in .B but not in the target directory provided in argument are copied. The files that exist in the target directory but not in the reference are removed. The files that exists in both directories are upgraded if necessary. .TP .B --verbose= Set the verbosity level. 0 (the default) means silent. 1 means print comments about actions taken. .TP .B --module= Use the .B .config module instead of the default pokerengine.pokerengineconfig module. .TP .B --dry-run Do not actually do the upgrade but run the code anyways. .TP .B --help Print help message and exit. . .SH AUTHORS Loic Dachary poker-engine-1.3.6/tests/0002755000175000017500000000000011540702077012254 500000000000000poker-engine-1.3.6/tests/test-pokerengineconfig.py.in0000644000175000017500000004522411344205422017623 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest import libxml2 import os.path import types import shutil import tempfile from pokerengine import version from pokerengine import version_number from pokerengine import pokerengineconfig class PokerEngineConfigTestCase(unittest.TestCase): TestConfDirectory = '@srcdir@/test-data/conf' TestUpgradeDirectory = '@srcdir@/test-data/upgrade' TestConfigInvalidFile = 'unittest.config.invalid.xml' TestConfigNotFoundFile = 'unittest.config.notfound.xml' TestConfigTemplateFile = 'unittest.config.template.xml' TestUpgradeInvalidFile = 'unittest.config.invalid.xsl' TestUpgradeTemplateFile = 'unittest.config.template.xsl' TestConfigTemporaryFile = 'unittest.config.xml' # ----------------------------------------------------------------------------------------------------- def setUp(self): self.verbose = int(os.environ.get('VERBOSE_T', 1)) pokerengineconfig.Config.verbose = self.verbose def callback(ctx, str): if self.verbose >= 0: print "%s %s" % (ctx, str) libxml2.registerErrorHandler(callback, "-->") self.Config = pokerengineconfig.Config(['.', PokerEngineConfigTestCase.TestConfDirectory, '~/conf', tempfile.gettempdir()]) self.ConfigTmplFile = os.path.join(PokerEngineConfigTestCase.TestConfDirectory, PokerEngineConfigTestCase.TestConfigTemplateFile) self.ConfigTempFile = os.path.join(tempfile.gettempdir(), PokerEngineConfigTestCase.TestConfigTemporaryFile) self.UpgradeTmplFile = os.path.join(PokerEngineConfigTestCase.TestUpgradeDirectory, PokerEngineConfigTestCase.TestUpgradeTemplateFile) self.UpgradeInvalidFile = os.path.join(PokerEngineConfigTestCase.TestUpgradeDirectory, PokerEngineConfigTestCase.TestUpgradeInvalidFile) if not self.CopyFile(self.ConfigTmplFile, self.ConfigTempFile): self.fail('Error during creation of configuration file ' + self.ConfigTempFile) # ----------------------------------------------------------------------------------------------------- def tearDown(self): # self.DeleteFile(self.ConfigTempFile) pass # ----------------------------------------------------------------------------------------------------- def testHeaderGet(self): """Test Poker Engine : Get header value""" if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'TestHeader', {'key' : 'val'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) pokerengineconfig.Config.upgrades_repository = None self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.failUnlessEqual(self.Config.headerGet('/bet/TestHeader/@key'), 'val') # ----------------------------------------------------------------------------------------------------- def testHeaderSet(self): """Test Poker Engine : Set header value""" if not self.ModifyXMLFile(self.ConfigTempFile, '/bet','TestHeader', {'key1' : 'val1'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) pokerengineconfig.Config.upgrades_repository = None self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.Config.headerSet('/bet/TestHeader/@key1','val2') self.failUnlessEqual(self.Config.headerGet('/bet/TestHeader/@key1'), 'val2') # Attribut not found self.failUnlessRaises(IndexError,self.Config.headerSet,'/bet/TestHeader/@key2','val2') self.failUnlessEqual(self.Config.headerGet('/bet/TestHeader/@key2'), '') # ----------------------------------------------------------------------------------------------------- def testHeaderGetInt(self): """Test Poker Engine : Get attribute value as integer""" if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'TestInt', {'int' : '500'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) pokerengineconfig.Config.upgrades_repository = None self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.failUnlessEqual(self.Config.headerGetInt('/bet/TestInt/@int'),500) if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'TestInt', {'int' : 'AB'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) self.Config.reload() self.failUnlessEqual(self.Config.headerGetInt('/bet/TestInt/@int'), 0) # ----------------------------------------------------------------------------------------------------- def testHeaderGetList(self): """Test Poker Engine : Get list""" if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'TestList', {'attribute1' : 'val1', 'attribute2' : 'val2', 'attribute3' : 'val3'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) pokerengineconfig.Config.upgrades_repository = None self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) values = self.Config.headerGetList('/bet/TestList/@*') values.sort() self.failUnlessEqual(values, ['val1', 'val2', 'val3']) # ----------------------------------------------------------------------------------------------------- def testHeaderGetProperties(self): """Test Poker Engine : Get properties""" properties = {'attribute1' : 'val1', 'attribute2' : 'val2', 'attribute3' : 'val3'} if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'TestProperties', properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) pokerengineconfig.Config.upgrades_repository = None self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.failUnlessEqual(self.Config.headerGetProperties('/bet/TestProperties')[0], properties) # ----------------------------------------------------------------------------------------------------- def testSave(self): """Test Poker Engine : Save""" if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', None, {'attribute1' : 'val1'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) self.failUnlessEqual(self.Config.save(), None) self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.failUnlessEqual(self.Config.save(), None) # ----------------------------------------------------------------------------------------------------- def testConfigLoadFileNotFound(self): """Test Poker Engine : Load file not found""" self.failIf(self.Config.load(PokerEngineConfigTestCase.TestConfigNotFoundFile)) # ----------------------------------------------------------------------------------------------------- def testConfigLoadInvalidFile(self): """Test Poker Engine : Load invalid file""" self.failUnlessRaises(libxml2.parserError,self.Config.load,PokerEngineConfigTestCase.TestConfigInvalidFile) # ----------------------------------------------------------------------------------------------------- def testConfigLoadValidFile(self): """Test Poker Engine : Load file""" if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', None, {'poker_engine_version' : version_number}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) pokerengineconfig.Config.upgrades_repository = None self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) pokerengineconfig.Config.upgrades_repository = './NotFound' self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) pokerengineconfig.Config.upgrades_repository = PokerEngineConfigTestCase.TestUpgradeDirectory self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) # ----------------------------------------------------------------------------------------------------- def testConfigReload(self): """Test Poker Engine : Reload file""" if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'TestReload', {'key' : 'val1'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) pokerengineconfig.Config.upgrades_repository = None self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) key_value = self.Config.headerGet('/bet/TestReload/@key') self.failUnlessEqual(key_value, 'val1') if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'TestReload', {'key' : 'val2'}): self.fail('Error during configuration file modification' + self.ConfigTempFile) key_value = self.Config.headerGet('/bet/TestReload/@key') self.failUnlessEqual(key_value, 'val1') self.Config.reload() key_value = self.Config.headerGet('/bet/TestReload/@key') self.failUnlessEqual(key_value, 'val2') # ----------------------------------------------------------------------------------------------------- def testConfigCheckVersionUpToDate(self): """Test Poker Engine : Check version up to date""" pokerengineconfig.Config.upgrades_repository = None if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', None, {'poker_engine_version' : version_number}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.failUnless(self.Config.checkVersion('poker_engine_version',version_number,None)) # ----------------------------------------------------------------------------------------------------- def testConfigCheckVersionWithoutVersion(self): """Test Poker Engine : Check file version without version attribute""" pokerengineconfig.Config.upgrades_repository = None if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', None): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Save the version information pokerengineconfig.Config.upgrade_dry_run = False self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.failUnless(self.Config.checkVersion('poker_engine_version',version_number,None,version_number)) self.Config.reload() self.failUnlessEqual(self.Config.headerGet('/bet/@poker_engine_version'), version_number) # ----------------------------------------------------------------------------------------------------- def testConfigCheckVersionWithInvalidVersion(self): """Test Poker Engine : Check file version with invalid version attribute""" pokerengineconfig.Config.upgrades_repository = None ver = version.Version(version_number) if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', None, {'poker_engine_version' : str(ver + 1)}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.failUnlessRaises(Exception,self.Config.checkVersion,'poker_engine_version',str(ver), None) # ----------------------------------------------------------------------------------------------------- def testConfigCheckVersionUpgrade(self): """Test Poker Engine : Check file version upgrade""" pokerengineconfig.Config.upgrade_dry_run = True pokerengineconfig.Config.upgrades_repository = None ver = version.Version(version_number) if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', None, {'poker_engine_version' : str(ver), 'upgrade' : 'ToUpgrade'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) self.failIf(self.Config.checkVersion('poker_engine_version',str(ver+1),None)) upgrade_file = 'upgrade' + str(ver) + '-' + str(ver + 1) + '.xsl' upgrade_file = os.path.join(tempfile.gettempdir(),upgrade_file) if not self.CopyFile(self.UpgradeTmplFile, upgrade_file): self.fail('Error during creation of upgrade file ' + upgrade_file) pokerengineconfig.Config.upgrade_dry_run = False self.failIf(self.Config.checkVersion('poker_engine_version',str(ver+1),tempfile.gettempdir())) self.failUnlessEqual(self.Config.headerGet('/bet/@upgrade'), 'Upgraded') self.DeleteFile(upgrade_file) # ----------------------------------------------------------------------------------------------------- def testConfigCheckVersionInvalidUpgrade(self): """Test Poker Engine : Check file version invalid upgrade""" pokerengineconfig.Config.upgrade_dry_run = False pokerengineconfig.Config.upgrades_repository = None ver = version.Version(version_number) if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', None, {'poker_engine_version' : str(ver), 'upgrade' : 'ToUpgrade'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) self.failUnless(self.Config.load(PokerEngineConfigTestCase.TestConfigTemporaryFile)) upgrade_file = 'upgrade' + str(ver) + '-' + str(ver + 1) + '.xsl' upgrade_file = os.path.join(tempfile.gettempdir(),upgrade_file) if not self.CopyFile(self.UpgradeInvalidFile, upgrade_file): self.fail('Error during creation of upgrade file ' + upgrade_file) self.failUnlessRaises(libxml2.parserError,self.Config.checkVersion, 'poker_engine_version',str(ver+1),tempfile.gettempdir()) self.DeleteFile(upgrade_file) # ----------------------------------------------------------------------------------------------------- def ModifyXMLFile(self, path, parent, child, attributes = {}): try: doc = libxml2.parseFile(path) except libxml2.parserError: return False header = doc.xpathNewContext() node_parent = doc.getRootElement() if parent: nodes = header.xpathEval(parent) if nodes: node_parent = nodes[0] else: return False node = node_parent if child: child_path = node_parent.nodePath() + '/' + child nodes = header.xpathEval(child_path) if nodes: node = nodes[0] else: node = node_parent.newChild(ns = None, name = child, content = None) for attribute_name, attribute_value in attributes.items(): if not node.hasProp(attribute_name): node.newProp(attribute_name,attribute_value) else: for property in node.properties: if property.name == attribute_name: property.setContent(attribute_value) doc.saveFile(path) doc.freeDoc() header.xpathFreeContext() return True # ----------------------------------------------------------------------------------------------------- def CopyFile(self, src_path, dst_path): if src_path and not os.path.isfile(src_path): return False shutil.copyfile(src_path,dst_path) if os.path.isfile(dst_path): return True return False # ----------------------------------------------------------------------------------------------------- def DeleteFile(self, path): if os.path.isfile(path): os.unlink(path) # ----------------------------------------------------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerEngineConfigTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(PokerEngineConfigTestCase, prefix = "test2")) return suite # ----------------------------------------------------------------------------------------------------- def GetTestedModule(): return pokerengineconfig # ----------------------------------------------------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # ----------------------------------------------------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-pokerengineconfig.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokerengineconfig.py' TESTS='coverage-reset test-pokerengineconfig.py coverage-report' check )" # End: poker-engine-1.3.6/tests/coverage.py0000644000175000017500000012155711014254431014342 00000000000000#!/usr/bin/python # # Perforce Defect Tracking Integration Project # # # COVERAGE.PY -- COVERAGE TESTING # # Gareth Rees, Ravenbrook Limited, 2001-12-04 # Ned Batchelder, 2004-12-12 # http://nedbatchelder.com/code/modules/coverage.html # # # 1. INTRODUCTION # # This module provides coverage testing for Python code. # # The intended readership is all Python developers. # # This document is not confidential. # # See [GDR 2001-12-04a] for the command-line interface, programmatic # interface and limitations. See [GDR 2001-12-04b] for requirements and # design. r"""Usage: coverage.py -x [-p] MODULE.py [ARG1 ARG2 ...] Execute module, passing the given command-line arguments, collecting coverage data. With the -p option, write to a temporary file containing the machine name and process ID. coverage.py -e Erase collected coverage data. coverage.py -c Collect data from multiple coverage files (as created by -p option above) and store it into a single file representing the union of the coverage. coverage.py -r [-m] [-o dir1,dir2,...] FILE1 FILE2 ... Report on the statement coverage for the given files. With the -m option, show line numbers of the statements that weren't executed. coverage.py -a [-d dir] [-o dir1,dir2,...] FILE1 FILE2 ... Make annotated copies of the given files, marking statements that are executed with > and statements that are missed with !. With the -d option, make the copies in that directory. Without the -d option, make each copy in the same directory as the original. -o dir,dir2,... Omit reporting or annotating files when their filename path starts with a directory listed in the omit list. e.g. python coverage.py -i -r -o c:\python23,lib\enthought\traits Coverage data is saved in the file .coverage by default. Set the COVERAGE_FILE environment variable to save it somewhere else.""" __version__ = "2.78.20070930" # see detailed history at the end of this file. import compiler import compiler.visitor import glob import os import re import string import symbol import sys import threading import token import types from socket import gethostname # Python version compatibility try: strclass = basestring # new to 2.3 except: strclass = str # 2. IMPLEMENTATION # # This uses the "singleton" pattern. # # The word "morf" means a module object (from which the source file can # be deduced by suitable manipulation of the __file__ attribute) or a # filename. # # When we generate a coverage report we have to canonicalize every # filename in the coverage dictionary just in case it refers to the # module we are reporting on. It seems a shame to throw away this # information so the data in the coverage dictionary is transferred to # the 'cexecuted' dictionary under the canonical filenames. # # The coverage dictionary is called "c" and the trace function "t". The # reason for these short names is that Python looks up variables by name # at runtime and so execution time depends on the length of variables! # In the bottleneck of this application it's appropriate to abbreviate # names to increase speed. class StatementFindingAstVisitor(compiler.visitor.ASTVisitor): """ A visitor for a parsed Abstract Syntax Tree which finds executable statements. """ def __init__(self, statements, excluded, suite_spots): compiler.visitor.ASTVisitor.__init__(self) self.statements = statements self.excluded = excluded self.suite_spots = suite_spots self.excluding_suite = 0 def doRecursive(self, node): for n in node.getChildNodes(): self.dispatch(n) visitStmt = visitModule = doRecursive def doCode(self, node): if hasattr(node, 'decorators') and node.decorators: self.dispatch(node.decorators) self.recordAndDispatch(node.code) else: self.doSuite(node, node.code) visitFunction = visitClass = doCode def getFirstLine(self, node): # Find the first line in the tree node. lineno = node.lineno for n in node.getChildNodes(): f = self.getFirstLine(n) if lineno and f: lineno = min(lineno, f) else: lineno = lineno or f return lineno def getLastLine(self, node): # Find the first line in the tree node. lineno = node.lineno for n in node.getChildNodes(): lineno = max(lineno, self.getLastLine(n)) return lineno def doStatement(self, node): self.recordLine(self.getFirstLine(node)) visitAssert = visitAssign = visitAssTuple = visitPrint = \ visitPrintnl = visitRaise = visitSubscript = visitDecorators = \ doStatement def visitPass(self, node): # Pass statements have weird interactions with docstrings. If this # pass statement is part of one of those pairs, claim that the statement # is on the later of the two lines. l = node.lineno if l: lines = self.suite_spots.get(l, [l,l]) self.statements[lines[1]] = 1 def visitDiscard(self, node): # Discard nodes are statements that execute an expression, but then # discard the results. This includes function calls, so we can't # ignore them all. But if the expression is a constant, the statement # won't be "executed", so don't count it now. if node.expr.__class__.__name__ != 'Const': self.doStatement(node) def recordNodeLine(self, node): # Stmt nodes often have None, but shouldn't claim the first line of # their children (because the first child might be an ignorable line # like "global a"). if node.__class__.__name__ != 'Stmt': return self.recordLine(self.getFirstLine(node)) else: return 0 def recordLine(self, lineno): # Returns a bool, whether the line is included or excluded. if lineno: # Multi-line tests introducing suites have to get charged to their # keyword. if lineno in self.suite_spots: lineno = self.suite_spots[lineno][0] # If we're inside an excluded suite, record that this line was # excluded. if self.excluding_suite: self.excluded[lineno] = 1 return 0 # If this line is excluded, or suite_spots maps this line to # another line that is exlcuded, then we're excluded. elif self.excluded.has_key(lineno) or \ self.suite_spots.has_key(lineno) and \ self.excluded.has_key(self.suite_spots[lineno][1]): return 0 # Otherwise, this is an executable line. else: self.statements[lineno] = 1 return 1 return 0 default = recordNodeLine def recordAndDispatch(self, node): self.recordNodeLine(node) self.dispatch(node) def doSuite(self, intro, body, exclude=0): exsuite = self.excluding_suite if exclude or (intro and not self.recordNodeLine(intro)): self.excluding_suite = 1 self.recordAndDispatch(body) self.excluding_suite = exsuite def doPlainWordSuite(self, prevsuite, suite): # Finding the exclude lines for else's is tricky, because they aren't # present in the compiler parse tree. Look at the previous suite, # and find its last line. If any line between there and the else's # first line are excluded, then we exclude the else. lastprev = self.getLastLine(prevsuite) firstelse = self.getFirstLine(suite) for l in range(lastprev+1, firstelse): if self.suite_spots.has_key(l): self.doSuite(None, suite, exclude=self.excluded.has_key(l)) break else: self.doSuite(None, suite) def doElse(self, prevsuite, node): if node.else_: self.doPlainWordSuite(prevsuite, node.else_) def visitFor(self, node): self.doSuite(node, node.body) self.doElse(node.body, node) visitWhile = visitFor def visitIf(self, node): # The first test has to be handled separately from the rest. # The first test is credited to the line with the "if", but the others # are credited to the line with the test for the elif. self.doSuite(node, node.tests[0][1]) for t, n in node.tests[1:]: self.doSuite(t, n) self.doElse(node.tests[-1][1], node) def visitTryExcept(self, node): self.doSuite(node, node.body) for i in range(len(node.handlers)): a, b, h = node.handlers[i] if not a: # It's a plain "except:". Find the previous suite. if i > 0: prev = node.handlers[i-1][2] else: prev = node.body self.doPlainWordSuite(prev, h) else: self.doSuite(a, h) self.doElse(node.handlers[-1][2], node) def visitTryFinally(self, node): self.doSuite(node, node.body) self.doPlainWordSuite(node.body, node.final) def visitWith(self, node): self.doSuite(node, node.body) def visitGlobal(self, node): # "global" statements don't execute like others (they don't call the # trace function), so don't record their line numbers. pass the_coverage = None class CoverageException(Exception): pass class coverage: # Name of the cache file (unless environment variable is set). cache_default = ".coverage" # Environment variable naming the cache file. cache_env = "COVERAGE_FILE" # A dictionary with an entry for (Python source file name, line number # in that file) if that line has been executed. c = {} # A map from canonical Python source file name to a dictionary in # which there's an entry for each line number that has been # executed. cexecuted = {} # Cache of results of calling the analysis2() method, so that you can # specify both -r and -a without doing double work. analysis_cache = {} # Cache of results of calling the canonical_filename() method, to # avoid duplicating work. canonical_filename_cache = {} def __init__(self): global the_coverage if the_coverage: raise CoverageException("Only one coverage object allowed.") self.usecache = 1 self.cache = None self.parallel_mode = False self.exclude_re = '' self.nesting = 0 self.cstack = [] self.xstack = [] self.relative_dir = os.path.normcase(os.path.abspath(os.curdir)+os.sep) self.exclude('# *pragma[: ]*[nN][oO] *[cC][oO][vV][eE][rR]') # t(f, x, y). This method is passed to sys.settrace as a trace function. # See [van Rossum 2001-07-20b, 9.2] for an explanation of sys.settrace and # the arguments and return value of the trace function. # See [van Rossum 2001-07-20a, 3.2] for a description of frame and code # objects. def t(self, f, w, unused): #pragma: no cover if w == 'line': #print "Executing %s @ %d" % (f.f_code.co_filename, f.f_lineno) self.c[(f.f_code.co_filename, f.f_lineno)] = 1 for c in self.cstack: c[(f.f_code.co_filename, f.f_lineno)] = 1 return self.t def help(self, error=None): #pragma: no cover if error: print error print print __doc__ sys.exit(1) def command_line(self, argv, help_fn=None): import getopt help_fn = help_fn or self.help settings = {} optmap = { '-a': 'annotate', '-c': 'collect', '-d:': 'directory=', '-e': 'erase', '-h': 'help', '-i': 'ignore-errors', '-m': 'show-missing', '-p': 'parallel-mode', '-r': 'report', '-x': 'execute', '-o:': 'omit=', } short_opts = string.join(map(lambda o: o[1:], optmap.keys()), '') long_opts = optmap.values() options, args = getopt.getopt(argv, short_opts, long_opts) for o, a in options: if optmap.has_key(o): settings[optmap[o]] = 1 elif optmap.has_key(o + ':'): settings[optmap[o + ':']] = a elif o[2:] in long_opts: settings[o[2:]] = 1 elif o[2:] + '=' in long_opts: settings[o[2:]+'='] = a else: #pragma: no cover pass # Can't get here, because getopt won't return anything unknown. if settings.get('help'): help_fn() for i in ['erase', 'execute']: for j in ['annotate', 'report', 'collect']: if settings.get(i) and settings.get(j): help_fn("You can't specify the '%s' and '%s' " "options at the same time." % (i, j)) args_needed = (settings.get('execute') or settings.get('annotate') or settings.get('report')) action = (settings.get('erase') or settings.get('collect') or args_needed) if not action: help_fn("You must specify at least one of -e, -x, -c, -r, or -a.") if not args_needed and args: help_fn("Unexpected arguments: %s" % " ".join(args)) self.parallel_mode = settings.get('parallel-mode') self.get_ready() if settings.get('erase'): self.erase() if settings.get('execute'): if not args: help_fn("Nothing to do.") sys.argv = args self.start() import __main__ sys.path[0] = os.path.dirname(sys.argv[0]) execfile(sys.argv[0], __main__.__dict__) if settings.get('collect'): self.collect() if not args: args = self.cexecuted.keys() ignore_errors = settings.get('ignore-errors') show_missing = settings.get('show-missing') directory = settings.get('directory=') omit = settings.get('omit=') if omit is not None: omit = omit.split(',') else: omit = [] if settings.get('report'): self.report(args, show_missing, ignore_errors, omit_prefixes=omit) if settings.get('annotate'): self.annotate(args, directory, ignore_errors, omit_prefixes=omit) def use_cache(self, usecache, cache_file=None): self.usecache = usecache if cache_file and not self.cache: self.cache_default = cache_file def get_ready(self, parallel_mode=False): if self.usecache and not self.cache: self.cache = os.environ.get(self.cache_env, self.cache_default) if self.parallel_mode: self.cache += "." + gethostname() + "." + str(os.getpid()) self.restore() self.analysis_cache = {} def start(self, parallel_mode=False): self.get_ready() if self.nesting == 0: #pragma: no cover sys.settrace(self.t) if hasattr(threading, 'settrace'): threading.settrace(self.t) self.nesting += 1 def stop(self): self.nesting -= 1 if self.nesting == 0: #pragma: no cover sys.settrace(None) if hasattr(threading, 'settrace'): threading.settrace(None) def erase(self): self.get_ready() self.c = {} self.analysis_cache = {} self.cexecuted = {} if self.cache and os.path.exists(self.cache): os.remove(self.cache) def exclude(self, re): if self.exclude_re: self.exclude_re += "|" self.exclude_re += "(" + re + ")" def begin_recursive(self): self.cstack.append(self.c) self.xstack.append(self.exclude_re) def end_recursive(self): self.c = self.cstack.pop() self.exclude_re = self.xstack.pop() # save(). Save coverage data to the coverage cache. def save(self): if self.usecache and self.cache: self.canonicalize_filenames() cache = open(self.cache, 'wb') import marshal marshal.dump(self.cexecuted, cache) cache.close() # restore(). Restore coverage data from the coverage cache (if it exists). def restore(self): self.c = {} self.cexecuted = {} assert self.usecache if os.path.exists(self.cache): self.cexecuted = self.restore_file(self.cache) def restore_file(self, file_name): try: cache = open(file_name, 'rb') import marshal cexecuted = marshal.load(cache) cache.close() if isinstance(cexecuted, types.DictType): return cexecuted else: return {} except: return {} # collect(). Collect data in multiple files produced by parallel mode def collect(self): cache_dir, local = os.path.split(self.cache) for f in os.listdir(cache_dir or '.'): if not f.startswith(local): continue full_path = os.path.join(cache_dir, f) cexecuted = self.restore_file(full_path) self.merge_data(cexecuted) def merge_data(self, new_data): for file_name, file_data in new_data.items(): if self.cexecuted.has_key(file_name): self.merge_file_data(self.cexecuted[file_name], file_data) else: self.cexecuted[file_name] = file_data def merge_file_data(self, cache_data, new_data): for line_number in new_data.keys(): if not cache_data.has_key(line_number): cache_data[line_number] = new_data[line_number] # canonical_filename(filename). Return a canonical filename for the # file (that is, an absolute path with no redundant components and # normalized case). See [GDR 2001-12-04b, 3.3]. def canonical_filename(self, filename): if not self.canonical_filename_cache.has_key(filename): f = filename if os.path.isabs(f) and not os.path.exists(f): f = os.path.basename(f) if not os.path.isabs(f): for path in [os.curdir] + sys.path: g = os.path.join(path, f) if os.path.exists(g): f = g break cf = os.path.normcase(os.path.abspath(f)) self.canonical_filename_cache[filename] = cf return self.canonical_filename_cache[filename] # canonicalize_filenames(). Copy results from "c" to "cexecuted", # canonicalizing filenames on the way. Clear the "c" map. def canonicalize_filenames(self): for filename, lineno in self.c.keys(): if filename == '': # Can't do anything useful with exec'd strings, so skip them. continue f = self.canonical_filename(filename) if not self.cexecuted.has_key(f): self.cexecuted[f] = {} self.cexecuted[f][lineno] = 1 self.c = {} # morf_filename(morf). Return the filename for a module or file. def morf_filename(self, morf): if isinstance(morf, types.ModuleType): if not hasattr(morf, '__file__'): raise CoverageException("Module has no __file__ attribute.") f = morf.__file__ else: f = morf return self.canonical_filename(f) # analyze_morf(morf). Analyze the module or filename passed as # the argument. If the source code can't be found, raise an error. # Otherwise, return a tuple of (1) the canonical filename of the # source code for the module, (2) a list of lines of statements # in the source code, (3) a list of lines of excluded statements, # and (4), a map of line numbers to multi-line line number ranges, for # statements that cross lines. def analyze_morf(self, morf): if self.analysis_cache.has_key(morf): return self.analysis_cache[morf] filename = self.morf_filename(morf) ext = os.path.splitext(filename)[1] if ext == '.pyc': if not os.path.exists(filename[:-1]): raise CoverageException( "No source for compiled code '%s'." % filename ) filename = filename[:-1] source = open(filename, 'r') try: lines, excluded_lines, line_map = self.find_executable_statements( source.read(), exclude=self.exclude_re ) except SyntaxError, synerr: raise CoverageException( "Couldn't parse '%s' as Python source: '%s' at line %d" % (filename, synerr.msg, synerr.lineno) ) source.close() result = filename, lines, excluded_lines, line_map self.analysis_cache[morf] = result return result def first_line_of_tree(self, tree): while True: if len(tree) == 3 and type(tree[2]) == type(1): return tree[2] tree = tree[1] def last_line_of_tree(self, tree): while True: if len(tree) == 3 and type(tree[2]) == type(1): return tree[2] tree = tree[-1] def find_docstring_pass_pair(self, tree, spots): for i in range(1, len(tree)): if self.is_string_constant(tree[i]) and self.is_pass_stmt(tree[i+1]): first_line = self.first_line_of_tree(tree[i]) last_line = self.last_line_of_tree(tree[i+1]) self.record_multiline(spots, first_line, last_line) def is_string_constant(self, tree): try: return tree[0] == symbol.stmt and tree[1][1][1][0] == symbol.expr_stmt except: return False def is_pass_stmt(self, tree): try: return tree[0] == symbol.stmt and tree[1][1][1][0] == symbol.pass_stmt except: return False def record_multiline(self, spots, i, j): for l in range(i, j+1): spots[l] = (i, j) def get_suite_spots(self, tree, spots): """ Analyze a parse tree to find suite introducers which span a number of lines. """ for i in range(1, len(tree)): if type(tree[i]) == type(()): if tree[i][0] == symbol.suite: # Found a suite, look back for the colon and keyword. lineno_colon = lineno_word = None for j in range(i-1, 0, -1): if tree[j][0] == token.COLON: # Colons are never executed themselves: we want the # line number of the last token before the colon. lineno_colon = self.last_line_of_tree(tree[j-1]) elif tree[j][0] == token.NAME: if tree[j][1] == 'elif': # Find the line number of the first non-terminal # after the keyword. t = tree[j+1] while t and token.ISNONTERMINAL(t[0]): t = t[1] if t: lineno_word = t[2] else: lineno_word = tree[j][2] break elif tree[j][0] == symbol.except_clause: # "except" clauses look like: # ('except_clause', ('NAME', 'except', lineno), ...) if tree[j][1][0] == token.NAME: lineno_word = tree[j][1][2] break if lineno_colon and lineno_word: # Found colon and keyword, mark all the lines # between the two with the two line numbers. self.record_multiline(spots, lineno_word, lineno_colon) # "pass" statements are tricky: different versions of Python # treat them differently, especially in the common case of a # function with a doc string and a single pass statement. self.find_docstring_pass_pair(tree[i], spots) elif tree[i][0] == symbol.simple_stmt: first_line = self.first_line_of_tree(tree[i]) last_line = self.last_line_of_tree(tree[i]) if first_line != last_line: self.record_multiline(spots, first_line, last_line) self.get_suite_spots(tree[i], spots) def find_executable_statements(self, text, exclude=None): # Find lines which match an exclusion pattern. excluded = {} suite_spots = {} if exclude: reExclude = re.compile(exclude) lines = text.split('\n') for i in range(len(lines)): if reExclude.search(lines[i]): excluded[i+1] = 1 # Parse the code and analyze the parse tree to find out which statements # are multiline, and where suites begin and end. import parser tree = parser.suite(text+'\n\n').totuple(1) self.get_suite_spots(tree, suite_spots) #print "Suite spots:", suite_spots # Use the compiler module to parse the text and find the executable # statements. We add newlines to be impervious to final partial lines. statements = {} ast = compiler.parse(text+'\n\n') visitor = StatementFindingAstVisitor(statements, excluded, suite_spots) compiler.walk(ast, visitor, walker=visitor) lines = statements.keys() lines.sort() excluded_lines = excluded.keys() excluded_lines.sort() return lines, excluded_lines, suite_spots # format_lines(statements, lines). Format a list of line numbers # for printing by coalescing groups of lines as long as the lines # represent consecutive statements. This will coalesce even if # there are gaps between statements, so if statements = # [1,2,3,4,5,10,11,12,13,14] and lines = [1,2,5,10,11,13,14] then # format_lines will return "1-2, 5-11, 13-14". def format_lines(self, statements, lines): pairs = [] i = 0 j = 0 start = None pairs = [] while i < len(statements) and j < len(lines): if statements[i] == lines[j]: if start == None: start = lines[j] end = lines[j] j = j + 1 elif start: pairs.append((start, end)) start = None i = i + 1 if start: pairs.append((start, end)) def stringify(pair): start, end = pair if start == end: return "%d" % start else: return "%d-%d" % (start, end) ret = string.join(map(stringify, pairs), ", ") return ret # Backward compatibility with version 1. def analysis(self, morf): f, s, _, m, mf = self.analysis2(morf) return f, s, m, mf def analysis2(self, morf): filename, statements, excluded, line_map = self.analyze_morf(morf) self.canonicalize_filenames() if not self.cexecuted.has_key(filename): self.cexecuted[filename] = {} missing = [] for line in statements: lines = line_map.get(line, [line, line]) for l in range(lines[0], lines[1]+1): if self.cexecuted[filename].has_key(l): break else: missing.append(line) return (filename, statements, excluded, missing, self.format_lines(statements, missing)) def relative_filename(self, filename): """ Convert filename to relative filename from self.relative_dir. """ return filename.replace(self.relative_dir, "") def morf_name(self, morf): """ Return the name of morf as used in report. """ if isinstance(morf, types.ModuleType): return morf.__name__ else: return self.relative_filename(os.path.splitext(morf)[0]) def filter_by_prefix(self, morfs, omit_prefixes): """ Return list of morfs where the morf name does not begin with any one of the omit_prefixes. """ filtered_morfs = [] for morf in morfs: for prefix in omit_prefixes: if self.morf_name(morf).startswith(prefix): break else: filtered_morfs.append(morf) return filtered_morfs def morf_name_compare(self, x, y): return cmp(self.morf_name(x), self.morf_name(y)) def report(self, morfs, show_missing=1, ignore_errors=0, file=None, omit_prefixes=[]): if not isinstance(morfs, types.ListType): morfs = [morfs] # On windows, the shell doesn't expand wildcards. Do it here. globbed = [] for morf in morfs: if isinstance(morf, strclass): globbed.extend(glob.glob(morf)) else: globbed.append(morf) morfs = globbed morfs = self.filter_by_prefix(morfs, omit_prefixes) morfs.sort(self.morf_name_compare) max_name = max([5,] + map(len, map(self.morf_name, morfs))) fmt_name = "%%- %ds " % max_name fmt_err = fmt_name + "%s: %s" header = fmt_name % "Name" + " Stmts Exec Cover" fmt_coverage = fmt_name + "% 6d % 6d % 5d%%" if show_missing: header = header + " Missing" fmt_coverage = fmt_coverage + " %s" if not file: file = sys.stdout print >>file, header print >>file, "-" * len(header) total_statements = 0 total_executed = 0 for morf in morfs: name = self.morf_name(morf) try: _, statements, _, missing, readable = self.analysis2(morf) n = len(statements) m = n - len(missing) if n > 0: pc = 100.0 * m / n else: pc = 100.0 args = (name, n, m, pc) if show_missing: args = args + (readable,) print >>file, fmt_coverage % args total_statements = total_statements + n total_executed = total_executed + m except KeyboardInterrupt: #pragma: no cover raise except: if not ignore_errors: typ, msg = sys.exc_info()[:2] print >>file, fmt_err % (name, typ, msg) if len(morfs) > 1: print >>file, "-" * len(header) if total_statements > 0: pc = 100.0 * total_executed / total_statements else: pc = 100.0 args = ("TOTAL", total_statements, total_executed, pc) if show_missing: args = args + ("",) print >>file, fmt_coverage % args # annotate(morfs, ignore_errors). blank_re = re.compile(r"\s*(#|$)") else_re = re.compile(r"\s*else\s*:\s*(#|$)") def annotate(self, morfs, directory=None, ignore_errors=0, omit_prefixes=[]): morfs = self.filter_by_prefix(morfs, omit_prefixes) for morf in morfs: try: filename, statements, excluded, missing, _ = self.analysis2(morf) self.annotate_file(filename, statements, excluded, missing, directory) except KeyboardInterrupt: raise except: if not ignore_errors: raise def annotate_file(self, filename, statements, excluded, missing, directory=None): source = open(filename, 'r') if directory: dest_file = os.path.join(directory, os.path.basename(filename) + ',cover') else: dest_file = filename + ',cover' dest = open(dest_file, 'w') lineno = 0 i = 0 j = 0 covered = 1 while 1: line = source.readline() if line == '': break lineno = lineno + 1 while i < len(statements) and statements[i] < lineno: i = i + 1 while j < len(missing) and missing[j] < lineno: j = j + 1 if i < len(statements) and statements[i] == lineno: covered = j >= len(missing) or missing[j] > lineno if self.blank_re.match(line): dest.write(' ') elif self.else_re.match(line): # Special logic for lines containing only 'else:'. # See [GDR 2001-12-04b, 3.2]. if i >= len(statements) and j >= len(missing): dest.write('! ') elif i >= len(statements) or j >= len(missing): dest.write('> ') elif statements[i] == missing[j]: dest.write('! ') else: dest.write('> ') elif lineno in excluded: dest.write('- ') elif covered: dest.write('> ') else: dest.write('! ') dest.write(line) source.close() dest.close() # Singleton object. the_coverage = coverage() # Module functions call methods in the singleton object. def use_cache(*args, **kw): return the_coverage.use_cache(*args, **kw) def start(*args, **kw): return the_coverage.start(*args, **kw) def stop(*args, **kw): return the_coverage.stop(*args, **kw) def erase(*args, **kw): return the_coverage.erase(*args, **kw) def begin_recursive(*args, **kw): return the_coverage.begin_recursive(*args, **kw) def end_recursive(*args, **kw): return the_coverage.end_recursive(*args, **kw) def exclude(*args, **kw): return the_coverage.exclude(*args, **kw) def analysis(*args, **kw): return the_coverage.analysis(*args, **kw) def analysis2(*args, **kw): return the_coverage.analysis2(*args, **kw) def report(*args, **kw): return the_coverage.report(*args, **kw) def annotate(*args, **kw): return the_coverage.annotate(*args, **kw) def annotate_file(*args, **kw): return the_coverage.annotate_file(*args, **kw) # Save coverage data when Python exits. (The atexit module wasn't # introduced until Python 2.0, so use sys.exitfunc when it's not # available.) try: import atexit atexit.register(the_coverage.save) except ImportError: sys.exitfunc = the_coverage.save # Command-line interface. if __name__ == '__main__': the_coverage.command_line(sys.argv[1:]) # A. REFERENCES # # [GDR 2001-12-04a] "Statement coverage for Python"; Gareth Rees; # Ravenbrook Limited; 2001-12-04; # . # # [GDR 2001-12-04b] "Statement coverage for Python: design and # analysis"; Gareth Rees; Ravenbrook Limited; 2001-12-04; # . # # [van Rossum 2001-07-20a] "Python Reference Manual (releae 2.1.1)"; # Guide van Rossum; 2001-07-20; # . # # [van Rossum 2001-07-20b] "Python Library Reference"; Guido van Rossum; # 2001-07-20; . # # # B. DOCUMENT HISTORY # # 2001-12-04 GDR Created. # # 2001-12-06 GDR Added command-line interface and source code # annotation. # # 2001-12-09 GDR Moved design and interface to separate documents. # # 2001-12-10 GDR Open cache file as binary on Windows. Allow # simultaneous -e and -x, or -a and -r. # # 2001-12-12 GDR Added command-line help. Cache analysis so that it # only needs to be done once when you specify -a and -r. # # 2001-12-13 GDR Improved speed while recording. Portable between # Python 1.5.2 and 2.1.1. # # 2002-01-03 GDR Module-level functions work correctly. # # 2002-01-07 GDR Update sys.path when running a file with the -x option, # so that it matches the value the program would get if it were run on # its own. # # 2004-12-12 NMB Significant code changes. # - Finding executable statements has been rewritten so that docstrings and # other quirks of Python execution aren't mistakenly identified as missing # lines. # - Lines can be excluded from consideration, even entire suites of lines. # - The filesystem cache of covered lines can be disabled programmatically. # - Modernized the code. # # 2004-12-14 NMB Minor tweaks. Return 'analysis' to its original behavior # and add 'analysis2'. Add a global for 'annotate', and factor it, adding # 'annotate_file'. # # 2004-12-31 NMB Allow for keyword arguments in the module global functions. # Thanks, Allen. # # 2005-12-02 NMB Call threading.settrace so that all threads are measured. # Thanks Martin Fuzzey. Add a file argument to report so that reports can be # captured to a different destination. # # 2005-12-03 NMB coverage.py can now measure itself. # # 2005-12-04 NMB Adapted Greg Rogers' patch for using relative filenames, # and sorting and omitting files to report on. # # 2006-07-23 NMB Applied Joseph Tate's patch for function decorators. # # 2006-08-21 NMB Applied Sigve Tjora and Mark van der Wal's fixes for argument # handling. # # 2006-08-22 NMB Applied Geoff Bache's parallel mode patch. # # 2006-08-23 NMB Refactorings to improve testability. Fixes to command-line # logic for parallel mode and collect. # # 2006-08-25 NMB "#pragma: nocover" is excluded by default. # # 2006-09-10 NMB Properly ignore docstrings and other constant expressions that # appear in the middle of a function, a problem reported by Tim Leslie. # Minor changes to avoid lint warnings. # # 2006-09-17 NMB coverage.erase() shouldn't clobber the exclude regex. # Change how parallel mode is invoked, and fix erase() so that it erases the # cache when called programmatically. # # 2007-07-21 NMB In reports, ignore code executed from strings, since we can't # do anything useful with it anyway. # Better file handling on Linux, thanks Guillaume Chazarain. # Better shell support on Windows, thanks Noel O'Boyle. # Python 2.2 support maintained, thanks Catherine Proulx. # # 2007-07-22 NMB Python 2.5 now fully supported. The method of dealing with # multi-line statements is now less sensitive to the exact line that Python # reports during execution. Pass statements are handled specially so that their # disappearance during execution won't throw off the measurement. # # 2007-07-23 NMB Now Python 2.5 is *really* fully supported: the body of the # new with statement is counted as executable. # # 2007-07-29 NMB Better packaging. # # 2007-09-30 NMB Don't try to predict whether a file is Python source based on # the extension. Extensionless files are often Pythons scripts. Instead, simply # parse the file and catch the syntax errors. Hat tip to Ben Finney. # C. COPYRIGHT AND LICENCE # # Copyright 2001 Gareth Rees. All rights reserved. # Copyright 2004-2007 Ned Batchelder. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the # distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. # # $Id: coverage.py 3935 2008-05-19 10:40:25Z loic $ poker-engine-1.3.6/tests/Makefile.in0000644000175000017500000004355111540702065014244 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/allin.py.in $(srcdir)/blinds.py.in \ $(srcdir)/bugs.py.in $(srcdir)/buyin.py.in \ $(srcdir)/chips.py.in $(srcdir)/deal.py.in \ $(srcdir)/eval.py.in $(srcdir)/history.py.in \ $(srcdir)/libxml2leak.py.in $(srcdir)/muck.py.in \ $(srcdir)/positions.py.in $(srcdir)/run.in $(srcdir)/sit.py.in \ $(srcdir)/test-game.py.in $(srcdir)/test-gamehistory.py.in \ $(srcdir)/test-i18n.py.in $(srcdir)/test-pokercards.py.in \ $(srcdir)/test-pokerchips.py.in \ $(srcdir)/test-pokerengineconfig.py.in \ $(srcdir)/test-pokerplayer.py.in \ $(srcdir)/test-pokerprizes.py.in \ $(srcdir)/test-pokerrake.py.in \ $(srcdir)/test-pokertournament.py.in \ $(srcdir)/test-version.py.in $(srcdir)/tournament.py.in \ $(srcdir)/upgrades.py.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = run allin.py blinds.py buyin.py bugs.py chips.py \ deal.py eval.py history.py muck.py positions.py sit.py \ tournament.py upgrades.py libxml2leak.py test-gamehistory.py \ test-pokercards.py test-pokerengineconfig.py \ test-pokertournament.py test-pokerprizes.py test-game.py \ test-pokerchips.py test-pokerrake.py test-pokerplayer.py \ test-version.py test-i18n.py CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgdatadir = @pkgdatadir@ pkglibdir = @pkglibdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POKER_ENGINE_PKGDATADIR = @POKER_ENGINE_PKGDATADIR@ POKER_ENGINE_PKGLIBDIR = @POKER_ENGINE_PKGLIBDIR@ POKER_ENGINE_PKGSYSCONFDIR = @POKER_ENGINE_PKGSYSCONFDIR@ PYPOKER_EVAL_CFLAGS = @PYPOKER_EVAL_CFLAGS@ PYPOKER_EVAL_LIBS = @PYPOKER_EVAL_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RSYNC = @RSYNC@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pkgsysconfdir = @pkgsysconfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # # MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = \ coverage.py \ __init__.py \ testmessages.py \ test-data/pokerrake.py \ bugs.py \ $(wildcard conf/*.xml) \ $(wildcard test-data/conf/*.xml) \ $(wildcard test-data/upgrade/*.xsl) TESTS_ENVIRONMENT = ./run TESTS = coverage-reset test-*.py history.py deal.py positions.py tournament.py allin.py chips.py blinds.py sit.py upgrades.py muck.py libxml2leak.py coverage-report all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): run: $(top_builddir)/config.status $(srcdir)/run.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ allin.py: $(top_builddir)/config.status $(srcdir)/allin.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ blinds.py: $(top_builddir)/config.status $(srcdir)/blinds.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ buyin.py: $(top_builddir)/config.status $(srcdir)/buyin.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ bugs.py: $(top_builddir)/config.status $(srcdir)/bugs.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ chips.py: $(top_builddir)/config.status $(srcdir)/chips.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ deal.py: $(top_builddir)/config.status $(srcdir)/deal.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ eval.py: $(top_builddir)/config.status $(srcdir)/eval.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ history.py: $(top_builddir)/config.status $(srcdir)/history.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ muck.py: $(top_builddir)/config.status $(srcdir)/muck.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ positions.py: $(top_builddir)/config.status $(srcdir)/positions.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ sit.py: $(top_builddir)/config.status $(srcdir)/sit.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ tournament.py: $(top_builddir)/config.status $(srcdir)/tournament.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ upgrades.py: $(top_builddir)/config.status $(srcdir)/upgrades.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ libxml2leak.py: $(top_builddir)/config.status $(srcdir)/libxml2leak.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-gamehistory.py: $(top_builddir)/config.status $(srcdir)/test-gamehistory.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-pokercards.py: $(top_builddir)/config.status $(srcdir)/test-pokercards.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-pokerengineconfig.py: $(top_builddir)/config.status $(srcdir)/test-pokerengineconfig.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-pokertournament.py: $(top_builddir)/config.status $(srcdir)/test-pokertournament.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-pokerprizes.py: $(top_builddir)/config.status $(srcdir)/test-pokerprizes.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-game.py: $(top_builddir)/config.status $(srcdir)/test-game.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-pokerchips.py: $(top_builddir)/config.status $(srcdir)/test-pokerchips.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-pokerrake.py: $(top_builddir)/config.status $(srcdir)/test-pokerrake.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-pokerplayer.py: $(top_builddir)/config.status $(srcdir)/test-pokerplayer.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-version.py: $(top_builddir)/config.status $(srcdir)/test-version.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-i18n.py: $(top_builddir)/config.status $(srcdir)/test-i18n.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ tags: TAGS TAGS: ctags: CTAGS CTAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-local distclean distclean-generic distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am export PYTHON clean-local: rm -fr .coverage annotated */*.py[oc] export top_srcdir .PHONY: coverage-reset coverage-report # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: poker-engine-1.3.6/tests/test-pokertournament.py.in0000644000175000017500000015033311344205422017362 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2009 Bradley M. Kuhn # Copyright (C) 2006 Mekensleep # 26 rue des rosiers, 75004 Paris # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest import os.path import types import time class ConstantPlayerShuffler: def shuffle(self, what): what.sort() from tests.testmessages import restore_all_messages, silence_all_messages, search_output, clear_all_messages, get_messages from pokerengine import pokergame from pokerengine import pokertournament from pokerengine import pokerprizes pokertournament.shuffler = ConstantPlayerShuffler() class PokerTournamentTestCase(unittest.TestCase): TestConfDirectory = '@top_srcdir@/conf' # --------------------------------------------------------- def setUp(self): self.dirs = ['.', PokerTournamentTestCase.TestConfDirectory, '~/conf'] # ------------------------------------------------------- def tearDown(self): pass # ------------------------------------------------------- def testTournamentDefaultInitialisation(self): """Test Poker Tournament : Default initialisation""" arguments = { \ 'dirs' : self.dirs, \ 'name' : 'no name', \ 'description_short' : 'nodescription_short', \ 'description_long' : 'nodescription_long', \ 'serial' : 1, \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)), \ 'players_quota' : 10, \ 'variant' : 'holdem', \ 'betting_structure' : 'level-15-30-no-limit', \ 'seats_per_game' : 10, \ 'sit_n_go' : 'y', \ 'register_time' : 0, \ 'start_time' : 0, \ 'breaks_interval' : 60, \ 'rebuy_delay' : 0, \ 'add_on' : 0, \ 'add_on_delay' : 60, \ 'prizes_specs' : 'table', \ } tournament = pokertournament.PokerTournament(**arguments) for attribute, value in arguments.items(): self.failUnlessEqual(getattr(tournament,attribute), value) self.failUnlessEqual(tournament.players, []) self.failUnlessEqual(tournament.winners, []) self.failIf(tournament.need_balance) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) self.failUnlessEqual(tournament.registered, 0) self.failUnless(tournament.can_register) # ------------------------------------------------------- def testTournamentInitialisation(self): """Test Poker Tournament : Initialisation""" arguments = { \ 'dirs' : self.dirs, \ 'name' : 'Test', \ 'description_short' : 'ShortDescription', \ 'description_long' : 'LongDescription', \ 'serial' : 3, \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)), \ 'players_quota' : 20, \ 'variant' : 'variant', \ 'betting_structure' : 'config', \ 'seats_per_game' : 2, \ 'sit_n_go' : 'n', \ 'register_time' : time.time() + 60, \ 'start_time' : '2006/04/22 12:00', \ 'breaks_interval' : 120, \ 'rebuy_delay' : 30, \ 'add_on' : 10, \ 'add_on_delay' : 120, \ 'prizes_specs' : 'table', \ } tournament = pokertournament.PokerTournament(**arguments) for attribute, value in arguments.items(): if attribute == 'start_time': value = int(time.mktime(time.strptime(value, "%Y/%m/%d %H:%M"))) self.failUnlessEqual(getattr(tournament,attribute), value) self.failUnlessEqual(tournament.players, []) self.failUnlessEqual(tournament.winners, []) self.failIf(tournament.need_balance) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_ANNOUNCED) self.failUnlessEqual(tournament.registered, 0) self.failIf(tournament.can_register) # TODO Payout # ------------------------------------------------------- def testUpdateRegistering(self): """Test Poker Tournament : Update registering""" arguments = { \ 'dirs' : self.dirs, \ 'register_time' : time.time() + 3, \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_ANNOUNCED) self.failUnless((tournament.register_time - time.time()) > 0.0) self.failUnless(tournament.updateRegistering() > 0.0) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_ANNOUNCED) time.sleep(4) self.failIf((tournament.register_time - time.time()) > 0.0) self.failUnlessEqual(tournament.updateRegistering(), -1) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) self.failUnlessEqual(tournament.updateRegistering(), -1) # ------------------------------------------------------- def testRegister(self): """Test Poker Tounament : Register""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 25, \ 'players_min' : 20, \ 'start_time' : time.time() + 20000, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) # The tournament has been created and players can be regsitered self.failUnless(tournament.can_register) self.failUnlessEqual(tournament.players, []) self.failUnlessEqual(tournament.registered, 0) # The player 1 can be registered self.failIf(tournament.isRegistered(1)) self.failUnless(tournament.canRegister(1)) # Register the player self.failUnless(tournament.register(1)) self.failUnlessEqual(tournament.players, [1]) self.failUnlessEqual(tournament.registered, 1) self.failUnless(tournament.isRegistered(1)) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) # The player 1 can be registered self.failIf(tournament.isRegistered(2)) self.failUnless(tournament.canRegister(2)) # Register the player self.failUnless(tournament.register(2)) self.failUnlessEqual(tournament.players, [1, 2]) self.failUnlessEqual(tournament.registered, 2) self.failUnless(tournament.isRegistered(2)) # Change the tournament state tournament.changeState(pokertournament.TOURNAMENT_STATE_RUNNING) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_RUNNING) # Players can not be regsitered self.failIf(tournament.canRegister(3)) self.failIf(tournament.register(3)) tournament.can_register = True # Register the player self.failUnless(tournament.can_register) self.failUnless(tournament.canRegister(3)) self.failUnless(tournament.register(3)) # ------------------------------------------------------- def testChangeState(self): """Test Poker Tournament : Change state""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) # Iniitalize state to TOURNAMENT_STATE_ANNOUNCED tournament.state = pokertournament.TOURNAMENT_STATE_ANNOUNCED self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_ANNOUNCED) # Go to state TOURNAMENT_STATE_REGISTERING tournament.changeState(pokertournament.TOURNAMENT_STATE_REGISTERING) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) # Try to go return to TOURNAMENT_STATE_ANNOUNCED tournament.changeState(pokertournament.TOURNAMENT_STATE_ANNOUNCED) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) # Go to state TOURNAMENT_STATE_RUNNING tournament.changeState(pokertournament.TOURNAMENT_STATE_RUNNING) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_RUNNING) # Go to state TOURNAMENT_STATE_COMPLETE tournament.changeState(pokertournament.TOURNAMENT_STATE_COMPLETE) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_COMPLETE) # ------------------------------------------------------- def testCanUnregister(self): """Test Poker Tounament : Can unregister""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 2, \ 'sit_n_go' : 'y', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) self.failIf(tournament.canUnregister(1)) self.failUnless(tournament.register(1)) self.failUnless(tournament.canUnregister(1)) self.failUnless(tournament.register(2)) self.failIfEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) self.failIf(tournament.canUnregister(1)) # ------------------------------------------------------- def testUnregister(self): """Test Poker Tounament : Unregister""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 2, \ 'sit_n_go' : 'y', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) self.failUnless(tournament.register(1)) self.failUnlessEqual(tournament.players, [1]) self.failUnlessEqual(tournament.registered, 1) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) self.failUnless(tournament.unregister(1)) self.failUnlessEqual(tournament.players, []) self.failUnlessEqual(tournament.registered, 0) self.failUnless(tournament.register(1)) self.failUnless(tournament.register(2)) self.failIfEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) self.failIf(tournament.unregister(1)) # ------------------------------------------------------- def testCreateGames(self): """Test Poker Tournament : Create games""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 10, \ 'players_min' : 10, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 3, \ 'sit_n_go' : 'n', \ 'variant' : 'holdem', \ 'betting_structure' : 'level-15-30-no-limit', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) nplayers = 9 for player in xrange(1,nplayers+1): self.failUnless(tournament.register(player)) self.failUnlessEqual(tournament.registered, nplayers) self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_REGISTERING) self.failUnlessEqual(tournament.id2game, {}) tournament.createGames() self.failUnlessEqual(len(tournament.id2game), nplayers / tournament.seats_per_game) self.failUnlessEqual(len(tournament.games), nplayers / tournament.seats_per_game) id = 1 for game in tournament.games: self.failUnlessEqual(game.max_players, tournament.seats_per_game) self.failUnlessEqual(game.allCount(), tournament.seats_per_game) self.failUnlessEqual(game.variant, 'holdem') self.failUnlessEqual(game.id, id) id += 1 for serial in game.serial2player: self.failUnless(game.serial2player[serial].isSit()) self.failUnless(game.serial2player[serial].isBuyInPayed()) self.failUnless(game.serial2player[serial].isAutoBlindAnte()) self.failIf(game.is_open) # ------------------------------------------------------- def testPrizesSnG(self): """Test Poker Tournament : Prizes for SnG tournaments""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 20, \ 'buy_in' : 100, \ 'seats_per_game' : 2, \ 'sit_n_go' : 'y', \ 'prizes_specs' : 'table', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) prizes = tournament.prizes() self.failUnless(tournament.register(1)) self.assertEquals(prizes, tournament.prizes()) self.failUnless(tournament.unregister(1)) self.assertEquals(prizes, tournament.prizes()) # ------------------------------------------------------- def testPrizesGuaranteeAmount(self): """Test Poker Tournament : Prizes for tournaments with guarantee amount""" prize_min = 1000 arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 2, \ 'buy_in' : 100, \ 'seats_per_game' : 2, \ 'prize_min' : prize_min, \ 'start_time' : time.time() + 20000, \ 'sit_n_go' : 'n', \ 'prizes_specs' : 'table', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) self.assertEquals(prize_min, tournament.prizes()[0]) # ------------------------------------------------------- def testPrizesRegular(self): """Test Poker Tournament : Prizes for regular tournaments""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 40, \ 'buy_in' : 100, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 2, \ 'sit_n_go' : 'n', \ 'prizes_specs' : 'table', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } # # PrizesTable # tournament = pokertournament.PokerTournament(**arguments) for player in range(1, 21): self.failUnless(tournament.register(player)) self.failUnlessEqual(tournament.registered, 20) p = pokerprizes.__dict__['PokerPrizesTable'](buy_in_amount = 100, player_count = 20, config_dirs = self.dirs) self.failUnlessEqual(tournament.prizes_object.player_count, p.player_count) self.failUnlessEqual(tournament.prizes_object.buy_in, p.buy_in) self.failUnlessEqual(tournament.prizes(), p.getPrizes()) # # register/unregister updates the prizes a new player # self.assertEquals(True, tournament.register(21)) self.failUnlessEqual(tournament.registered, 21) self.failIfEqual(tournament.prizes(), p.getPrizes()) tournament.unregister(21) self.failUnlessEqual(tournament.prizes(), p.getPrizes()) # # PrizesAlgorithm # arguments['prizes_specs'] = 'algorithm' tournament = pokertournament.PokerTournament(**arguments) for player in range(20): self.failUnless(tournament.register(player)) p = pokerprizes.__dict__['PokerPrizesAlgorithm'](buy_in_amount = 100, player_count = 20) self.failUnlessEqual(tournament.prizes_object.player_count, p.player_count) self.failUnlessEqual(tournament.prizes_object.buy_in, p.buy_in) self.failUnlessEqual(tournament.prizes(), p.getPrizes()) # # Invalid prizes_specs # arguments['prizes_specs'] = 'invalid' caught = False try: tournament = pokertournament.PokerTournament(**arguments) except Exception, e: caught = True self.failUnless('PokerPrizesInvalid' in str(e)) self.assertTrue(caught) return # ------------------------------------------------------- def testMovePlayer(self): """Test Poker Tournament : Move player""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 25, \ 'players_min' : 20, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) for player in range(12): self.failUnless(tournament.register(player)) tournament.createGames() tournament.removePlayer(tournament.games[0].id, tournament.games[0].serialsAll()[0]) move = pokertournament.equalizeGames(tournament.games) self.failUnlessEqual(move, [(2, 1, 3), (3, 1, 0), (3, 1, 1)]) from_game = tournament.id2game[move[0][0]] to_game = tournament.id2game[move[0][1]] player = from_game.getPlayer(move[0][2]) player.name = 'Player' player.setUserData('UserData') player.sit_out = True player.bot = True self.failUnlessEqual(from_game.allCount(), 4) self.failUnlessEqual(to_game.allCount(), 2) tournament.movePlayer(from_game.id, to_game.id, player.serial) self.failUnlessEqual(from_game.allCount(), 3) self.failUnlessEqual(to_game.allCount(), 3) player = to_game.getPlayer(move[0][2]) self.failUnlessEqual(player.name, 'Player') self.failUnlessEqual(player.getUserData(), 'UserData') self.failUnless(player.isSitOut()) self.failUnless(player.isBot()) # ------------------------------------------------------- def testEqualizeCandidates(self): """Test Poker Tournament : Equalize candidates""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 20, \ 'players_min' : 15, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) for player in range(12): self.failUnless(tournament.register(player)) tournament.createGames() want, provide = pokertournament.equalizeCandidates(tournament.games) # Since balanceGames() is called by createGames(), we should find # these results. self.failUnlessEqual(len(want), 0) self.failUnlessEqual(len(provide), 3) self.failUnlessEqual(want, []) self.failUnlessEqual(provide, [(1, []), (2, [3]), (3, [0, 1])]) # Remove one from three and he should have one fewer to provide tournament.removePlayer(tournament.games[2].id, tournament.games[2].serialsAll()[0]) want, provide = pokertournament.equalizeCandidates(tournament.games) self.failUnlessEqual(len(want), 0) self.failUnlessEqual(len(provide), 3) self.failUnlessEqual(provide, [(1, []), (2, [3]), (3, [1])]) # ------------------------------------------------------- def testEqualizeGames(self): """Test Poker Tournament : Equalize games""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 25, \ 'players_min' : 20, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } # Tournament => 2 complete games (6 players) tournament = pokertournament.PokerTournament(**arguments) for player in range(10): self.failUnless(tournament.register(player)) # Create games tournament.createGames() # Check games self.failUnlessEqual(len(tournament.games), 2) self.failUnlessEqual(tournament.games[0].allCount(), 5) self.failUnlessEqual(tournament.games[1].allCount(), 5) # No need to equalize game self.failUnlessEqual(pokertournament.equalizeGames(tournament.games, 3, None), []) # Tournament => 3 , has two tables of 3, then two tables of 5 tournament = pokertournament.PokerTournament(**arguments) for player in range(16): self.failUnless(tournament.register(player)) # Create games tournament.createGames() # Check games self.failUnlessEqual(len(tournament.games), 4) self.failUnlessEqual(tournament.games[0].allCount(), 3) self.failUnlessEqual(tournament.games[1].allCount(), 3) self.failUnlessEqual(tournament.games[2].allCount(), 5) self.failUnlessEqual(tournament.games[3].allCount(), 5) # Nothing to equalize at first self.failUnlessEqual(pokertournament.equalizeGames(tournament.games, int(os.environ.get('VERBOSE_T', 3)), sys.stdout.write), []) # Remove one player from first table, means players from 3 must be redistributed tournament.removePlayer(tournament.games[0].id, tournament.games[0].serialsAll()[0]) self.failUnlessEqual(pokertournament.equalizeGames(tournament.games, int(os.environ.get('VERBOSE_T', 3)), sys.stdout.write), [(3, 1, 1), (3, 1, 2), (4, 1, 0)]) # ------------------------------------------------------- def testBreakGame(self): """Test Poker Tournament : Break game""" to_break = { \ 'id' : 1, \ 'to_add' : [], \ 'running' : True, \ 'seats_left' : 0, \ 'serials' : [1, 2] \ } to_fill_1 = { \ 'id' : 2, \ 'to_add' : [], \ 'running' : False, \ 'seats_left' : 2, \ 'serials' : [3, 4] \ } to_fill_2 = { \ 'id' : 3, \ 'to_add' : [], \ 'running' : False, \ 'seats_left' : 2, \ 'serials' : [5, 6] \ } self.failIf(pokertournament.breakGame(to_break, [to_fill_1])) to_break['to_add'] = [2] to_break['running'] = False self.failIf(pokertournament.breakGame(to_break, [to_fill_1])) to_break['to_add'] = [] to_break['running'] = True self.failIf(pokertournament.breakGame(to_break, [to_fill_1])) to_break['running'] = False to_fill_1['seats_left'] = len(to_break['serials']) - 1 self.failIf(pokertournament.breakGame(to_break, [to_fill_1])) to_fill_1['seats_left'] = len(to_break['serials']) self.failUnlessEqual(pokertournament.breakGame(to_break, [to_fill_1]), [(1, 2, [1, 2])]) to_fill_1['seats_left'] = len(to_break['serials']) - 1 to_fill_2['seats_left'] = 1 self.failUnlessEqual(pokertournament.breakGame(to_break, [to_fill_1, to_fill_2]), [(1, 3, [1]), (1, 2, [2])]) # ------------------------------------------------------- def testBreakGames(self): """Test Poker Tournament : Break games""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 50, \ 'players_min' : 25, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) for player in range(12): self.failUnless(tournament.register(player)) tournament.createGames() self.failUnlessEqual(len(tournament.games), 3) self.failUnlessEqual(tournament.games[0].allCount(), 3) self.failUnlessEqual(tournament.games[1].allCount(), 4) self.failUnlessEqual(tournament.games[2].allCount(), 5) # This remove leaves us with 2, 4, 5, which means that nothing can be broken. tournament.removePlayer(tournament.games[0].id, tournament.games[0].serialsAll()[0]) self.failUnlessEqual(pokertournament.breakGames(tournament.games), []) # This will leave us with 2, 4, 4, which means table 0 can be broken, and one player # wil be sent to each table. tournament.removePlayer(tournament.games[2].id, tournament.games[2].serialsAll()[0]) player1 = tournament.games[0].serialsAll()[0] player2 = tournament.games[0].serialsAll()[1] self.failUnlessEqual(pokertournament.breakGames(tournament.games), [(1, 3, [player1]), (1, 2, [player2])]) # Impossible to break less than 2 game self.failUnlessEqual(pokertournament.breakGames([tournament.games[0]]), []) def testBalanceGamesRunning(self): """Test Poker Tournament : Balance games when state RUNNING""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 20, \ 'players_min' : 15, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) # Register the players for player in range(12): self.failUnless(tournament.register(player)) # Note: balanceGames() is called by createGames() so initially, # the tables will be balanced as 3 players at first table, 4 at # second, and 5 at third. (This doesn't sound all that balanced, # but it's consistent with the algorithm in # pokertournament.equalizeGames() tournament.createGames() tournament.state = pokertournament.TOURNAMENT_STATE_RUNNING self.failUnlessEqual(len(tournament.games[0].serialsAll()), 3) self.failUnlessEqual(len(tournament.games[1].serialsAll()), 4) self.failUnlessEqual(len(tournament.games[2].serialsAll()), 5) # Remove one player from every game. tournament.removePlayer(tournament.games[0].id, tournament.games[0].serialsAll()[0]) tournament.removePlayer(tournament.games[1].id, tournament.games[1].serialsAll()[0]) tournament.removePlayer(tournament.games[2].id, tournament.games[2].serialsAll()[0]) # Get the players of the first game player1 = tournament.games[0].serialsAll()[0] player2 = tournament.games[0].serialsAll()[1] # Ensure that the first game is the one selected for breaking self.failUnlessEqual(pokertournament.breakGames(tournament.games), [(1, 3, [player1]), (1, 2, [player2])]) # Test the balancing. First, ensure that the players are still at # the first game self.failUnless(tournament.id2game[1].getPlayer(player1)) self.failIf(tournament.id2game[2].getPlayer(player1)) self.failIf(tournament.id2game[3].getPlayer(player1)) self.failUnless(tournament.id2game[1].getPlayer(player2)) self.failIf(tournament.id2game[2].getPlayer(player2)) self.failIf(tournament.id2game[3].getPlayer(player2)) self.failUnless(tournament.balanceGames()) self.failUnlessEqual(len(tournament.id2game), 2) self.failUnless(tournament.id2game[3].getPlayer(player1)) self.failUnless(tournament.id2game[2].getPlayer(player2)) self.failIf(tournament.need_balance) # ------------------------------------------------------- def testBalanceGamesRegistering(self): """Test Poker Tournament : Balance games when state REGISTERING""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 20, \ 'players_min' : 15, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) # Register the players for player in range(12): self.failUnless(tournament.register(player)) # Note: balanceGames() is called by createGames() so initially, # the tables will be balanced as 3 players at first table, 4 at # second, and 5 at third. (This doesn't sound all that balanced, # but it's consistent with the algorithm in # pokertournament.equalizeGames() tournament.createGames() self.failUnlessEqual(len(tournament.games[0].serialsAll()), 3) self.failUnlessEqual(len(tournament.games[1].serialsAll()), 4) self.failUnlessEqual(len(tournament.games[2].serialsAll()), 5) # Remove one player from every game. tournament.removePlayer(tournament.games[0].id, tournament.games[0].serialsAll()[0]) tournament.removePlayer(tournament.games[1].id, tournament.games[1].serialsAll()[0]) tournament.removePlayer(tournament.games[2].id, tournament.games[2].serialsAll()[0]) # Get the players of the first game player1 = tournament.games[0].serialsAll()[0] player2 = tournament.games[0].serialsAll()[1] # Ensure that the first game is the one selected for breaking self.failUnlessEqual(pokertournament.breakGames(tournament.games), [(1, 3, [player1]), (1, 2, [player2])]) # Test the balancing. First, ensure that the players are still at # the first game self.failUnless(tournament.id2game[1].getPlayer(player1)) self.failIf(tournament.id2game[2].getPlayer(player1)) self.failIf(tournament.id2game[3].getPlayer(player1)) self.failUnless(tournament.id2game[1].getPlayer(player2)) self.failIf(tournament.id2game[2].getPlayer(player2)) self.failIf(tournament.id2game[3].getPlayer(player2)) self.failUnless(tournament.balanceGames()) self.failUnlessEqual(len(tournament.id2game), 2) self.failUnless(tournament.id2game[3].getPlayer(player1)) self.failUnless(tournament.id2game[2].getPlayer(player2)) self.failIf(tournament.need_balance) # Create a new tournament where is no need to break a game arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 20, \ 'players_min' : 15, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) # Register the players for player in range(12): self.failUnless(tournament.register(player)) # As above, note: balanceGames() is called by createGames() so # initially, the tables will be balanced as 3 players at first # table, 4 at second, and 5 at third. (This doesn't sound all # that balanced, but it's consistent with the algorithm in # pokertournament.equalizeGames() tournament.createGames() self.failUnlessEqual(len(tournament.games[0].serialsAll()), 3) self.failUnlessEqual(len(tournament.games[1].serialsAll()), 4) self.failUnlessEqual(len(tournament.games[2].serialsAll()), 5) # ...therefore, no table balancing should be needed ... so # equalizeGames() should return nothing, and balance games should # be False. self.failUnlessEqual(pokertournament.equalizeGames(tournament.games), []) self.failIf(tournament.balanceGames()) # ------------------------------------------------------- def testEndTurn(self): """Test Poker Tournament : End turn""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 10, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'y', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) # Register the players for player in range(10): self.failUnless(tournament.register(player)) # 2 games (5 players) self.failUnlessEqual(len(tournament.games), 2) # Ten players in the tournament self.failUnlessEqual(len(tournament.players), 10) # Get created games game1 = tournament.id2game[1] game2 = tournament.id2game[2] # Game 2, players 1, 2, 3 broke players = game2.playersAll() for num in range(3): players[num].money = 0 self.failUnless(game2.isBroke(players[num].serial)) self.failUnlessEqual(game2.brokeCount(), 3) # End turn of game 2 self.failUnless(tournament.endTurn(2)) # Players broke removed # Game balanced self.failUnlessEqual(len(game1.playersAll()), 3) self.failUnlessEqual(len(game2.playersAll()), 4) # Game 2 players broke players = game2.playersAll() for num in range(len(players)): players[num].money = 0 self.failUnless(game2.isBroke(players[num].serial)) # End turn of game 2 self.failUnless(tournament.endTurn(2)) # Game 2 break self.failUnlessEqual(len(tournament.games), 1) # All the players of game 1 are borke except one players = game1.playersAll() for num in range(len(players) - 1): players[num].money = 0 self.failUnless(game1.isBroke(players[num].serial)) # End turn of game 1 self.failIf(tournament.endTurn(1)) # End of the tounament self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_COMPLETE) self.failUnlessEqual(len(tournament.games), 0) self.failUnlessEqual(len(tournament.id2game), 0) # ------------------------------------------------------- def testEndTurnFirstBreakAndBalance(self): """Test Poker Tournament : 1) a tournament enters BREAK_WAIT 2) all tables but table T1 finished their hand 3) the table T1 finishes its hand AND is destroyed as a side effect of a call to balanceGames, because the T1 players are dispatched to the other tables. This is a special case where updateBreak will be called from endTurn with a game_id for a table that is gone. updateBreak must gracefully ignore the fact it is gone and proceed to BREAK state. """ arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 10, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'y', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)), \ 'breaks_first' : 0 } tournament = pokertournament.PokerTournament(**arguments) # Register the players for player in range(10): self.failUnless(tournament.register(player)) # 2 games (5 players) self.failUnlessEqual(len(tournament.games), 2) # Ten players in the tournament self.failUnlessEqual(len(tournament.players), 10) # Get created games game1 = tournament.id2game[1] game2 = tournament.id2game[2] # Game 1, players 1 broke players = game1.playersAll() for num in range(1): players[num].money = 0 self.failUnless(game1.isBroke(players[num].serial)) self.failUnlessEqual(game1.brokeCount(), 1) # End turn of game 1 self.failUnless(tournament.endTurn(1)) self.failUnlessEqual(pokertournament.TOURNAMENT_STATE_BREAK_WAIT, tournament.state) self.failUnlessEqual([1], tournament.breaks_games_id) # Game 2, players 1, 2, 3, 4 broke as if 5 got all their chips players = game2.playersAll() for num in range(4): players[num].money = 0 self.failUnless(game2.isBroke(players[num].serial)) self.failUnlessEqual(game2.brokeCount(), 4) # End turn of game 2 self.failUnless(tournament.endTurn(2)) # Players broke removed # Game balanced, game2 discarded, game1 left self.failUnlessEqual(len(game1.playersAll()), 5) self.failUnlessEqual([game1], tournament.games) self.failUnlessEqual(pokertournament.TOURNAMENT_STATE_BREAK, tournament.state) tournament.state = pokertournament.TOURNAMENT_STATE_RUNNING # Game 1 players broke players = game1.playersAll() for num in range(len(players) - 1): players[num].money = 0 self.failUnless(game1.isBroke(players[num].serial)) # End turn of game 1 self.failIf(tournament.endTurn(1)) # End of the tounament self.failUnlessEqual(tournament.state, pokertournament.TOURNAMENT_STATE_COMPLETE) self.failUnlessEqual(len(tournament.games), 0) self.failUnlessEqual(len(tournament.id2game), 0) # ------------------------------------------------------- def testEndTurnFirstBreakAndSinglePlayer(self): """Test Poker Tournament : On a two tables tournament with two players tables (but this applies to N tables) 1) table T1 finishes its hand and only has one player left tournament is not on BREAK_WAIT 2) tournament break time is reached 3) table T2 finishes its hand, no player is busted. endTurn is called and tournament enters BREAK_WAIT T2 is added to the list of tables for which there is not need to wait before declaring the tournament on break. Because T1 has only one player left and all other tables are expecting the break (i.e. no hand will be played), it can be added to the list of tables ready for the break. """ arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 4, \ 'seats_per_game' : 2, \ 'sit_n_go' : 'y', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)), \ } tournament = pokertournament.PokerTournament(**arguments) # Register the players for player in range(4): self.failUnless(tournament.register(player)) # 2 games (4 players) self.failUnlessEqual(len(tournament.games), 2) # 4 players in the tournament self.failUnlessEqual(len(tournament.players), 4) # Get created games game1 = tournament.id2game[1] game2 = tournament.id2game[2] # Game 2, players 1 broke as if 2 got all his chips players = game2.playersAll() players[0].money = 0 self.failUnless(game2.isBroke(players[0].serial)) self.failUnlessEqual(game2.brokeCount(), 1) # End turn of game 2 self.failUnless(tournament.endTurn(2)) self.failUnlessEqual(len(game2.playersAll()), 1) self.failUnlessEqual(pokertournament.TOURNAMENT_STATE_RUNNING, tournament.state) # break time is now tournament.breaks_first = 0 # End turn of game 1 self.failUnless(tournament.endTurn(1)) self.failUnlessEqual([game1,game2], tournament.games) self.failUnlessEqual(pokertournament.TOURNAMENT_STATE_BREAK, tournament.state) self.failUnlessEqual(len(game1.playersAll()), 2) self.failUnlessEqual(len(game2.playersAll()), 1) # ------------------------------------------------------- def testGetRank(self): """Test Poker Tournament : Get rank""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 20, \ 'seats_per_game' : 5, \ 'start_time' : time.time() + 20000, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) for player in range(10): self.failUnless(tournament.register(player)) tournament.winners = [1, 5, 8] self.failUnlessEqual(tournament.getRank(1), 8) self.failUnlessEqual(tournament.getRank(5), 9) self.failUnlessEqual(tournament.getRank(8), 10) for player in range(10): if player not in tournament.winners: self.failUnlessEqual(tournament.getRank(player), -1) # ------------------------------------------------------- def testCancel(self): """Test Poker Tournament : Cancel""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 20, \ 'players_min' : 5, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) for player in range(3): self.failUnless(tournament.register(player)) self.failUnlessEqual([0, 1, 2], tournament.players) tournament.start_time = 0 self.assertEqual(None, tournament.canRun()) tournament.updateRunning() self.failUnlessEqual([], tournament.players) self.failUnlessEqual(pokertournament.TOURNAMENT_STATE_CANCELED, tournament.state) self.failIf(tournament.cancel()) # ------------------------------------------------------- def testRunRegular(self): """Test Poker Tournament : Cancel""" arguments = { \ 'dirs' : self.dirs, \ 'players_quota' : 20, \ 'start_time' : time.time() + 20000, \ 'seats_per_game' : 5, \ 'sit_n_go' : 'n', \ 'verbose' : int(os.environ.get('VERBOSE_T', 3)) } tournament = pokertournament.PokerTournament(**arguments) self.failUnless(tournament.register(1)) tournament.start_time = 0 self.failUnless(tournament.register(2)) self.failUnlessEqual(pokertournament.TOURNAMENT_STATE_RUNNING, tournament.state) class Breaks(unittest.TestCase): def setUp(self): self.now = time.time() + 20000 pokertournament.tournament_seconds = self.seconds def seconds(self): return self.now def test_remainingBreakSeconds(self): arguments = { 'dirs' : [ '@top_srcdir@/conf' ], 'players_quota' : 20, 'start_time' : self.seconds(), 'seats_per_game' : 5, 'sit_n_go' : 'n', 'verbose' : int(os.environ.get('VERBOSE_T', 3)), } tournament = pokertournament.PokerTournament(**arguments) self.assertEqual(None, tournament.remainingBreakSeconds()) tournament.breaks_since = self.now - 1 tournament.breaks_duration = 2 self.assertEqual(1, tournament.remainingBreakSeconds()) def test_updateBreak(self): arguments ={ 'dirs' : [ '@top_srcdir@/conf' ], 'players_quota' : 20, 'start_time' : self.seconds(), 'seats_per_game' : 5, 'sit_n_go' : 'n', 'verbose' : int(os.environ.get('VERBOSE_T', 3)), } tournament = pokertournament.PokerTournament(**arguments) tournament.state = pokertournament.TOURNAMENT_STATE_RUNNING # # No break, updateBreak does nothing # tournament.breaks_duration = 0 self.assertEqual(False, tournament.updateBreak(0)) # # RUNNING but not time to break yet # tournament.breaks_duration = 5 tournament.breaks_running_since = tournament.start_time tournament.breaks_first = 10 tournament.breaks_interval = 10 tournament.breaks_duration = 1 tournament.breaks_count = 1 self.failUnless(tournament.updateBreak()) tournament.breaks_count = 0 self.failUnless(tournament.updateBreak()) # # RUNNING -> BREAK_WAIT # self.now = tournament.breaks_running_since + tournament.breaks_first class Game: def __init__(self, id): self.id = id def playersAll(self): return [1,2,3] tournament.games = [Game(1), Game(2)] self.failUnless(tournament.updateBreak(1)) self.failUnless(hasattr(tournament, 'breaks_games_id')) self.assertEqual([1],tournament.breaks_games_id) self.assertEqual(pokertournament.TOURNAMENT_STATE_BREAK_WAIT, tournament.state) # # BREAK_WAIT -> BREAK # self.failUnless(tournament.updateBreak(2)) self.failIf(hasattr(tournament, 'breaks_games_id')) self.assertEqual(pokertournament.TOURNAMENT_STATE_BREAK, tournament.state) self.assertEqual(self.now, tournament.breaks_since) # # BREAK -> RUNNING # self.now += tournament.breaks_duration self.failUnless(tournament.updateBreak()) self.assertEqual(self.now, tournament.breaks_running_since) # # Call with invalid state # tournament.state = pokertournament.TOURNAMENT_STATE_CANCELED self.assertEqual(None, tournament.updateBreak()) # --------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerTournamentTestCase)) # suite.addTest(unittest.makeSuite(PokerTournamentTestCase, prefix = "testEndTurnFirstBreakAndSinglePlayer")) suite.addTest(unittest.makeSuite(Breaks)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(Breaks, prefix = "testPrizes")) return suite # --------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # --------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-pokertournament.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokertournament.py' TESTS='coverage-reset test-pokertournament.py coverage-report' check )" # End: poker-engine-1.3.6/tests/test-version.py.in0000644000175000017500000002356311344205422015616 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest from pokerengine import version class VersionTestCase(unittest.TestCase): # ----------------------------------------------------------------------------------------------------- def setUp(self): version.Version.verbose = int(os.environ.get('VERBOSE_T', 0)) # ----------------------------------------------------------------------------------------------------- def tearDown(self): pass # ----------------------------------------------------------------------------------------------------- def testStringRepresentation(self): """Test Version : String representation of the version object""" ver = version.Version('1.2.3') self.failUnlessEqual(repr(ver),ver.__class__.__name__ + ' (\'' + str(ver) + '\')') # ----------------------------------------------------------------------------------------------------- def testParseError(self): """Test Version : Parsing error with invalid version string""" ver = version.Version() self.failUnlessRaises(ValueError,ver.parse,'') self.failUnlessRaises(ValueError,ver.parse,'1') self.failUnlessRaises(ValueError,ver.parse,'1.2') self.failUnlessRaises(ValueError,ver.parse,'1-2-3') self.failUnlessRaises(ValueError,ver.parse,'A.B.C') self.failUnlessRaises(ValueError,ver.parse,'1.2.3.') self.failUnlessRaises(ValueError,ver.parse,'1.2.3.4') # ----------------------------------------------------------------------------------------------------- def testParseSuccess(self): """Test Version : Parsing success with valid version string""" ver = version.Version() try: ver.parse('1.2.3') major, medium, minor = ver.version except: self.fail('Exception generated version parsing') self.failUnlessEqual(major,1) self.failUnlessEqual(medium,2) self.failUnlessEqual(minor,3) # ----------------------------------------------------------------------------------------------------- def testMajor(self): """Test Version : Major version number accessor""" ver = version.Version('1.2.3') self.failUnlessEqual(ver.major(),1) # ----------------------------------------------------------------------------------------------------- def testMedium(self): """Test Version : Medium version number accessor""" ver = version.Version('1.2.3') self.failUnlessEqual(ver.medium(),2) # ----------------------------------------------------------------------------------------------------- def testMinor(self): """Test Version : Minor version number accessor""" ver = version.Version('1.2.3') self.failUnlessEqual(ver.minor(),3) # ----------------------------------------------------------------------------------------------------- def testStr(self): """Test Version : String representation""" sver = '1.2.3' ver = version.Version('1.2.3') self.failUnlessEqual(sver,str(ver)) # ----------------------------------------------------------------------------------------------------- def testAdd(self): """Test Version : Addition""" ver1 = version.Version('1.2.3') ver2 = ver1 + 1 self.failUnlessEqual(version.Version('1.2.3'),ver1) self.failUnlessEqual(version.Version('1.2.4'),ver2) # ----------------------------------------------------------------------------------------------------- def testIAdd(self): """Test Version : Self addition""" ver1 = version.Version('1.2.3') ver1 += 1 self.failUnlessEqual(version.Version('1.2.4'),ver1) # ----------------------------------------------------------------------------------------------------- def testSub(self): """Test Version : Substraction""" ver1 = version.Version('3.2.1') ver2 = ver1 - 1 self.failUnlessEqual(version.Version('3.2.1'),ver1) self.failUnlessEqual(version.Version('3.2.0'),ver2) ver2 = ver1 - 2 self.failUnlessEqual(version.Version('3.2.1'),ver1) self.failUnlessEqual(version.Version('3.0.1'),ver2) ver2 = ver1 - 3 self.failUnlessEqual(version.Version('3.2.1'),ver1) self.failUnlessEqual(version.Version('0.2.1'),ver2) self.failUnlessRaises(UserWarning,ver1.__sub__,4) # ----------------------------------------------------------------------------------------------------- def testISub(self): """Test Version : Self substraction""" ver1 = version.Version('3.2.1') ver1 -= 1 self.failUnlessEqual(version.Version('3.2.0'),ver1) ver1 = version.Version('3.2.1') ver1 -= 2 self.failUnlessEqual(version.Version('3.0.1'),ver1) ver1 = version.Version('3.2.1') ver1 -= 3 self.failUnlessEqual(version.Version('0.2.1'),ver1) ver1 = version.Version('3.2.1') self.failUnlessRaises(UserWarning,ver1.__sub__,4) # ----------------------------------------------------------------------------------------------------- def testUpgradeChainInvalid(self): """Test Version : Upgrade chain with invalid input formats""" ver_invalid = ['','1.2','1-2-3','A.B.C','1.2.3.','1.2.3.4'] chain_invalid = [] for ver1 in ver_invalid: for ver2 in ver_invalid: chain_invalid.append('upgrade-' + ver1 + '-' + ver2) chain_invalid.append('upgrade-1.2.3-1.2.') chain_invalid.append('upgrade-1.2.-1.2.3') chain_invalid.append('upgrade-1.2.3,1.2.4') ver = version.Version('3.2.1') self.failUnlessEqual(ver.upgradeChain('4.3.2',chain_invalid),[]) # ----------------------------------------------------------------------------------------------------- def testUpgradeChainFailed(self): """Test Version : Upgrade chain with invalid inputs""" ver_invalid = ['upgrade-3.2.1-3.2.1','upgrade-3.2.1-3.2.0'] ver = version.Version('3.2.1') self.failUnlessEqual(ver.upgradeChain('3.2.2',ver_invalid),[]) # ----------------------------------------------------------------------------------------------------- def testUpgradeChainIgnored(self): """Test Version : Upgrade chain with ignored inputs""" ver_ignored = ['upgrade-0.9.0-1.0.0','upgrade-3.0.0-3.1.0'] ver = version.Version('3.2.1') self.failUnlessEqual(ver.upgradeChain('3.2.3',ver_ignored),[]) # ----------------------------------------------------------------------------------------------------- def testUpgradeChainValid(self): """Test Version : Upgrade chain with valid inputs""" ver_valid = ['upgrade-3.2.1-3.2.2','grade-3.2.2-3.2.3'] ver = version.Version('3.2.1') self.failUnlessEqual(ver.upgradeChain('3.2.3',ver_valid),ver_valid) ver_valid = ['upgrade-3.2.2-3.2.3', 'upgrade-3.2.2-3.2.3'] ver = version.Version('3.2.1') self.failUnlessEqual(ver.upgradeChain('3.2.3',ver_valid), ['upgrade-3.2.2-3.2.3']) ver_valid = ['upgrade-3.2.1-3.2.6', 'upgrade-3.2.1-3.2.3'] ver = version.Version('3.2.1') self.failUnlessEqual(ver.upgradeChain('3.2.7',ver_valid), ['upgrade-3.2.1-3.2.6']) # ----------------------------------------------------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(VersionTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(VersionTestCase, prefix = "test2")) return suite # ----------------------------------------------------------------------------------------------------- def GetTestedModule(): return version # ----------------------------------------------------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # ----------------------------------------------------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-version.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/version.py' TESTS='coverage-reset test-version.py coverage-report' check )" # End: poker-engine-1.3.6/tests/run.in0000755000175000017500000000466311344205422013334 00000000000000#!/bin/sh # # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Henry Precheur (2004) # # set -e : ${srcdir:=.} export srcdir : ${top_srcdir:=..} export top_srcdir #DEFAULT_VERBOSE_T=-1 # show the test results automake level, hide error messages #DEFAULT_VERBOSE_T=0 # show the test results unittest level, hide informative messages DEFAULT_VERBOSE_T=3 # show very detailed information about everything (~2MB output 2006/07) : ${VERBOSE_T:=$DEFAULT_VERBOSE_T} export VERBOSE_T # build context for i18n testing mkdir -p ./tmp/fr/LC_MESSAGES/ msgfmt @top_srcdir@/po/fr.po -o ./tmp/fr/LC_MESSAGES/poker-engine.mo DEFAULT_COVERAGE_FILES=$(echo ${top_srcdir}/pokerengine/*.py) : ${COVERAGE_FILES:=$DEFAULT_COVERAGE_FILES} case "$1" in *coverage-reset) @PYTHON@ ${srcdir}/coverage.py -e ;; *coverage-report) output=$( @PYTHON@ ${srcdir}/coverage.py -m -r ${COVERAGE_FILES} ) rm -fr annotated ; mkdir annotated @PYTHON@ ${srcdir}/coverage.py -a -d annotated ${COVERAGE_FILES} echo "$output" # # Don't bark on coverage being incomplete when not verbose : # print statements are omited. # if test "$VERBOSE_T" == "3" ; then if ! echo "$output" | grep 'TOTAL.*100%' > /dev/null ; then echo 'FAIL: tests do not cover 100% of the poker-engine code' exit 1 fi fi ;; *.py) @PYTHON@ -u ${srcdir}/coverage.py -x "$1" ;; *) echo unknown test $1 exit 1 ;; esac # remove i18n testing context rm -fr ./tmp poker-engine-1.3.6/tests/upgrades.py.in0000644000175000017500000000467211344205422014766 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os, shutil, stat sys.path.insert(0, "@top_srcdir@") os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', '') + '@top_srcdir@' import unittest from pokerengine.pokerengineconfig import Config from pokerengine.version import version class TestUpgrades(unittest.TestCase): def test1(self): verbose = os.environ.get('VERBOSE_T', '1') shutil.rmtree("conftest", ignore_errors = True) os.mkdir("conftest") os.system("../pokerconfigupgrade --verbose=" + verbose + " --upgrades=@top_srcdir@/upgrades --reference=@srcdir@/conf conftest") os.chmod("conftest", 0755) os.system("../pokerconfigupgrade --verbose=" + verbose + " --upgrades=@top_srcdir@/upgrades conftest") config = Config(['conftest']) for file in os.listdir("conftest"): if ".xml" in file: config.load(file) self.assertEqual(config.headerGet("/child::*/@poker_engine_version"), version) shutil.rmtree("conftest") def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestUpgrades)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestUpgrades, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) poker-engine-1.3.6/tests/positions.py.in0000644000175000017500000002650611344205422015203 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") from string import split import unittest from pokerengine.pokergame import PokerGameServer, PokerGameClient, PokerGame from pokerengine.pokercards import PokerCards from pokereval import PokerEval poker_eval = PokerEval() _initial_money = 1000 class PokerPredefinedDecks: def __init__(self, decks): self.decks = decks self.index = 0 def shuffle(self, deck): deck[:] = self.decks[self.index][:] self.index += 1 if self.index >= len(self.decks): self.index = 0 class TestPosition(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game.setVariant("holdem") self.game.setBettingStructure("2-4-limit") predefined_decks = [ "8d 2h 2c 8c 4c Kc Ad 9d Ts Jd 5h Tc 4d 9h 8h 7h 9c 2s 3c Kd 5s Td 5d Th 3s Kh Js Qh 7d 2d 3d 9s Qd Ac Jh Jc Qc 6c 7s Ks 5c 4h 7c 4s Qs 6s 6h Ah 6d As 3h 8s", # distributed from the end ] self.game.shuffler = PokerPredefinedDecks(map(lambda deck: self.game.eval.string2card(split(deck)), predefined_decks)) def tearDown(self): del self.game def log(self, string): print string def make_cards(self, *args): return PokerCards(poker_eval.string2card(args)) def make_new_player(self, i, initial_money = _initial_money): self.assert_(self.game.addPlayer(i)) player = self.game.serial2player[i] player.money = initial_money player.buy_in_payed = True self.assert_(self.game.sit(i)) player.auto_blind_ante = True def test1(self): """ Five players, they check/call during rounds and start over. Players serials 1 2 3 4 5 seats 0 1 2 3 4 positions 0 1 2 3 4 """ game = self.game player = {} for serial in xrange(1,6): player[serial] = serial - 1 self.make_new_player(serial) # # First turn, everyone checks and stays in game # game.beginTurn(1) self.assertEqual(game.state, "pre-flop") self.assertEqual(game.dealer, player[1]) # dealer self.assertEqual(game.last_to_talk, player[3]) # big blind for serial in (4, 5, 1, 2): self.assertEqual(game.position, player[serial]) game.call(serial) self.assertEqual(game.position, player[3]) game.check(3) # big blind for stage in ("flop", "turn", "river"): self.assertEqual(game.state, stage) for serial in (2, 3, 4, 5, 1): self.assertEqual(game.position, player[serial]) game.check(serial) self.assertEqual(game.state, "end") # # Second turn, everyone folds games end prematurely # game.beginTurn(2) self.assertEqual(game.state, "pre-flop") self.assertEqual(game.dealer, player[2]) # dealer self.assertEqual(game.last_to_talk, player[4]) # big blind for serial in (5, 1, 2, 3): self.assertEqual(game.position, player[serial]) self.assertEqual(game.fold(serial), True) self.assertEqual(game.state, "end") # # Third turn, a new player comes in during the turn, two # players in game. The new player is ignored. # game.beginTurn(3) self.make_new_player(6) player[6] = 5 self.assertEqual(game.state, "pre-flop") self.assertEqual(game.dealer, player[3]) # dealer self.assertEqual(game.last_to_talk, player[5]) # big blind self.assertEqual(game.position, player[1]) game.call(1) for serial in (2, 3, 4): self.assertEqual(game.position, player[serial]) game.fold(serial) self.assertEqual(game.position, player[5]) game.check(5) for stage in ("flop", "turn", "river"): self.assertEqual(game.state, stage) self.assertEqual(game.position, player[5]) # next to the dealer is gone, therefore it's the next to him for serial in (5, 1): self.assertEqual(game.position, player[serial]) game.check(serial) self.assertEqual(game.state, "end") # # Fourth turn, we now have six players in game, the # newcomer pays the big blind # game.beginTurn(4) self.assertEqual(game.state, "pre-flop") self.assertEqual(game.dealer, player[4]) # dealer self.assertEqual(game.last_to_talk, player[6]) # big blind self.assertEqual(game.position, player[1]) game.call(1) for serial in (2, 3, 4, 5): self.assertEqual(game.position, player[serial]) game.fold(serial) self.assertEqual(game.position, player[6]) game.check(6) for stage in ("flop", "turn", "river"): self.assertEqual(game.state, stage) self.assertEqual(game.position, player[6]) # next to the dealer is gone, therefore it's the next to him for serial in (6, 1): self.assertEqual(game.position, player[serial]) game.check(serial) self.assertEqual(game.state, "end") # # Fifth turn, a player (the dealer) leaves in the middle # of the game, auto_play takes over. # game.beginTurn(5) self.assertEqual(game.state, "pre-flop") self.assertEqual(game.dealer, player[5]) # dealer self.assertEqual(game.last_to_talk, player[1]) # big blind for serial in (2, 3): self.assertEqual(game.position, player[serial]) game.fold(serial) game.removePlayer(5) game.autoPlayer(5) for serial in (4, 6): self.assertEqual(game.position, player[serial]) game.call(serial) self.assertEqual(game.position, player[1]) game.check(1) for stage in ("flop", "turn", "river"): self.assertEqual(game.state, stage) self.assertEqual(game.last_to_talk, player[4]) self.assertEqual(game.position, player[6]) # next to the dealer is gone, therefore it's the next to him for serial in (6, 1, 4): self.assertEqual(game.position, player[serial]) game.check(serial) self.assertEqual(game.state, "end") # # Sixth turn, everyone folds and game ends prematurely. # player[5] is gone for good, discarded at the end of the # previous turn. # player[6] -= 1 game.beginTurn(6) self.assertEqual(game.state, "pre-flop") self.assertEqual(game.dealer, player[6]) # dealer self.assertEqual(game.last_to_talk, player[2]) # big blind for serial in (3, 4, 6, 1): self.assertEqual(game.position, player[serial]) game.fold(serial) self.assertEqual(game.state, "end") # # Seventh turn, the dealer passes to player[1] again # game.beginTurn(7) self.assertEqual(game.state, "pre-flop") self.assertEqual(game.dealer, player[1]) # dealer self.assertEqual(game.last_to_talk, player[3]) # big blind for serial in (4, 6, 1, 2): self.assertEqual(game.position, player[serial]) game.fold(serial) self.assertEqual(game.state, "end") def test2(self): """ getRequestedAction and setPlayerBlind tests """ game = self.game for serial in xrange(1,5): self.failUnless(game.addPlayer(serial)) self.failUnless(game.payBuyIn(serial, game.maxBuyIn())) self.failUnless(game.sit(serial)) self.failUnless(game.addPlayer(5)) self.assertEqual(game.getRequestedAction(5), "buy-in") self.failUnless(game.payBuyIn(5, game.maxBuyIn())) self.assertEqual(game.getRequestedAction(5), None) game.getPlayer(5).money= 1 self.assertEqual(game.getRequestedAction(5), "rebuy") self.failUnless(game.rebuy(5, game.bestBuyIn())) self.assertEqual(game.getRequestedAction(5), None) self.failUnless(game.sit(5)) # # turn 1 # game.beginTurn(8) self.assertEqual(game.state, "blindAnte") self.assertEqual(game.getRequestedAction(2), "blind_ante") (amount, dead, state) = game.blindAmount(2) game.blind(2, amount, dead) self.assertEqual(game.getRequestedAction(3), "blind_ante") (amount, dead, state) = game.blindAmount(3) game.blind(3, amount, dead) self.assertEqual(game.getRequestedAction(4), "play") for serial in xrange(1,6): game.botPlayer(serial) # # turn 2,3,4 # self.failUnless(game.sitOut(4)) game.beginTurn(9) game.beginTurn(10) game.beginTurn(11) for serial in xrange(1,6): game.interactivePlayer(serial) # # player 4 back in the game must pay the big blind # self.failUnless(game.sit(4)) game.beginTurn(12) self.assertEqual(game.state, "blindAnte") self.assertEqual(game.getRequestedAction(2), "blind_ante") (amount, dead, state) = game.blindAmount(2) game.blind(2, amount, dead) self.assertEqual(game.getRequestedAction(3), "blind_ante") (amount, dead, state) = game.blindAmount(3) game.blind(3, amount, dead) self.assertEqual(game.getRequestedAction(4), "blind_ante") game.setPlayerBlind(4, "big_and_dead") self.assertEqual(game.getRequestedAction(4), "blind_ante") def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestPosition)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestPosition, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/positions.py ) ; ( cd ../tests ; make TESTS='positions.py' check )" # End: poker-engine-1.3.6/tests/test-pokerprizes.py.in0000644000175000017500000001632711344205422016506 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2008 Bradley M. Kuhn # Copyright (C) 2006 Mekensleep # 26 rue des rosiers, 75004 Paris # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Bradley M. Kuhn # Pierre-Andre (05/2006) # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest import os.path import types import time from tests.testmessages import restore_all_messages, silence_all_messages, search_output, clear_all_messages, get_messages from pokerengine import pokerprizes class PokerPrizesTestCase(unittest.TestCase): TestConfDirectory = '@top_srcdir@/conf' # --------------------------------------------------------- def setUp(self): silence_all_messages() self.dirs = ['.', PokerPrizesTestCase.TestConfDirectory, '~/conf'] # ------------------------------------------------------- def tearDown(self): pass # ------------------------------------------------------- def test01_algorithmPrizeInterface(self): """test01_algorithmPrizeInterface Test the payout structure of the Algorithm prize interface""" pa = pokerprizes.__dict__["PokerPrizesAlgorithm"](buy_in_amount = 100, player_count = 4) self.assertEquals(pa.buy_in, 100) self.assertEquals(pa.player_count, 4) self.failUnlessEqual(pa.getPrizes(), [400]) for cnt in range(5, 9): pa.addPlayer() self.failUnlessEqual(pa.player_count, cnt) if cnt == 5: pa.removePlayer() self.assertEquals(pa.player_count, 4) self.failUnlessEqual(pa.getPrizes(), [400]) pa.addPlayer() self.assertEquals(pa.player_count, cnt) self.failUnlessEqual(pa.getPrizes(), [375, 125]) self.failUnlessEqual(pa.getPrizes(), [600, 200]) for cnt in range(9, 19): pa.addPlayer() self.failUnlessEqual(pa.player_count, cnt) self.failUnlessEqual(pa.getPrizes(), [1125, 450, 225]) for cnt in range(19, 29): pa.addPlayer() self.failUnlessEqual(pa.player_count, cnt) self.failUnlessEqual(pa.getPrizes(), [1575, 700, 350, 175]) for cnt in range(29, 39): pa.addPlayer() self.failUnlessEqual(pa.player_count, cnt) self.failUnlessEqual(pa.getPrizes(), [1902, 950, 237, 237, 237, 237]) for cnt in range(39, 49): pa.addPlayer() self.failUnlessEqual(pa.player_count, cnt) self.failUnlessEqual(len(pa.getPrizes()), int(48 * 0.20)) for cnt in range(49, 199): pa.addPlayer() self.failUnlessEqual(pa.player_count, cnt) self.failUnlessEqual(len(pa.getPrizes()), int(198 * 0.15)) for cnt in range(199, 299): pa.addPlayer() self.failUnlessEqual(pa.player_count, cnt) self.failUnlessEqual(len(pa.getPrizes()), int(298 * 0.10)) # ------------------------------------------------------- def test02_tablePrizeInterface(self): """test02_tablePrizeInterface Test the payout structure of the table prize interface""" pt = pokerprizes.__dict__["PokerPrizesTable"](buy_in_amount = 100, player_count = 2, config_dirs = self.dirs) self.assertEquals(pt.buy_in, 100) self.assertEquals(pt.player_count, 2) self.failUnlessEqual(pt.getPrizes(), [200]) for player in range(4, 7): pt.addPlayer() if player == 4: pt.removePlayer() self.assertEquals(pt.player_count, 2) self.failUnlessEqual(pt.getPrizes(), [200]) pt.addPlayer() self.assertEquals(pt.player_count, 3) self.failUnlessEqual(pt.getPrizes(), [300]) self.failUnlessEqual(pt.getPrizes(), [350, 150]) for player in range(7, 28): pt.addPlayer() self.failUnlessEqual(pt.getPrizes(), [1300, 780, 520]) for player in range(28, 48): pt.addPlayer() self.failUnlessEqual(pt.getPrizes(), [1840, 1104, 736, 552, 368]) for player in range(48, 198): pt.addPlayer() self.failUnlessEqual(pt.getPrizes(), [5880, 3920, 2450, 1764, 1568, 1274, 980, 784, 588, 392]) for player in range(198, 298): pt.addPlayer() self.failUnlessEqual(len(pt.getPrizes()), 20) # ------------------------------------------------------- def test03_virtualBaseClass(self): """test03_virtualBaseClass Test minor things not elsewhere covered for the base class""" v = pokerprizes.PokerPrizes(5, player_count = 3, guarantee_amount = 100) self.assertEquals(v.buy_in, 5) self.assertEquals(v.player_count, 3) self.assertEquals(v.guarantee_amount, 100) clear_all_messages() v.error("test") self.assertEquals(get_messages(), ['ERROR test']) clear_all_messages() exceptCaught = False try: v.getPrizes() self.failIf(True) # should not reach here except NotImplementedError, nie: exceptCaught = True self.assertEquals(nie.__str__(), 'getPrizes NOT IMPLEMENTED IN ABSTRACT BASE CLASS') self.failUnless(exceptCaught) self.assertEquals(get_messages(), ['ERROR getPrizes NOT IMPLEMENTED IN ABSTRACT BASE CLASS']) # --------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerPrizesTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(Breaks, prefix = "test2")) return suite # --------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # --------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-pokerprizes.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokerprizes.py' TESTS='coverage-reset test-pokerprizes.py coverage-report' check )" # End: poker-engine-1.3.6/tests/tournament.py.in0000644000175000017500000005414411344205422015347 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") import time from string import split import unittest from pokerengine.pokergame import PokerGameServer from pokerengine.pokertournament import equalizeGames, breakGames, PokerTournament NGAMES = 5 class PokerPredefinedDecks: def __init__(self, decks): self.decks = decks self.index = 0 def shuffle(self, deck): deck[:] = self.decks[self.index][:] self.index += 1 if self.index >= len(self.decks): self.index = 0 class TestTournament(unittest.TestCase): def setUp(self): predefined_decks = [ "8d 2h 2c 8c 4c Kc Ad 9d Ts Jd 5h Tc 4d 9h 8h 7h 9c 2s 3c Kd 5s Td 5d Th 3s Kh Js Qh 7d 2d 3d 9s Qd Ac Jh Jc Qc 6c 7s Ks 5c 4h 7c 4s Qs 6s 6h Ah 6d As 3h 8s", # distributed from the end ] self.games = [] for i in xrange(NGAMES): game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) game.verbose = int(os.environ.get('VERBOSE_T', 3)) game.setVariant("7stud") game.setBettingStructure("0-0-limit") game.id = i game.shuffler = PokerPredefinedDecks(map(lambda deck: game.eval.string2card(split(deck)), predefined_decks)) self.games.append(game) def tearDown(self): del self.games def log(self, string): print string class TestEqualize(TestTournament): def test1(self): """ """ # # Five 10 seats tables (0 to 4) # table 0 : 8 players # table 1 : 8 players # table 2 : 7 players # table 3 : 7 players # table 4 : 2 players # counts = [8, 8, 7, 7, 2] for game in self.games: game.serial2player = {} for serial in xrange(counts.pop(0)): game.serial2player[game.id * 100 + serial] = None # # 2 players move # # table 0 : 8 players -> 1 leave to table 4 # table 1 : 8 players -> 1 leave to table 4 # table 2 : 7 players # table 3 : 7 players # table 4 : 2 players <- 2 arrive from table 0 and 1 # self.assertEqual(equalizeGames(self.games[:]), [(0, 4, 0), (1, 4, 100)]) # # Five 10 seats tables (0 to 4) # table 0 : 10 players # table 1 : 8 players # table 2 : 3 players # table 3 : 9 players # table 4 : 5 players # counts = [10, 8, 3, 9, 5] for game in self.games: game.serial2player = {} for serial in xrange(counts.pop(0)): game.serial2player[game.id * 100 + serial] = None # # 6 players move # # table 0 : 10 players -> 3 leave (2 to table 2, 1 to table 4) # table 1 : 8 players -> 1 leave (to table 2) # table 2 : 3 players <- 4 arrive (2 from table 0, 1 from table 2, 1 from table 3) # table 3 : 9 players -> 2 leave (1 to table 2, 1 to table 4) # table 4 : 5 players <- 2 arrive (1 from table 0, 1 from table 3) # self.assertEqual(equalizeGames(self.games[:]), [ (0, 4, 0), (0, 2, 1), (0, 4, 2), (1, 2, 100), (3, 4, 300), (3, 2, 301)]) # # Five 10 seats tables (0 to 4) # table 0 : 10 players # table 1 : 10 players # table 2 : 10 players # table 3 : 10 players # table 4 : 10 players # counts = [10, 10, 10, 10, 10] for game in self.games: game.serial2player = {} for serial in xrange(counts.pop(0)): game.serial2player[game.id * 100 + serial] = None # # Nothing to be done # self.assertEqual(equalizeGames(self.games[:]), []) def test2(self): # # Two 5 seats tables (0, 1) # table 0 : 2 players # table 1 : 5 players # games = self.games[:2] games[0].serial2player = {} games[0].max_players = 5 for serial in (1, 2): games[0].serial2player[serial] = None games[1].serial2player = {} games[1].max_players = 5 for serial in (100, 101, 102, 103, 104): games[1].serial2player[serial] = None self.assertEqual(equalizeGames(games), [(1, 0, 100), (1, 0, 101)]) def test3(self): # # Three 5 seats tables (0, 1, 2) # table 0 : 2 players # table 1 : 5 players (running) # table 2 : 5 players (running) # games = self.games[:3] games[0].serial2player = {} games[0].max_players = 5 for serial in (1, 2): games[0].serial2player[serial] = None games[1].serial2player = {} games[1].max_players = 5 games[1].state = "turn" for serial in (100, 101, 102, 103, 104): games[1].serial2player[serial] = None games[2].serial2player = {} games[2].max_players = 5 games[2].state = "turn" for serial in (200, 201, 202, 203, 204): games[2].serial2player[serial] = None # # Games that could provide players are running and can't # provide players. Nothing can be done. # self.assertEqual(equalizeGames(games), []) # # Three 5 seats tables (0, 1, 2) # table 0 : 2 players (running) # table 1 : 5 players (running) # table 2 : 5 players # games[0].state = "turn" games[2].state = "end" # # Game 2 provide 2 players to game 0 # self.assertEqual(equalizeGames(games), [(2, 0, 200), (2, 0, 201)]) class TestBreak(TestTournament): def test1(self): """ """ # # Five 10 seats tables (0 to 4), each with 5 players # counts = [5] * NGAMES for game in self.games: for serial in xrange(counts.pop()): game.serial2player[game.id * 100 + serial] = None # # Players from table 0 go to table 4 # Players from table 1 to to table 3 # self.assertEqual(breakGames(self.games[:]), [ (0, 4, [0, 1, 2, 3, 4]), (1, 3, [104, 100, 101, 102, 103]) ]) # # Five 10 seats tables (0 to 4), table 0 with 10 players, # tables 1 to 4 with 5 players # for serial in xrange(5,10): self.games[0].serial2player[serial] = None # # Players from table 1 go to table 4 # Players from table 2 go to table 3 # self.assertEqual(breakGames(self.games[:]), [ (1, 4, [104, 100, 101, 102, 103]), (2, 3, [200, 201, 202, 203, 204]) ]) # # Five 10 seats tables (0 to 4) # table 0 : 10 players # table 1 : 7 players # table 2 : 7 players # table 3 : 7 players # table 4 : 7 players # for game in self.games: for serial in xrange(5,7): game.serial2player[game.id * 100 + serial] = None # # Players from table 1 are spread on tables # 4, 3, 2 # self.assertEqual(breakGames(self.games[:]), [ (1, 4, [100, 101, 102]), (1, 3, [103, 104, 105]), (1, 2, [106]) ]) # # Five 10 seats tables (0 to 4) # table 0 : 10 players # table 1 : 7 players # table 2 : 7 players # table 3 : 9 players # table 4 : 7 players # for serial in xrange(7,9): self.games[3].serial2player[300 + serial] = None # # Players from table 1 are spread on tables # 3, 4, 2. Table 3 is chosen first because it is the # table with the largest number of players. # self.assertEqual(breakGames(self.games[:]), [ (1, 3, [100]), (1, 4, [101, 102, 103]), (1, 2, [104, 105, 106]) ]) # # Five 10 seats tables (0 to 4) # table 0 : 10 players # table 1 : 8 players # table 2 : 7 players # table 3 : 9 players # table 4 : 7 players # for serial in xrange(7,8): self.games[1].serial2player[100 + serial] = None # # Can't break any table : 6 free seats and smallest table # has seven players. # self.assertEqual(breakGames(self.games[:]), []) def test2(self): # # Two 5 seats tables (0, 1) # table 0 : 2 players # table 1 : 3 players # games = self.games[:2] games[0].serial2player = {} games[0].max_players = 5 for serial in (1, 2): games[0].serial2player[serial] = None games[1].serial2player = {} games[1].max_players = 5 for serial in (100, 101, 102): games[1].serial2player[serial] = None self.assertEqual(breakGames(games), [(0, 1, [1, 2])]) def test3(self): """ """ # # Five 10 seats tables (0 to 4), each with 5 players # counts = [5] * NGAMES for game in self.games: for serial in xrange(counts.pop()): game.serial2player[game.id * 100 + serial] = None game.state = "turn" # # Tables 0, 1, 2, 3 are running and will not be broken. # Only table 4 is not running and can be broken. # self.games[4].state = "end" # # Players from table 4 go to table 3 # self.assertEqual(breakGames(self.games[:]), [(4, 3, [400, 401, 402, 403, 404])]) class TestCreate(unittest.TestCase): def setUp(self): self.verbose = int(os.environ.get('VERBOSE_T', 1)) def test1(self): tourney = PokerTournament(name = 'Test create', verbose = int(os.environ.get('VERBOSE_T', 3)), players_quota = 4, dirs = [ '../conf', '@top_srcdir@/conf' ], seats_per_game = 4, betting_structure = "level-10-20-no-limit") for serial in xrange(1,5): self.failUnless(tourney.register(serial)) self.assertEqual(len(tourney.games), 1) for game in tourney.games: for serial in game.serialsAll(): game.botPlayer(serial) turn = 1 running = True while running: for game in tourney.games: if game.sitCount() > 1: game.beginTurn(turn) running = tourney.endTurn(game.id) if not running: break if self.verbose > 0: for serial in tourney.winners: print "%d\thas rank %d" % ( serial, tourney.getRank(serial) ) def test2(self): # # One table sit-n-go # tourney = PokerTournament(name = 'Test create', verbose = int(os.environ.get('VERBOSE_T', 3)), players_quota = 4, dirs = [ '../conf', '@top_srcdir@/conf' ], seats_per_game = 4) for serial in xrange(1,4): self.failUnless(tourney.register(serial)) self.failUnless(tourney.unregister(serial)) self.failUnless(tourney.register(serial)) self.failUnless(tourney.register(4)) self.failIf(tourney.unregister(4)) self.assertEqual(len(tourney.games), 1) game = tourney.games[0] game.beginTurn(1) def test3(self): # # Multi tables sit-n-go # seats_per_game = 10 games_count = 2 players_count = seats_per_game * games_count tourney = PokerTournament(name = 'Test create', verbose = int(os.environ.get('VERBOSE_T', 3)), players_quota = players_count, dirs = [ '../conf', '@top_srcdir@/conf' ], seats_per_game = seats_per_game) for serial in xrange(1,players_count + 1): self.failUnless(tourney.register(serial)) self.assertEqual(len(tourney.games), games_count) for game in tourney.games: for serial in game.serialsAll(): game.botPlayer(serial) turn = 1 running = True while running: for game in tourney.games: if game.sitCount() > 1: game.beginTurn(turn) running = tourney.endTurn(game.id) if not running: break if self.verbose > 0: for serial in tourney.winners: print "%d\thas rank %d" % ( serial, tourney.getRank(serial) ) # ---------------------------------------------------------------- def tourneyTableStartBalancedHelper(self, num_players, seats, num_tables, min_per_table): """tourneyTableStartBalancedHelper Helper function to test various scenarios of initial seating""" tourney = PokerTournament(name = 'Only%d' % num_players, verbose = int(os.environ.get('VERBOSE_T', 3)), players_quota = num_players, players_min = num_players, dirs = [ '../conf', '@top_srcdir@/conf' ], seats_per_game = seats, betting_structure = "level-10-20-no-limit") for serial in xrange(1,num_players+1): self.failUnless(tourney.register(serial)) self.assertEquals(len(tourney.games), num_tables) for game in tourney.games: self.failUnless(len(game.serial2player.values()) >= min_per_table) # ---------------------------------------------------------------- def test4_tourneyTableStartBalanced(self): """test4_tourneyTableStartBalanced Start with a table max of 5 players per table, and add 6 players to it. This should create two tables of 3. Tests other scenarios like this as well.""" self.tourneyTableStartBalancedHelper(6, 5, 2, 2) self.tourneyTableStartBalancedHelper(13, 6, 3, 4) # ---------------------------------------------------------------- class TestPrizes(unittest.TestCase): def test1(self): tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'algorithm', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 100) for ii in range(1, 11): tourney.register(ii) self.assertEqual(tourney.prizes(), [32, 12, 6]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'algorithm', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 100) for ii in range(1, 21): tourney.register(ii) self.assertEqual(tourney.prizes(), [57, 25, 12, 6]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'algorithm', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(1, 51): tourney.register(ii) self.assertEqual(tourney.prizes(), [129, 62, 31, 7, 7, 7, 7]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'algorithm', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(200): tourney.register(ii) self.assertEqual(tourney.prizes(), [506, 250, 125, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(3): tourney.register(ii) self.assertEqual(tourney.prizes(), [15]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(6): tourney.register(ii) self.assertEqual(tourney.prizes(), [21, 9]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(30): tourney.register(ii) self.assertEqual(tourney.prizes(), [75, 45, 30]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(50): tourney.register(ii) self.assertEqual(tourney.prizes(), [100, 60, 40, 30, 20]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(200): tourney.register(ii) self.assertEqual(tourney.prizes(), [300, 200, 125, 90, 80, 65, 50, 40, 30, 20]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(300): tourney.register(ii) self.assertEqual(tourney.prizes(), [453, 292, 180, 120, 97, 75, 52, 37, 26, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(500): tourney.register(ii) self.assertEqual(tourney.prizes(), [641, 375, 250, 200, 125, 100, 75, 50, 43, 31, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 1000) for ii in range(700): tourney.register(ii) self.assertEqual(tourney.prizes(), [717, 437, 315, 245, 175, 140, 105, 61, 52, 43, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 5000) for ii in range(1000): tourney.register(ii) self.assertEqual(tourney.prizes(), [1026, 600, 450, 350, 250, 200, 150, 87, 75, 62, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) tourney = PokerTournament(dirs = [ '../conf', '@top_srcdir@/conf' ], prizes_specs = 'table', start_time = time.time() + 20000, sit_n_go = 'n', buy_in = 5, players_quota = 5000) for ii in range(5000): tourney.register(ii) self.assertEqual(tourney.prizes(), [5036, 3000, 2000, 1500, 1250, 1000, 625, 437, 312, 250, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37]) def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestEqualize)) suite.addTest(unittest.makeSuite(TestBreak)) suite.addTest(unittest.makeSuite(TestCreate)) suite.addTest(unittest.makeSuite(TestPrizes)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestCreate, prefix = "test4")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/tournament.py ) ; ( cd ../tests ; make TESTS='tournament.py' check )" # End: poker-engine-1.3.6/tests/__init__.py0000644000175000017500000000000011117326216014266 00000000000000poker-engine-1.3.6/tests/Makefile.am0000644000175000017500000000273511344205422014227 00000000000000# # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # # MAINTAINERCLEANFILES = Makefile.in export PYTHON EXTRA_DIST = \ coverage.py \ __init__.py \ testmessages.py \ test-data/pokerrake.py \ bugs.py \ $(wildcard conf/*.xml) \ $(wildcard test-data/conf/*.xml) \ $(wildcard test-data/upgrade/*.xsl) TESTS_ENVIRONMENT = ./run TESTS = coverage-reset test-*.py history.py deal.py positions.py tournament.py allin.py chips.py blinds.py sit.py upgrades.py muck.py libxml2leak.py coverage-report clean-local: rm -fr .coverage annotated */*.py[oc] export top_srcdir .PHONY: coverage-reset coverage-report poker-engine-1.3.6/tests/test-pokerplayer.py.in0000644000175000017500000003213411344205422016460 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest import random from pokerengine import pokercards from pokerengine import pokergame RAND_MAX = 0x7fff class PokerPlayerTestCase(unittest.TestCase): PokerPlayerAttributes = [ 'serial' ,\ 'name' , \ 'game' , \ 'fold' , \ 'remove_next_turn' , \ 'sit_out' , \ 'sit_out_next_turn' , \ 'sit_requested' , \ 'bot' , \ 'auto' , \ 'auto_blind_ante' , \ 'wait_for' , \ 'auto_muck' , \ 'missed_blind' , \ 'missed_big_blind_count' , \ 'blind' , \ 'buy_in_payed' , \ 'ante' , \ 'all_in' , \ 'side_pot_index' , \ 'seat' , \ 'hand' , \ 'money' , \ 'rebuy' , \ 'bet' , \ 'dead' , \ 'talked_once' ,\ 'user_data', ] # ----------------------------------------------------------------------------------------------------- def setUp(self): self.player = pokergame.PokerPlayer(1,None) # ----------------------------------------------------------------------------------------------------- def tearDown(self): pass # ----------------------------------------------------------------------------------------------------- def testPokerPlayerGetSetUserData(self): """Test Poker Player : User data accessors""" self.failUnlessEqual(self.player.getUserData(), None) self.player.setUserData('UserData') self.failUnlessEqual(self.player.getUserData(), 'UserData') # ----------------------------------------------------------------------------------------------------- def testPokerPlayerIsAllIn(self): """Test Poker Player : Is all in""" self.failUnlessEqual(self.player.isAllIn(), False) self.player.all_in = True self.failUnlessEqual(self.player.isAllIn(), True) # ----------------------------------------------------------------------------------------------------- def testPokerPlayerIsFold(self): """Test Poker Player : Is fold""" self.failUnlessEqual(self.player.isFold(), False) self.failUnlessEqual(self.player.isNotFold(), True) self.player.fold = True self.failUnlessEqual(self.player.isFold(), True) self.failUnlessEqual(self.player.isNotFold(), False) # ----------------------------------------------------------------------------------------------------- def testPokerPlayerIsSit(self): """Test Poker Player : Is sit""" self.failUnlessEqual(self.player.isSit(), False) self.failUnlessEqual(self.player.isSitOut(), True) self.player.sit_out = False self.failUnlessEqual(self.player.isSit(), True) self.failUnlessEqual(self.player.isSitOut(), False) # ----------------------------------------------------------------------------------------------------- def testPokerPlayerIsConnected(self): """Test Poker Player : Is connected""" self.failUnlessEqual(self.player.isConnected(), True) self.failUnlessEqual(self.player.isDisconnected(), False) self.player.remove_next_turn = True self.failUnlessEqual(self.player.isConnected(), False) self.failUnlessEqual(self.player.isDisconnected(), True) # ----------------------------------------------------------------------------------------------------- def testPokerPlayerCopy(self): """Test Poker Player : Copy""" for attribute in PokerPlayerTestCase.PokerPlayerAttributes: setattr(self.player,attribute,random.randint(0,RAND_MAX)) self.player.hand = pokercards.PokerCards() copy = self.player.copy() for attribute in PokerPlayerTestCase.PokerPlayerAttributes: try: self.failUnlessEqual(getattr(self.player,attribute), getattr(copy,attribute)) except: self.fail('Exception during accessing attribute ' + attribute) # ----------------------------------------------------------------------------------------------------- def testPokerPlayerStringRepresentation(self): """Test Poker Player : String representation""" for attribute in PokerPlayerTestCase.PokerPlayerAttributes: setattr(self.player,attribute,random.randint(0,RAND_MAX)) string = '' for attribute in PokerPlayerTestCase.PokerPlayerAttributes: if attribute == 'game': continue string += attribute + ' = ' + str(getattr(self.player,attribute)) + ', ' # Skip the last comma and space character self.failUnlessEqual(string[:-2], str(self.player)) # ----------------------------------------------------------------------------------------------------- def testBeginTurn(self): """Test Poker Player : Begin turn""" Attributes = { 'bet' : 0, 'dead' : 0, 'fold' : False, 'hand' : pokercards.PokerCards(), 'side_pot_index' : 0, 'all_in' : False, 'blind' : None, 'ante' : False } for key in Attributes.keys(): setattr(self.player,key,random.random()) self.player.beginTurn() for key, value in Attributes.items(): self.failUnlessEqual(getattr(self.player, key), value) # ----------------------------------------------------------------------------------------------------- def testIsInGame(self): """Test Poker Player : Is in game""" # Initially the player in in game because not all-in and not fold self.failIf(self.player.isAllIn()) self.failIf(self.player.isFold()) self.failUnless(self.player.isInGame()) # Player is all in self.player.all_in = True self.failUnless(self.player.isAllIn()) self.failIf(self.player.isInGame()) self.player.all_in = False # Player is fold self.player.fold = True self.failUnless(self.player.isFold()) self.failIf(self.player.isInGame()) self.player.fold = False # ----------------------------------------------------------------------------------------------------- def testSitRequested(self): """Test Poker Player : Sit requested""" # Initially the player does not request to sit self.failIf(self.player.isSitRequested()) # Sit is now requested self.player.sit_requested = True self.failUnless(self.player.isSitRequested()) # ----------------------------------------------------------------------------------------------------- def testIsBot(self): """Test Poker Player : Is bot""" # Initially the player is not a bot self.failIf(self.player.isBot()) # The player is now a bot self.player.bot = True self.failUnless(self.player.isBot()) # ----------------------------------------------------------------------------------------------------- def testIsAuto(self): """Test Poker Player : Is auto""" # Initially the player is not an automatic player self.failIf(self.player.isAuto()) # The player is automatic self.player.auto = True self.failUnless(self.player.isAuto()) # ----------------------------------------------------------------------------------------------------- def testIsAutoBlind(self): """Test Poker Player : Is auto blind""" # Initially the player does not in a automatic blind and ante mode self.failIf(self.player.isAutoBlindAnte()) # Sit is now requested self.player.auto_blind_ante = True self.failUnless(self.player.isAutoBlindAnte()) # ----------------------------------------------------------------------------------------------------- def testIsWaitForBlind(self): """Test Poker Player : Is wait for blind""" # Initially the player does not wait for blind self.failIf(self.player.isWaitForBlind()) # The player is waiting the first round self.player.wait_for = 'first_round' self.failUnless(self.player.isWaitForBlind()) # ----------------------------------------------------------------------------------------------------- def testIsMissedBlind(self): """Test Poker Player : Is missed blind""" # Initially blind is missed self.failIf(self.player.isMissedBlind()) # A blind is missed self.player.missed_blind = 'big' self.failUnless(self.player.isMissedBlind()) # No blind is missed self.player.missed_blind = 'n/a' self.failIf(self.player.isMissedBlind()) # ----------------------------------------------------------------------------------------------------- def testIsBlind(self): """Test Poker Player : Is blind""" # Initially the player blind is late self.failUnlessEqual(self.player.blind, 'late') self.failUnless(self.player.isBlind()) # The player not blind self.player.blind = None self.failIf(self.player.isBlind()) # ----------------------------------------------------------------------------------------------------- def testIsBuyInPayed(self): """Test Poker Player : Is buy in payed""" # Initially the player nuy in is not payed self.failIf(self.player.isBuyInPayed()) # The buy in is payed self.player.buy_in_payed = True self.failUnless(self.player.isBuyInPayed()) # ----------------------------------------------------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerPlayerTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(PokerPlayerTestCase, prefix = "test2")) return suite # ----------------------------------------------------------------------------------------------------- def GetTestedModule(): return pokergame # ----------------------------------------------------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # ----------------------------------------------------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-pokerplayer.py ) ; ( cd ../tests ; make TESTS='test-pokerplayer.py' check )" # End: poker-engine-1.3.6/tests/chips.py.in0000644000175000017500000001236311344205422014256 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") import unittest from pokerengine.pokerchips import PokerChips from pokerengine import pokerchips class TestChips(unittest.TestCase): def setUp(self): self.verbose = int(os.environ.get('VERBOSE_T', 1)) def tearDown(self): pass def test1(self): """ """ pokerchips.MAX_CHIPS_PER_STACK = 100 values = [100, 200, 500, 1000, 2500] chips = PokerChips(values, 0) self.assertEqual(chips.chips, [0, 0, 0, 0, 0]) chips = PokerChips(values, 20000) if self.verbose > 0: print "%s" % chips self.assertEqual(chips.toint(), 20000) self.assertEqual(chips.chips, [8, 6, 4, 6, 4]) chips.add([150, 0, 0, 0, 0]) self.assertEqual(chips.chips, [100, 35, 4, 6, 4]) self.assertEqual(chips.toint(), 35000) chips = PokerChips(values, 20000) total = 20000 + sum(map(lambda x: x * 150, values)) chips.add([150, 150, 150, 150, 150]) self.assertEqual(chips.chips, [100, 100, 100, 100, 194]) self.assertEqual(chips.toint(), total) chips = PokerChips(values, 20000) chips.subtract([0, 20, 0, 0, 0]) self.assertEqual(chips.chips, [8, 6, 3, 5, 3]) self.assertEqual(chips.toint(), 16000) chips = PokerChips(values, 600000) self.assertEqual(chips.chips, [8, 6, 4, 6, 236]) chips = PokerChips(values) chips.add(600000) self.assertEqual(chips.chips, [8, 6, 4, 6, 236]) chips = PokerChips(values) chips.set([200, 0, 0, 0, 0]) self.assertEqual(chips.chips, [100, 50, 0, 0, 0]) chips = PokerChips(values, 200) chips.subtract(250) self.assertEqual(chips.chips, [0, 0, 0, 0, 0]) chips = PokerChips(values, 20000) self.assertEqual(chips.__str__(), "PokerChips([8, 6, 4, 6, 4]) = 20000 (-0)") self.assertEqual(chips.__repr__(), "PokerChips([8, 6, 4, 6, 4])") def test2(self): """ """ pokerchips.MAX_CHIPS_PER_STACK = 30 values = [100, 200, 500, 1000, 2500, 500000] chips = PokerChips(values, 0) self.assertEqual(chips.chips, [0, 0, 0, 0, 0, 0]) chips = PokerChips(values, 20000) self.assertEqual(chips.chips, [8, 6, 4, 6, 4, 0]) chips.add([150, 0, 0, 0, 0, 0]) self.assertEqual(chips.chips, [30, 30, 20, 6, 4, 0]) self.assertEqual(chips.toint(), 35000) chips = PokerChips(values, 20000) total = 20000 + sum(map(lambda x: x * 150, values)) chips.add([150, 150, 150, 150, 150, 150]) self.assertEqual(chips.chips, [30, 30, 30, 31, 44, 151]) self.assertEqual(chips.toint(), total) chips = PokerChips(values, 20000) chips.subtract([0, 20, 0, 0, 0, 0]) self.assertEqual(chips.chips, [8, 6, 3, 5, 3, 0]) self.assertEqual(chips.toint(), 16000) chips = PokerChips(values, 600000) self.assertEqual(chips.chips, [8, 6, 4, 6, 36, 1]) chips = PokerChips(values) chips.add(600000) self.assertEqual(chips.chips, [8, 6, 4, 6, 36, 1]) chips = PokerChips(values) chips.set([200, 0, 0, 0, 0, 0]) self.assertEqual(chips.chips, [30, 30, 22, 0, 0, 0]) chips = PokerChips(values, 20000) chips.subtract(25000) self.assertEqual(chips.chips, [0, 0, 0, 0, 0, 0]) chips = PokerChips(values, 20000) self.assertEqual(chips.__str__(), "PokerChips([8, 6, 4, 6, 4, 0]) = 20000 (-0)") self.assertEqual(chips.__repr__(), "PokerChips([8, 6, 4, 6, 4, 0])") def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestChips)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestChips, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/chips.py ) ; ( cd ../tests ; make TESTS='chips.py' check )" # End: poker-engine-1.3.6/tests/test-gamehistory.py.in0000644000175000017500000006735211344205422016470 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest import os.path import shutil import libxml2 import time import string from pokerengine import pokercards from pokerengine import pokergame CallbackIds = None CallbackArgs = None # ------------------------------------------------------------ def InitCallback(): global CallbackIds global CallbackArgs CallbackIds = None CallbackArgs = None # ------------------------------------------------------------ def Callback(id, *args): global CallbackIds global CallbackArgs if not CallbackIds: CallbackIds = [] if not CallbackArgs: CallbackArgs = [] CallbackIds.append(id) CallbackArgs.append(args) # ------------------------------------------------------------ class PokerGameHistoryTestCase(unittest.TestCase): TestConfDirectory = '@srcdir@/test-data/conf' TestConfigUrl = 'unittest.%s.xml' TestConfigFile = 'config' # ------------------------------------------------------------ def setUp(self): conf_dirs = ['.', PokerGameHistoryTestCase.TestConfDirectory, '~/conf'] self.game = pokergame.PokerGameServer(PokerGameHistoryTestCase.TestConfigUrl, conf_dirs) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) InitCallback() # ------------------------------------------------------------ def tearDown(self): pass # ------------------------------------------------------------ def testPokerGameMessage(self): """Test Poker game messages""" game_time = time.time() board = pokercards.PokerCards() hand1 = pokercards.PokerCards(['4d', 'Ts']) hand2 = pokercards.PokerCards(['3h', 'Kc']) history = [ \ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2], 7, { 1 : 500, 2 : 1000}), \ ('wait_for', 1, 'first_round'), \ ('player_list', [1, 2]), \ ('round', 'round1', board, { 1 : hand1, 2 : hand2}), \ ('showdown', board, {1 : hand1, 2 : hand2}), \ ('position', 1), \ ('blind_request', 1, 1000, 100, 'big_and_dead'), \ ('wait_blind', 1), \ ('blind', 1, 1000, 0), \ ('ante_request', 1, 100), \ ('ante', 1, 500), \ ('all-in', 1), \ ('call', 1, 500), \ ('check', 1), \ ('fold', 1), \ ('raise', 1, 500), \ ('canceled', 1, 10), \ ('end', [1], [{ 'serial2share': { 1: 500 } }]), \ ('sitOut', 1), \ ('leave', [(1, 2), (2, 7)]), \ ('finish', 1), \ ('muck', (1,2)), \ ('rebuy', 1, 500), \ ('unknown',) \ ] # Register the callback function self.game.registerCallback(Callback) # Generate all the type of messages managed for message in history: apply(self.game.historyAdd,message) # All the messages are stored self.failUnlessEqual(self.game.historyGet(), history) # Check the callback calls self.failUnlessEqual(CallbackArgs, history) # ------------------------------------------------------------ def testHistory2messagesGameEvent(self): """Test Poker Game History to message Game event""" game_time = time.time() hand_serial = 2 variant = 'variant' betting_structure = 'betting_structure' history = [ \ ('game', 1, hand_serial, 3, game_time, 'variant','betting_structure', [1, 2], 7, { 1 : 500, 2 : 1000}) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, 'hand #%d, %s, %s' % (hand_serial, variant, betting_structure)) self.failUnlessEqual(message, []) # ------------------------------------------------------------ def testHistory2messagesWaitForEvent(self): """Test Poker Game History to message wait for event""" history = [ \ ('wait_for', 1, 'first_round'), \ ('wait_for', 2, 'late') \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') message1 = '1 waiting for big blind' message2 = '2 waiting for late blind' self.failUnlessEqual(message, [message1, message2]) # ------------------------------------------------------------ def testHistory2messagesCheck(self): """Test Poker Game History to message check""" history = [ \ ('check', 1) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, ['1 checks']) # ------------------------------------------------------------ def testHistory2messagesFold(self): """Test Poker Game History to message fold""" history = [ \ ('fold', 1) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, ['1 folds']) # ------------------------------------------------------------ def testHistory2messagesRaise(self): """Test Poker Game History to message Raise""" history = [ \ ('raise', 1, 500) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, ['1 raises 5']) # ------------------------------------------------------------ def testHistory2messagesAllIn(self): """Test Poker Game History to message All In""" history = [ \ ('all-in', 1) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, ['1 is all in']) # ------------------------------------------------------------ def testHistory2messagesSitOut(self): """Test Poker Game History to message Sit out""" history = [ \ ('sitOut', 1) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, ['1 sits out']) # ------------------------------------------------------------ def testHistory2messagesAnte(self): """Test Poker Game History to message Ante""" history = [ \ ('ante', 1, 500) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, ['1 pays 5 ante']) # ------------------------------------------------------------ def testHistory2messagesBlind(self): """Test Poker Game History to message blind""" history = [ \ ('blind', 1, 1000, 5), \ ('blind', 1, 1000, 0) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, [ '1 pays 10 blind and 5 dead', '1 pays 10 blind' ]) # ------------------------------------------------------------ def testHistory2messagesCancelled(self): """Test Poker Game History to message blind""" history = [ \ ('canceled', 1, 100), \ ('canceled', 0, 100), \ ('canceled', 0, 0) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, [ 'turn canceled (1 returned to 1)', 'turn canceled', 'turn canceled' ]) # ------------------------------------------------------------ def testHistory2messagesShowdown(self): """Test Poker Game History to message showdown""" board = pokercards.PokerCards(['Ad', 'As']) hand1 = pokercards.PokerCards(['4d', 'Ts']) hand2 = pokercards.PokerCards(['3h', 'Kc']) nocards = pokercards.PokerCards([pokercards.PokerCards.NOCARD, pokercards.PokerCards.NOCARD]) history = [ \ ('showdown', board, { 1 : hand1, 2 : hand2}), \ ('showdown', pokercards.PokerCards(), {1 : hand1, 2 : nocards}), \ ] subject, message = self.GetMessagesFromHistory(history, str, True) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, [ 'Board: Ad As', 'Cards player 1: 4d Ts', 'Cards player 2: 3h Kc', 'Cards player 1: 4d Ts' ]) # ------------------------------------------------------------ def testHistory2messagesRound(self): """Test Poker Game History to message showdown""" board = pokercards.PokerCards(['Ad', 'As']) hand1 = pokercards.PokerCards(['4d', 'Ts']) hand2 = pokercards.PokerCards(['3h', 'Kc']) nocards = pokercards.PokerCards([pokercards.PokerCards.NOCARD, pokercards.PokerCards.NOCARD]) history = [ \ ('round', 'round1', board, { 1 : hand1, 2 : hand2}), \ ('round', 'round2', pokercards.PokerCards(), {1 : hand1, 2 : nocards}), \ ('round', 'round3', pokercards.PokerCards(), {}), \ ] subject, message = self.GetMessagesFromHistory(history, str, True) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, [ 'round1, 2 players', 'Board: Ad As', 'Cards player 1: 4d Ts', 'Cards player 2: 3h Kc', 'round2, 2 players', 'Cards player 1: 4d Ts', 'round3' ]) # ------------------------------------------------------------ def testHistory2messagesEnd(self): """Test Poker Game History to end message""" self.game.variant = 'holdem' # The player 1 wins because all the other players are fold game_state ={ 'serial2share': { 1: 500 } } history = [ ('end', [1], [game_state]) ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') message1 = '1 receives 5 (everyone else folded)' self.failUnlessEqual(message, [message1]) # Invalid frame invalid_frame = { 'type': 'invalid'} hand1 = pokercards.PokerCards(['Ad', 'As']) board = pokercards.PokerCards(['9d', '6s', 'Td', '4d', '4h']) game_state ={ 'serial2best' : { 1 : { 'hi' : self.game.eval.best('hi', hand1.tolist(True) + board.tolist(True), []), 'low' : self.game.eval.best('low', hand1.tolist(True) + board.tolist(True), []) } } } history = [ ('end', [1], [game_state, invalid_frame]) ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, []) # Left over frame frame = { 'type': 'left_over', 'serial' : 1, 'chips_left' : 10 } history = [ ('end', [1], [game_state, frame]) ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, ['1 receives 10 odd chips']) # uncalled frame frame = { 'type': 'uncalled', 'serial' : 1, 'uncalled' : 10 } history = [ ('end', [1], [game_state, frame]) ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, ['returning uncalled bet 0.10 to 1']) # Resolve frame 1 frame = { 'type': 'resolve', 'serials' : [1, 2, 3], 'serial2share': { 1: 300, 2 : 200 }, 'hi' : [1, 2], 'low' : [1], 'pot' : 500, 'chips_left' : 3 } hand1 = pokercards.PokerCards(['8h', '2s']) hand2 = pokercards.PokerCards(['Ac', '2c']) board = pokercards.PokerCards(['9d', '5s', '3h', '4d', '5s']) game_state ={ 'serial2best' : { 1 : { 'hi' : self.game.eval.best('hi', hand1.tolist(True) + board.tolist(True), []), 'low' : self.game.eval.best('low', hand1.tolist(True) + board.tolist(True), []) }, 2 : { 'hi' : self.game.eval.best('hi', hand2.tolist(True) + board.tolist(True), []), 'low' : self.game.eval.best('low', hand2.tolist(True) + board.tolist(True), []) } } } history = [ ('end', [1], [game_state, frame]) ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, [ '1 shows High card Nine for hi ', '1 shows 8, 5, 4, 3, 2 for low ', '2 shows Straight Five to Ace for hi ', '1 2 tie for hi ', '1 wins low ', 'winners share a pot of 5 (minus 3 odd chips)', '1 receives 3', '2 receives 2' ]) # Resolve frame 2 frame = { 'type': 'resolve', 'serials' : [1, 2], 'serial2share': { 1: 300, 2 : 200 }, 'hi' : [1, 2], 'pot' : 500, 'chips_left' : 3 } hand1 = pokercards.PokerCards(['Ad', 'As']) hand2 = pokercards.PokerCards(['Kd', '3c']) board = pokercards.PokerCards(['9d', '6s', 'Td', '4d', '4h']) game_state ={ 'serial2best' : { 1 : { 'hi' : self.game.eval.best('hi', hand1.tolist(True) + board.tolist(True), []), 'low' : self.game.eval.best('low', hand1.tolist(True) + board.tolist(True), []) }, 2 : { 'hi' : self.game.eval.best('hi', hand2.tolist(True) + board.tolist(True), []) } } } history = [ ('end', [1], [game_state, frame]) ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, [ '1 shows Two pairs Aces and Fours, Ten kicker for hi ', '2 mucks loosing hand', '1 2 tie for hi ', 'winners share a pot of 5 (minus 3 odd chips)', '1 receives 3', '2 receives 2' ]) # ------------------------------------------------------------ def testHistory2messagesEmpty(self): """Test Poker Game History to message empty""" history = [ \ ('player_list', [1, 2]), \ ('position', 1), \ ('blind_request', 1, 1000, 100, 'big_and_dead'), \ ('wait_blind', 1), \ ('rebuy', 1, 500), \ ('ante_request', 1, 100), \ ('leave', [(1, 2), (2, 7)]), \ ('finish', 1), \ ('muck', (1,2)), \ ('Unknown',) \ ] subject, message = self.GetMessagesFromHistory(history) self.failUnlessEqual(subject, '') self.failUnlessEqual(message, []) # ------------------------------------------------------------ def testHistoryReduce(self): """Test Poker Game History reduce""" game_time = time.time() board = pokercards.PokerCards() hand1 = pokercards.PokerCards(['4d', 'Ts']) hand2 = pokercards.PokerCards(['3h', 'Kc']) # SitOut & Wait blind history = [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('position', 0), ('sitOut', 1), ('position', 1), ('wait_blind', 2), ('sitOut', 3), ('position', 3) ] self.game.turn_history = history self.game.historyReduce() self.failUnlessEqual(self.game.historyGet(), [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [4], 7, { 4 : 800 }), ('position', 0) ]) # Player list history = [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('player_list', [1, 2, 3]), ('player_list', [1, 2]) ] self.game.turn_history = history self.game.historyReduce() self.failUnlessEqual(self.game.historyGet(), [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('player_list', [1, 2]) ]) # Blind Request history = [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('blind_request', 1, 500, 0, 'small'), ('blind_request', 2, 1000, 100, 'big_and_dead') ] self.game.turn_history = history self.game.historyReduce() self.failUnlessEqual(self.game.historyGet(), [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('blind_request', 2, 1000, 100, 'big_and_dead') ]) # Ante Request history = [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('ante_request', 1, 100), ('ante_request', 2, 100) ] self.game.turn_history = history self.game.historyReduce() self.failUnlessEqual(self.game.historyGet(), [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('ante_request', 2, 100) ]) # Unable to update position history = [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('position', 7), ] self.game.turn_history = history # The player 7 does not exist self.game.historyReduce() # The position has not been updated self.failUnlessEqual(self.game.historyGet(), history) # the blind request is removed history = [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('position', 7), ('blind', 1, 0), ('position', 8), ('blind_request', 2, 0), ('blind', 2, 0), ('player_list', [1, 2]), ] self.game.turn_history = history self.game.historyReduce() self.failUnlessEqual(('position', 8), self.game.turn_history[3]) self.failUnlessEqual(('blind', 2, 0), self.game.turn_history[4]) # the blind request is not removed because it is last history = [ ('game', 1, 2, 3, game_time, 'variant','betting_structure', [1, 2, 3, 4], 7, { 1 : 500, 2 : 600, 3 : 700, 4 : 800 }), ('position', 7), ('blind', 1, 0), ('position', 8), ('blind_request', 2, 0), ] self.game.turn_history = history self.game.historyReduce() self.failUnlessEqual(('position', 8), self.game.turn_history[3]) self.failUnlessEqual(('blind_request', 2, 0), self.game.turn_history[4]) # ------------------------------------------------------------ def GetMessagesFromHistory(self, history, serial2name = str, pocket_messages = False): self.game.turn_history = [] for message in history: apply(self.game.historyAdd,message) return pokergame.history2messages(self.game, self.game.historyGet(), serial2name, pocket_messages, int(os.environ.get('VERBOSE_T', 0))) # ------------------------------------------------------------ def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerGameHistoryTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(PokerGameHistoryTestCase, prefix = "test2")) return suite # ------------------------------------------------------------ def GetTestedModule(): return pokergame # ------------------------------------------------------------ def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # ------------------------------------------------------------ if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-gamehistory.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokergame.py' TESTS='coverage-reset test-gamehistory.py coverage-report' check )" # End: poker-engine-1.3.6/tests/history.py.in0000644000175000017500000001147711344205422014656 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") from pprint import pprint from string import split import unittest from pokerengine.pokergame import PokerGameServer, history2messages from pokerengine.pokercards import PokerCards class PokerPredefinedDecks: def __init__(self, decks): self.decks = decks self.index = 0 def shuffle(self, deck): deck[:] = self.decks[self.index][:] self.index += 1 if self.index >= len(self.decks): self.index = 0 class TestHistory(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game.setVariant("holdem") self.game.setBettingStructure("2-4-limit") predefined_decks = [ "8d 2h 2c 8c 4c Kc Ad 9d Ts Jd 5h Tc 4d 9h 8h 7h 9c 2s 3c Kd 5s Td 5d Th 3s Kh Js Qh 7d 2d 3d 9s Qd Ac Jh Jc Qc 6c 7s Ks 5c 4h 7c 4s Qs 6s 6h Ah 6d As 3h 8s", # distributed from the end ] self.game.shuffler = PokerPredefinedDecks(map(lambda deck: self.game.eval.string2card(split(deck)), predefined_decks)) def tearDown(self): del self.game def make_new_player(self, serial, seat): game = self.game self.failUnless(game.addPlayer(serial, seat)) self.failUnless(game.payBuyIn(serial, game.bestBuyIn())) self.failUnless(game.sit(serial)) game.botPlayer(serial) game.autoBlindAnte(serial) def test1(self): for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_player(serial, seat) self.game.beginTurn(1) self.assertEqual(str(history2messages(self.game, self.game.turn_history, pocket_messages = True)), "('hand #1, holdem, 2-4-limit', ['2 pays 1 blind', '3 pays 2 blind', 'pre-flop, 4 players', 'Cards player 1: 8s Ah', 'Cards player 2: 3h 6h', 'Cards player 3: As 6s', 'Cards player 4: 6d Qs', '4 calls 2', '1 calls 2', '2 calls 1', '3 checks', 'flop, 4 players', 'Board: 4s 7c 4h', 'Cards player 1: 8s Ah', 'Cards player 2: 3h 6h', 'Cards player 3: As 6s', 'Cards player 4: 6d Qs', '2 checks', '3 checks', '4 checks', '1 checks', 'turn, 4 players', 'Board: 4s 7c 4h 5c', 'Cards player 1: 8s Ah', 'Cards player 2: 3h 6h', 'Cards player 3: As 6s', 'Cards player 4: 6d Qs', '2 raises 4', '3 folds', '4 folds', '1 calls 4', 'river, 2 players', 'Board: 4s 7c 4h 5c Ks', 'Cards player 1: 8s Ah', 'Cards player 2: 3h 6h', '2 raises 4', '1 calls 4', 'Rake 1.20', 'Board: 4s 7c 4h 5c Ks', 'Cards player 1: 8s Ah', 'Cards player 2: 3h 6h', '2 shows Straight Seven to Trey for hi ', '1 mucks loosing hand', '2 wins hi ', '2 receives 24'])") def test2(self): for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_player(serial, seat) self.game.beginTurn(1) for event in self.game.historyGet(): if event[0] == "round": (type, name, board, pockets) = event for (player_serial, pocket) in pockets.iteritems(): pocket.loseNotVisible() self.assertEqual(pocket, PokerCards([PokerCards.NOCARD] * pocket.len())) def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestHistory)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestHistory, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/history.py ) ; ( cd ../tests ; make TESTS='history.py' check )" # End: poker-engine-1.3.6/tests/test-pokercards.py.in0000644000175000017500000003141411344205422016260 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest from pokerengine import pokercards class PokerCardsTestCase(unittest.TestCase): # ----------------------------------------------------------------------------------------------------- def setUp(self): pass # ----------------------------------------------------------------------------------------------------- def tearDown(self): pass # ----------------------------------------------------------------------------------------------------- def testInit(self): """Test PokerCards : Creation of cards""" empty = pokercards.PokerCards() self.failUnlessEqual(empty.toRawList(), []) cards = pokercards.PokerCards(12) self.failUnlessEqual(cards.toRawList(), [12]) self.failUnless(cards.areVisible()) cards = pokercards.PokerCards([12, 25, 37, pokercards.PokerCards.NOCARD]) self.failUnlessEqual(cards.toRawList(), [12, 25, 37, pokercards.PokerCards.NOCARD]) self.failIf(cards.areVisible()) cards = pokercards.PokerCards('Ah') self.failUnlessEqual(cards.toRawList(), [12]) self.failUnless(cards.areVisible()) cards = pokercards.PokerCards(['Ah', 'Ad', 'Kc']) self.failUnlessEqual(cards.toRawList(), [12, 25, 37]) self.failUnless(cards.areVisible()) cards = pokercards.PokerCards(['Ah', 25, 'Kc']) self.failUnlessEqual(cards.toRawList(), [12, 25, 37]) self.failUnless(cards.areVisible()) cards2 = pokercards.PokerCards(cards) self.failUnlessEqual(cards2, cards) # ----------------------------------------------------------------------------------------------------- def TestGetValue(self): """Test PokerCards : Get value""" cards = pokercards.PokerCards() self.failUnlessEqual(cards.getValue(12), 12) self.failUnlessEqual(cards.getValue('Ah'), 12) self.failUnlessEqual(cards.getValue(PokerCards.NOCARD)) self.failUnlessRaises(UserWarning, cards.add, 52, True) self.failUnlessRaises(UserWarning, cards.add, -1, True) self.failUnlessRaises(UserWarning, cards.add, 'Aa', True) # ----------------------------------------------------------------------------------------------------- def testAddInvalid(self): """Test PokerCards : Invalid card adding""" cards = pokercards.PokerCards() self.failUnlessRaises(UserWarning,cards.add, 52, True) self.failUnlessRaises(UserWarning,cards.add, -1, True) self.failUnlessRaises(UserWarning,cards.add, 'Aa', True) # ----------------------------------------------------------------------------------------------------- def testAddVisible(self): """Test PokerCards : Add visible card""" cards = pokercards.PokerCards() cards.add(12, True) self.failUnless(cards.hasCard(12)) self.failUnlessEqual(cards.getVisible(), [12]) cards = pokercards.PokerCards() cards.add('3s', True) self.failUnless(cards.hasCard(40)) self.failUnlessEqual(cards.getVisible(), [40]) cards.add(cards.nocard(), True) self.failUnless(cards.hasCard(cards.nocard())) # ----------------------------------------------------------------------------------------------------- def testAddInvisible(self): """Test PokerCards : Add invisible card""" cards = pokercards.PokerCards() cards.add(12, False) self.failUnless(cards.hasCard(12)) self.failUnlessEqual(cards.getVisible(), []) cards = pokercards.PokerCards() cards.add('3s', False) self.failUnless(cards.hasCard(40)) self.failUnlessEqual(cards.getVisible(), []) # ----------------------------------------------------------------------------------------------------- def testAllVisible(self): """Test PokerCards : All cards visible""" cards = pokercards.PokerCards() cards.add(12, False) cards.add(25, False) cards.add(45, False) self.failUnlessEqual(cards.getVisible(), []) cards.allVisible() self.failUnless(cards.areVisible()) # ----------------------------------------------------------------------------------------------------- def testAllHidden(self): """Test PokerCards : All cards hidden""" cards = pokercards.PokerCards() cards.add(12, True) cards.add(25, False) cards.add(45, True) self.failUnlessEqual(cards.getVisible(), [12, 45]) self.failIf(cards.areHidden()) cards.allHidden() self.failUnless(cards.areHidden()) # ----------------------------------------------------------------------------------------------------- def testSetVisible(self): """Test PokerCards : Set card visible""" cards = pokercards.PokerCards() cards.add(12, True) self.failUnlessEqual(cards.getVisible(), [12]) cards.setVisible(12,False) self.failUnlessEqual(cards.getVisible(), []) cards.setVisible(12,True) self.failUnlessEqual(cards.getVisible(), [12]) cards.setVisible(15,True) self.failUnlessEqual(cards.getVisible(), [12]) cards.setVisible(cards.nocard(),False) self.failUnlessEqual(cards.getVisible(), [12]) # ----------------------------------------------------------------------------------------------------- def testIsEmpty(self): """Test PokerCards : Is empty""" cards = pokercards.PokerCards() self.failUnless(cards.isEmpty()) cards.add(12, True) self.failIf(cards.isEmpty()) # ----------------------------------------------------------------------------------------------------- def testLen(self): """Test PokerCards : Cards lenght""" cards = pokercards.PokerCards() self.failUnlessEqual(cards.len(), 0) cards.add(12, True) self.failUnlessEqual(cards.len(), 1) # ----------------------------------------------------------------------------------------------------- def testHasCard(self): """Test PokerCards : Has card""" cards = pokercards.PokerCards([12,26]) self.failUnless(cards.hasCard(12)) self.failIf(cards.hasCard(27)) # ----------------------------------------------------------------------------------------------------- def testOperatorEqu(self): """Test PokerCards : Cards operator equ and ne""" cards1 = pokercards.PokerCards([12,26]) cards2 = pokercards.PokerCards([26,12]) cards3 = pokercards.PokerCards([26,12,50]) self.failIf(cards1 == [12,26]) self.failUnless(cards1 != [12,26]) self.failUnless(cards1 == cards2) self.failIf(cards1 == cards3) self.failUnless(cards1 != cards3) # ----------------------------------------------------------------------------------------------------- def testCopy(self): """Test PokerCards : Cards copy""" cards1 = pokercards.PokerCards([12,26]) cards2 = cards1.copy() self.failUnless(cards1 == cards2) cards2.add(13,True) self.failIf(cards1 == cards2) # ----------------------------------------------------------------------------------------------------- def testToList(self): """Test PokerCards : Cards to list""" cards = pokercards.PokerCards([12,26]) self.failUnlessEqual(cards.tolist(False), [12,26]) self.failUnlessEqual(cards.tolist(True), [12,26]) cards.setVisible(26,False) self.failUnlessEqual(cards.tolist(False), [12, cards.nocard()]) self.failUnlessEqual(cards.tolist(True), [12, 26]) cards.allHidden() self.failUnlessEqual(cards.tolist(False), [cards.nocard(), cards.nocard()]) self.failUnlessEqual(cards.tolist(True), [12, 26]) # ----------------------------------------------------------------------------------------------------- def testNoCard(self): """Test PokerCards : No card value""" cards = pokercards.PokerCards() self.failUnlessEqual(cards.nocard(), pokercards.PokerCards.NOCARD) # ----------------------------------------------------------------------------------------------------- def testAreAllNocard(self): """Test PokerCards : Are all no card""" cards = pokercards.PokerCards([12,26]) self.failIf(cards.areAllNocard()) cards = pokercards.PokerCards([cards.nocard(), 26]) self.failIf(cards.areAllNocard()) cards = pokercards.PokerCards([cards.nocard(), cards.nocard()]) self.failUnless(cards.areAllNocard()) # ----------------------------------------------------------------------------------------------------- def testLoseNotVisible(self): """Test PokerCards : Lose not visible""" cards = pokercards.PokerCards([12,26]) cards.loseNotVisible() self.failUnlessEqual(cards.toRawList(), [12,26]) cards.add(33, False) cards.loseNotVisible() self.failUnlessEqual(cards.toRawList(), [12,26,cards.nocard()]) cards.add(43, True) cards.loseNotVisible() self.failUnlessEqual(cards.toRawList(), [12,26,cards.nocard(),43]) cards.add(cards.nocard(), True) cards.loseNotVisible() self.failUnlessEqual(cards.toRawList(), [12,26,cards.nocard(),43, cards.nocard()]) # ----------------------------------------------------------------------------------------------------- def testOperatorRepr(self): """Test PokerCards : Operator repr""" cards = pokercards.PokerCards([12,26]) self.failUnlessEqual(repr(cards), '%s(%s)' %('PokerCards', [12,26])) # ----------------------------------------------------------------------------------------------------- def testOperatorStr(self): """Test PokerCards : Operator str""" cards = pokercards.PokerCards() cards.add(12, True) cards.add(26, False) self.failUnlessEqual(str(cards), str([ 'Card(12, visible)', 'Card(26, not visible)'])) # ----------------------------------------------------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerCardsTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(PokerCardsTestCase, prefix = "test2")) return suite # ----------------------------------------------------------------------------------------------------- def GetTestedModule(): return pokercards # ----------------------------------------------------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # ----------------------------------------------------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-pokercards.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokercards.py' TESTS='coverage-reset test-pokercards.py coverage-report' check )" # End: poker-engine-1.3.6/tests/conf/0002755000175000017500000000000011540702077013201 500000000000000poker-engine-1.3.6/tests/conf/poker..02-.04-pot-limit.xml0000644000175000017500000000207410340654253017474 00000000000000 No limit .02/.04 poker-engine-1.3.6/tests/conf/poker.ante-10-20-limit.xml0000644000175000017500000000176110340654253017464 00000000000000 Limit 10/20 poker-engine-1.3.6/tests/conf/poker.50-100-pot-limit.xml0000644000175000017500000000216710340654253017423 00000000000000 No limit 50/100 poker-engine-1.3.6/tests/conf/poker..50-1-no-limit.xml0000644000175000017500000000176110340654253017152 00000000000000 No limit .50/1 poker-engine-1.3.6/tests/conf/poker.10-20-limit.xml0000644000175000017500000000174710340654253016543 00000000000000 Limit 10/20 poker-engine-1.3.6/tests/conf/poker.50-100-no-limit.xml0000644000175000017500000000202310340654253017224 00000000000000 No limit 50/100 poker-engine-1.3.6/tests/conf/poker..02-.04-no-limit.xml0000644000175000017500000000173010340654253017304 00000000000000 No limit .02/.04 poker-engine-1.3.6/tests/conf/poker.3-6-limit.xml0000644000175000017500000000173310340654253016404 00000000000000 Limit 3/6 poker-engine-1.3.6/tests/conf/poker..50.1-limit.xml0000644000175000017500000000173210340654253016537 00000000000000 Limit .50/1 poker-engine-1.3.6/tests/conf/poker..25-.50-limit.xml0000644000175000017500000000172410340654253016703 00000000000000 Limit .25/.50 poker-engine-1.3.6/tests/conf/poker..50-1-limit.xml0000644000175000017500000000172110340654253016534 00000000000000 Limit .50/1 poker-engine-1.3.6/tests/conf/poker.1-2-pot-limit.xml0000644000175000017500000000212410340654253017171 00000000000000 No limit 1/2 poker-engine-1.3.6/tests/conf/poker.ante-1-2-limit.xml0000644000175000017500000000173610340654253017326 00000000000000 Limit 1/2 poker-engine-1.3.6/tests/conf/poker.10-15-pot-limit.xml0000644000175000017500000000204610340654253017340 00000000000000 Pot limit 10/15 poker-engine-1.3.6/tests/conf/poker.3-6-no-limit.xml0000644000175000017500000000176010340654253017016 00000000000000 No limit 3/6 poker-engine-1.3.6/tests/conf/poker.30-60-no-limit.xml0000644000175000017500000000200410340654253017146 00000000000000 No limit 30/60 poker-engine-1.3.6/tests/conf/poker.10-20-pot-limit.xml0000644000175000017500000000215010340654253017330 00000000000000 No limit 10/20 poker-engine-1.3.6/tests/conf/poker..01-.02-no-limit.xml0000644000175000017500000000173010340654253017301 00000000000000 No limit .01/.02 poker-engine-1.3.6/tests/conf/poker.ante-.50-1-limit.xml0000644000175000017500000000173210340654253017463 00000000000000 Limit .50/1 poker-engine-1.3.6/tests/conf/poker.1-2-no-limit.xml0000644000175000017500000000176010340654253017010 00000000000000 No limit 1/2 poker-engine-1.3.6/tests/conf/poker.omaha.xml0000644000175000017500000000323310376355040016046 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/tests/conf/poker.200-400-limit.xml0000644000175000017500000000200210340654253016667 00000000000000 Limit 200/400 poker-engine-1.3.6/tests/conf/poker.0-0-limit.xml0000644000175000017500000000166310340654253016375 00000000000000 No blind, no antes poker-engine-1.3.6/tests/conf/poker.100-200-pot-limit.xml0000644000175000017500000000217410340654253017476 00000000000000 No limit 100/200 poker-engine-1.3.6/tests/conf/poker.15-30-limit.xml0000644000175000017500000000175610340654253016551 00000000000000 Limit 15/30 poker-engine-1.3.6/tests/conf/poker.150-300-limit.xml0000644000175000017500000000200010340654253016670 00000000000000 Limit 150/300 poker-engine-1.3.6/tests/conf/poker.30-60-pot-limit.xml0000644000175000017500000000215010340654253017336 00000000000000 No limit 30/60 poker-engine-1.3.6/tests/conf/poker.omaha8.xml0000644000175000017500000000331110376355040016133 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/tests/conf/poker..02-.04-limit.xml0000644000175000017500000000170610340654253016675 00000000000000 Limit .02/.04 poker-engine-1.3.6/tests/conf/poker.2-4-pot-limit.xml0000644000175000017500000000212410340654253017174 00000000000000 No limit 2/4 poker-engine-1.3.6/tests/conf/poker.holdem.xml0000644000175000017500000000305310376355040016231 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/tests/conf/poker..10-.25-pot-limit.xml0000644000175000017500000000211310340654253017470 00000000000000 No limit .10/.25 poker-engine-1.3.6/tests/conf/poker..05..10-limit.xml0000644000175000017500000000171510340654253016676 00000000000000 Limit .05/.10 poker-engine-1.3.6/tests/conf/poker.10-15-limit.xml0000644000175000017500000000175510340654253016546 00000000000000 Limit 15/30 poker-engine-1.3.6/tests/conf/poker.ante-5-10-limit.xml0000644000175000017500000000174710340654253017413 00000000000000 Limit 5/10 poker-engine-1.3.6/tests/conf/poker.1-2-limit.xml0000644000175000017500000000172410340654253016376 00000000000000 Limit 1/2 poker-engine-1.3.6/tests/conf/poker.3-6-pot-limit.xml0000644000175000017500000000212410340654253017177 00000000000000 No limit 3/6 poker-engine-1.3.6/tests/conf/poker..25..50-limit.xml0000644000175000017500000000172610340654253016706 00000000000000 Limit .25/.50 poker-engine-1.3.6/tests/conf/poker.level-15-30-no-limit.xml0000644000175000017500000000212310340654253020255 00000000000000 No limit 15/30 poker-engine-1.3.6/tests/conf/poker..05-.10-limit.xml0000644000175000017500000000170710340654253016676 00000000000000 Limit .05/.10 poker-engine-1.3.6/tests/conf/poker.levels-blinds.xml0000644000175000017500000000227310356472531017532 00000000000000 poker-engine-1.3.6/tests/conf/poker..05-.10-pot-limit.xml0000644000175000017500000000211110340654253017464 00000000000000 No limit .05/.10 poker-engine-1.3.6/tests/conf/poker.50-100-limit.xml0000644000175000017500000000176110340654253016622 00000000000000 Limit 50/100 poker-engine-1.3.6/tests/conf/poker.7stud.xml0000644000175000017500000000312210376355040016024 00000000000000 2h 2d 2c 2s 3h 3d 3c 3s 4h 4d 4c 4s 5h 5d 5c 5s 6h 6d 6c 6s 7h 7d 7c 7s 8h 8d 8c 8s 9h 9d 9c 9s Th Td Tc Ts Jh Jd Jc Js Qh Qd Qc Qs Kh Kd Kc Ks Ah Ad Ac As poker-engine-1.3.6/tests/conf/poker.30-60-limit.xml0000644000175000017500000000175610340654253016551 00000000000000 Limit 30/60 poker-engine-1.3.6/tests/conf/poker..02..04-limit.xml0000644000175000017500000000170610340654253016676 00000000000000 Limit .02/.04 poker-engine-1.3.6/tests/conf/poker.5-10-limit.xml0000644000175000017500000000173610340654253016464 00000000000000 Limit 5/10 poker-engine-1.3.6/tests/conf/poker..50-1-pot-limit.xml0000644000175000017500000000212510340654253017333 00000000000000 No limit .50/1 poker-engine-1.3.6/tests/conf/poker.ante-3-6-limit.xml0000644000175000017500000000174010340654253017327 00000000000000 Limit 3/6 poker-engine-1.3.6/tests/conf/poker.10-20-no-limit.xml0000644000175000017500000000200410340654253017140 00000000000000 No limit 10/20 poker-engine-1.3.6/tests/conf/poker.2-4-limit.xml0000644000175000017500000000173410340654253016402 00000000000000 Limit 2/4 poker-engine-1.3.6/tests/conf/poker.level-10-20-no-limit.xml0000644000175000017500000000124610356472475020267 00000000000000 No limit tournament poker.payouts.xml poker-engine-1.3.6/tests/conf/poker.level-2-4-limit.xml0000644000175000017500000000203110340654253017476 00000000000000 Limit 2/4 poker-engine-1.3.6/tests/conf/poker.level-no-limit.xml0000644000175000017500000000411210356472475017625 00000000000000 No limit tournament poker-engine-1.3.6/tests/conf/poker.5-10-no-limit.xml0000644000175000017500000000177710340654253017103 00000000000000 No limit 5/10 poker-engine-1.3.6/tests/conf/poker..01-.02-pot-limit.xml0000644000175000017500000000207410340654253017471 00000000000000 No limit .01/.02 poker-engine-1.3.6/tests/conf/poker.ante-.25-.50-limit.xml0000644000175000017500000000173110340654253017626 00000000000000 Limit .25/.50 poker-engine-1.3.6/tests/conf/poker.100-200-limit.xml0000644000175000017500000000177210340654253016701 00000000000000 Limit 100/200 poker-engine-1.3.6/tests/conf/poker.level-10-15-pot-limit.xml0000644000175000017500000000227610340654253020452 00000000000000 Pot limit 10/15 poker-engine-1.3.6/tests/conf/poker.5-10-pot-limit.xml0000644000175000017500000000214310340654253017255 00000000000000 No limit 5/10 poker-engine-1.3.6/tests/conf/poker..10-.25-limit.xml0000644000175000017500000000171510340654253016677 00000000000000 Limit .10/.25 poker-engine-1.3.6/tests/conf/poker..05-.10-no-limit.xml0000644000175000017500000000174510340654253017312 00000000000000 No limit .05/.10 poker-engine-1.3.6/tests/conf/poker..25-.50-no-limit.xml0000644000175000017500000000174710340654253017322 00000000000000 No limit .25/.50 poker-engine-1.3.6/tests/conf/poker.payouts.xml0000644000175000017500000000421310356471013016461 00000000000000 100 70 30 50 30 20 40 24 16 12 8 30 20 12.5 9 8 6.5 5 4 3 2 30 19.5 12 8 6.5 5 3.5 2.5 1.75 1.25 1 1 1 1 1 1 1 1 1 1 25 15 10 8 5 4 3 2 1.75 1.25 1 1 1 1 1 1 1 1 1 1 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 20 12.5 9 7 5 4 3 1.75 1.5 1.25 1 1 1 1 1 1 1 1 1 1 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 20 12 9 7 5 4 3 1.75 1.5 1.25 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 20 12 8 6 5 4 2.5 1.75 1.25 1 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.95 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 poker-engine-1.3.6/tests/conf/poker.ante-.04-.08-limit.xml0000644000175000017500000000171410340654253017627 00000000000000 Limit .04/.08 poker-engine-1.3.6/tests/conf/poker.ante-.10-.20-limit.xml0000644000175000017500000000172710340654253017622 00000000000000 Limit .10/.20 poker-engine-1.3.6/tests/conf/poker..25-.50-pot-limit.xml0000644000175000017500000000211310340654253017474 00000000000000 No limit .25/.50 poker-engine-1.3.6/tests/conf/poker..10-.25-no-limit.xml0000644000175000017500000000174710340654253017316 00000000000000 No limit .10/.25 poker-engine-1.3.6/tests/conf/poker.4-8-limit.xml0000644000175000017500000000173510340654253016411 00000000000000 Limit 4/8 poker-engine-1.3.6/tests/conf/poker.ante-2-4-limit.xml0000644000175000017500000000174010340654253017324 00000000000000 Limit 2/4 poker-engine-1.3.6/tests/conf/poker.ante-30-60-limit.xml0000644000175000017500000000176310340654253017474 00000000000000 Limit 30/60 poker-engine-1.3.6/tests/conf/poker.100-200-no-limit.xml0000644000175000017500000000203010340654253017277 00000000000000 No limit 100/200 poker-engine-1.3.6/tests/conf/poker.2-4-no-limit.xml0000644000175000017500000000176010340654253017013 00000000000000 No limit 2/4 poker-engine-1.3.6/tests/test-data/0002755000175000017500000000000011540702077014142 500000000000000poker-engine-1.3.6/tests/test-data/pokerrake.py0000644000175000017500000000020010460112560016375 00000000000000class PokerRake: def __init__(self, game): self.gotcha = 1 def get_rake_instance(game): return PokerRake(game) poker-engine-1.3.6/tests/test-data/conf/0002755000175000017500000000000011540702077015067 500000000000000poker-engine-1.3.6/tests/test-data/conf/unittest.levels.template.xml0000644000175000017500000000036610427052643022516 00000000000000 poker-engine-1.3.6/tests/test-data/conf/unittest.config.invalid.xml0000644000175000017500000000031410421433110022257 00000000000000 Configuration file used for unit test of the poker engine Invalid XML format poker-engine-1.3.6/tests/test-data/conf/unittest.config.template.xml0000644000175000017500000000061610427052643022467 00000000000000 Bet Description poker-engine-1.3.6/tests/test-data/conf/unittest.variant.template.xml0000644000175000017500000000275010427052643022667 00000000000000 poker-engine-1.3.6/tests/test-data/conf/unittest.variant.invalid.xml0000644000175000017500000000156410421433110022466 00000000000000 poker-engine-1.3.6/tests/test-data/upgrade/0002755000175000017500000000000011540702077015571 500000000000000poker-engine-1.3.6/tests/test-data/upgrade/unittest.config.invalid.xsl0000644000175000017500000000073010421444416023004 00000000000000 Upgraded poker-engine-1.3.6/tests/test-data/upgrade/unittest.config.template.xsl0000644000175000017500000000075010421444416023173 00000000000000 Upgraded poker-engine-1.3.6/tests/sit.py.in0000644000175000017500000001246211344205422013747 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") from pprint import pprint import unittest from pokerengine.pokergame import PokerGameServer class TestSit(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game.setVariant("holdem") self.game.setBettingStructure("2-4-limit") def tearDown(self): del self.game def log(self, string): print string def make_new_player(self, serial, seat): game = self.game self.failUnless(game.addPlayer(serial, seat)) self.failUnless(game.payBuyIn(serial, game.bestBuyIn())) self.failUnless(game.sit(serial)) def pay_blinds(self): game = self.game for serial in game.serialsAll(): game.autoBlindAnte(serial) for serial in game.serialsAll(): game.noAutoBlindAnte(serial) def bot_players(self): game = self.game for serial in game.serialsAll(): game.botPlayer(serial) def check_blinds(self, descriptions): players = self.game.playersAll() players.sort(lambda a,b: int(a.seat - b.seat)) for player in players: (blind, missed, wait) = descriptions.pop(0) if(blind != player.blind or missed != player.missed_blind or wait != player.wait_for): print "check_blinds FAILED actual %s != from expected %s" % ( (player.blind, player.missed_blind, player.wait_for), (blind, missed, wait) ) self.fail() def test1_player_arrive_during_blinds(self): for (serial, seat) in ((1, 0), (2, 1)): self.make_new_player(serial, seat) self.game.beginTurn(1) # # New player comes in while others are paying the blinds. # He does not participate in the game. # for (serial, seat) in ((3, 2),): self.make_new_player(serial, seat) self.pay_blinds() self.assertEqual(self.game.player_list, [1,2]) self.bot_players() # # Next round the new player is waiting for the late blind # self.game.beginTurn(2) self.assertEqual(self.game.player_list, [1,2]) self.pay_blinds() # # This round the new player is in # self.game.beginTurn(3) self.assertEqual(self.game.player_list, [1,2,3]) self.pay_blinds() def test2_player_sitout_during_blinds(self): for (serial, seat) in ((1, 0), (2, 1), (3, 2)): self.make_new_player(serial, seat) self.game.beginTurn(1) # # player 1 deals # player 2 small blind # player 3 big blind # # player 3 sits out while player 2 is in position : she is # marked as sit_out_next_turn because she is not in position # self.assertEqual(2, self.game.getSerialInPosition()) self.game.sitOutNextTurn(3) player3 = self.game.getPlayer(3) self.assertEqual("big", player3.blind) self.failUnless(player3.isSit()) self.assertEqual(True, player3.sit_out_next_turn) # # player 3 sits back and because she is sit_out_next_turn, # which can only happen in the blind/ante round if she # sat out after being included in the player list for the # turn, she is sit. By contrast, if she had been sit # during the blind/ante turn, she would have been marked # wait_for = "first_round" # self.game.sit(3) self.assertEqual(False, player3.sit_out_next_turn) self.assertEqual(False, player3.wait_for) def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestSit)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestSit, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/sit.py ) ; ( cd ../tests ; make TESTS='sit.py' check )" # End: poker-engine-1.3.6/tests/muck.py.in0000644000175000017500000002123511344205422014105 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") from pprint import pprint from string import split import unittest from pokerengine.pokergame import PokerGameServer from pokerengine import pokergame class PokerPredefinedDecks: def __init__(self, decks): self.decks = decks self.index = 0 def shuffle(self, deck): deck[:] = self.decks[self.index][:] self.index += 1 if self.index >= len(self.decks): self.index = 0 class TestMuck(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game.setVariant("holdem") self.game.setBettingStructure("2-4-limit") predefined_decks = [ "8d 2h 2c 8c 4c Kc Ad 9d Ts Jd 5h Tc 4d 9h 8h 7h 9c 2s 3c Kd 5s Td 5d Th 3s Kh Js Qh 7d 2d 3d 9s Qd Ac Jh Jc Qc 6c 7s Ks 5c 4h 7c 4s Qs 6s 6d Ah 6d 3h 8s As", # distributed from the end ] self.game.shuffler = PokerPredefinedDecks(map(lambda deck: self.game.eval.string2card(split(deck)), predefined_decks)) def tearDown(self): del self.game def log(self, string): print string def make_new_bot(self, serial, seat): game = self.game self.failUnless(game.addPlayer(serial, seat)) self.failUnless(game.payBuyIn(serial, game.bestBuyIn())) self.failUnless(game.sit(serial)) game.botPlayer(serial) game.autoMuck(serial, pokergame.AUTO_MUCK_NEVER) def make_new_player(self, serial, seat): game = self.game self.failUnless(game.addPlayer(serial, seat)) self.failUnless(game.payBuyIn(serial, game.bestBuyIn())) self.failUnless(game.sit(serial)) self.game.autoBlindAnte(serial) def check_blinds(self, descriptions): players = self.game.playersAll() players.sort(lambda a,b: int(a.seat - b.seat)) fail = False for player in players: (blind, missed, wait) = descriptions.pop(0) if(blind != player.blind or missed != player.missed_blind or wait != player.wait_for): print "check_blinds FAILED actual %s != from expected %s" % ( (player.blind, player.missed_blind, player.wait_for), (blind, missed, wait) ) fail = True else: print "check_blinds %s == %s" % ( (player.blind, player.missed_blind, player.wait_for), (blind, missed, wait) ) if fail: self.fail() def test1(self): """ won fold, auto_muck always """ for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_player(serial, seat) self.game.beginTurn(1) self.game.fold(4) self.game.fold(1) self.game.fold(2) self.assertEqual(len(self.game.winners), 1) self.assertEqual(self.game.winners[0], 3) self.failUnless(self.game.isWinnerBecauseFold()) self.failUnless(self.game.getPlayer(3).hand.areHidden()) def test2(self): """ won fold, auto_muck lose, decided to muck """ for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_player(serial, seat) self.game.autoMuck(3, pokergame.AUTO_MUCK_LOSE) self.game.beginTurn(1) self.game.fold(4) self.game.fold(1) self.game.fold(2) self.assertEqual(len(self.game.winners), 1) self.assertEqual(self.game.winners[0], 3) self.failUnless(self.game.isWinnerBecauseFold()) self.assertEqual(self.game.muckable_serials, [3]) self.assertEqual(self.game.state, pokergame.GAME_STATE_MUCK) self.game.muck(serial = 3, want_to_muck = True) self.failUnless(self.game.getPlayer(3).hand.areHidden()) self.assertEqual(self.game.state, pokergame.GAME_STATE_END) def test3(self): """ won fold, auto_muck lose, decided not to muck (ie show) """ for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_player(serial, seat) self.game.autoMuck(3, pokergame.AUTO_MUCK_LOSE) self.game.beginTurn(1) self.game.fold(4) self.game.fold(1) self.game.fold(2) self.assertEqual(len(self.game.winners), 1) self.assertEqual(self.game.winners[0], 3) self.failUnless(self.game.isWinnerBecauseFold()) self.assertEqual(self.game.muckable_serials, [3]) self.assertEqual(self.game.state, pokergame.GAME_STATE_MUCK) self.game.muck(serial = 3, want_to_muck = False) self.failUnless(self.game.getPlayer(3).hand.areVisible()) self.assertEqual(self.game.state, pokergame.GAME_STATE_END) def test4(self): """ fake deck player p2 wins against p1, p1 is muckable, auto_muck_never, p1 mucks """ for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_bot(serial, seat) self.game.beginTurn(1) self.assertEqual(self.game.state, pokergame.GAME_STATE_MUCK) self.game.muck(serial = 1, want_to_muck = True) self.assertEqual(len(self.game.winners), 1) self.assertEqual(self.game.winners[0], 2) self.failUnless(self.game.getPlayer(1).hand.areHidden()) self.assertEqual(self.game.state, pokergame.GAME_STATE_END) def test5(self): """ fake deck player p2 wins against p1, p1 is muckable, auto_muck_never, p1 does not muck """ for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_bot(serial, seat) self.game.beginTurn(1) self.assertEqual(self.game.state, pokergame.GAME_STATE_MUCK) self.game.muck(serial = 1, want_to_muck = False) self.assertEqual(len(self.game.winners), 1) self.assertEqual(self.game.winners[0], 2) self.failUnless(self.game.getPlayer(1).hand.areVisible()) self.assertEqual(self.game.state, pokergame.GAME_STATE_END) def test6(self): """ game canceled because blind not payed, player p2 get her/his blind back """ for (serial, seat) in ((1, 0), (2, 1)): self.make_new_player(serial, seat) self.game.noAutoBlindAnte(serial) self.game.beginTurn(1) self.game.blind(2) self.game.sitOut(1) self.assertEqual(self.game.state, pokergame.GAME_STATE_END) self.assertEqual(len(self.game.winners), 0) def test0(self): """ game canceled explicitly, player p2 get her/his blind back """ for (serial, seat) in ((1, 0), (2, 1)): self.make_new_player(serial, seat) self.game.noAutoBlindAnte(serial) self.game.beginTurn(1) self.game.blind(2) self.game.is_directing = False self.game.sitOut(1) self.game.canceled(2, self.game.smallBlind()) self.assertEqual(self.game.state, pokergame.GAME_STATE_END) self.assertEqual(len(self.game.winners), 0) def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestMuck)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestMuck, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': run() # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/muck.py ) ; ( cd ../tests ; make TESTS='muck.py' check )" # End: poker-engine-1.3.6/tests/allin.py.in0000644000175000017500000005243411344205422014252 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Henry Precheur (2004) # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") import unittest from pokereval import PokerEval from pokerengine import pokergame from pokerengine.pokergame import PokerGameServer, PokerGame from pokerengine.pokercards import PokerCards poker_eval = PokerEval() _initial_money = 1000 class TestAllIn(unittest.TestCase): def setUp(self, variant, betting): output = os.getenv("test_output") if output != None: self.output_file = open(output, 'a') else: self.output_file = sys.stderr self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game.setVariant(variant) self.game.setBettingStructure(betting) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) def bestWithStrings(self, side, serial): (value, cards) = self.game.bestHand(side, serial) return (cards[0], self.game.eval.card2string(cards[1:])) def tearDown(self): del self.game def log(self, string): print string def make_cards(self, visible, *args): cards = PokerCards(poker_eval.string2card(args)) if visible: cards.allVisible() else: cards.allHidden() return cards def make_new_player(self, i, initial_money = _initial_money): self.assert_(self.game.addPlayer(i)) player = self.game.serial2player[i] player.money = initial_money player.buy_in_payed = True self.assert_(self.game.sit(i)) player.auto_blind_ante = True self.game.autoMuck(i, pokergame.AUTO_MUCK_ALWAYS) def prepareGame(self, nplayers): pot = 9100 self.money = 1 self.player = {} money = self.money game = self.game player = self.player for serial in xrange(1,nplayers+1): self.make_new_player(serial, money) player[serial] = game.serial2player[serial] game.beginTurn(1) game.pot = pot class TestCommonAllIn(TestAllIn): def setUp(self): TestAllIn.setUp(self, "holdem", "2-4-no-limit") def test1_AllIn(self): # # 5 players (counting 1-5 included). # In pre-flop, player 3 goes all-in immediately. # All other players also go all in, therefore all cards # are dealt and the game ends. # # player[1] money = 50 # player[2] money = 10 # player[3] money = 10 # player[4] money = 200 # player[5] money = 10 # # player[1] side_pot = 130 (p[1]=50 + p[2]=10 + p[3]=10 + p[4]=50 + p[5]=10) # player[2] side_pot = 50 (p[1]=10 + p[2]=10 + p[3]=10 + p[4]=10 + p[5]=10) # player[3] side_pot = 50 (p[1]=10 + p[2]=10 + p[3]=10 + p[4]=10 + p[5]=10) # player[4] side_pot = 280 (p[1]=50 + p[2]=10 + p[3]=10 + p[4]=200 + p[5]=10) # player[5] side_pot = 50 (p[1]=10 + p[2]=10 + p[3]=10 + p[4]=10 + p[5]=10) # # game = self.game player = {} for serial in xrange(1,6): player[serial] = serial - 1 self.make_new_player(serial, 1000) game.serial2player[1].money = 5000 game.serial2player[4].money = 20000 game.beginTurn(1) self.assertEqual(game.state, "pre-flop") for serial in (4, 5, 1): self.assertEqual(game.position, player[serial]) game.call(serial) # # player 2 goes all in # game.callNraise(2, 1000) self.assertEqual(game.inGameCount(), 4) self.assertEqual(game.notFoldCount(), 5) player2 = game.serial2player[2] self.assertEqual(player2.bet, 1000) self.assertEqual(player2.money, 0) self.assertEqual(game.highestBetNotFold(), 1000) self.assertEqual(game.highestBetInGame(), 400) self.assertEqual(game.position, player[3]) self.assertEqual(game.serialsInGame(), [1, 3, 4, 5]) self.assertEqual(game.serialsNotFold(), [1, 2, 3, 4, 5]) # # player 3 tries to check but is not allowed to, should # return False and have no side effect # self.assertEqual(game.check(3), False) # # Inhibit the distributeMoney and showdown so that we # can check the values of the side pots. # game.is_directing = False # # All other players call, i.e. they all go all in since they # all started with the same amount of chips # for serial in (3, 4, 5, 1): self.assertEqual(game.position, player[serial]) game.callNraise(serial, 100000) self.assertEqual(game.side_pots, {'building': 0, 'pots': [ [5000, 5000], [8000, 13000], [15000, 28000] ], 'last_round': 0, 'contributions': { 0: {0: {1: 1000, 2: 1000, 3: 1000, 4: 1000, 5: 1000}, 1: {1: 4000, 4: 4000}, 2: {4: 15000} }, 'total': {1: 5000, 2: 1000, 3: 1000, 4: 20000, 5: 1000} } }) self.assertEqual(game.serial2player[1].side_pot_index, 1) self.assertEqual(game.serial2player[2].side_pot_index, 0) self.assertEqual(game.serial2player[3].side_pot_index, 0) self.assertEqual(game.serial2player[4].side_pot_index, 2) self.assertEqual(game.serial2player[5].side_pot_index, 0) self.assertEqual(game.inGameCount(), 0) self.assertEqual(game.notFoldCount(), 5) self.assertEqual(game.state, "muck") class TestAllInCase2(TestAllIn): def setUp(self): TestAllIn.setUp(self, "holdem", "2-4-no-limit") def test1_AllIn(self): # # 5 players (counting 1-5 included). # flop: player 2 4 fold # turn: player 3 bets, player raises 5 all-in, player 1 calls # player 3 raises all in, player 5 calls all in # # game = self.game player = {} for serial in xrange(1,6): player[serial] = serial - 1 self.make_new_player(serial, 5200) game.serial2player[3].money = 20200 game.serial2player[5].money = 7200 game.serial2player[1].money = 10200 game.beginTurn(2) self.assertEqual(game.state, "pre-flop") game.fold(4) game.call(5) game.call(1) game.fold(2) game.check(3) self.assertEqual(game.inGameCount(), 3) # # Inhibit the distributeMoney and showdown so that we # can check the values of the side pots. # game.is_directing = False self.assertEqual(game.state, "flop") game.callNraise(3, 5000) # bet 50 (200 - 50 = 150 remaining) game.callNraise(5, 7000) # raises 70 (50 to call, raise 20) => all in game.call(1) # calls 70 (70 to call, 100 - 70 = 30 remaining) game.callNraise(3, 15000) # raises 150 (20 to call, raise 130) => all in game.call(1) # calls 30 => all in self.assertEqual(game.side_pots, {'building': 0, 'pots': [[21800, 21800], [6000, 27800], [10000, 37800]], 'last_round': 1, 'contributions': {0: {0: {1: 400, 2: 200, 3: 400, 5: 400}}, 1: {0: {1: 6800, 3: 6800, 5: 6800}, 1: {1: 3000, 3: 3000}, 2: {3: 10000}}, 'total': {1: 10200, 2: 200, 3: 20200, 5: 7200}}} ) self.assertEqual(game.serial2player[1].side_pot_index, 1) # 277 self.assertEqual(game.serial2player[3].side_pot_index, 2) # 377 self.assertEqual(game.serial2player[5].side_pot_index, 0) # 217 self.assertEqual(game.inGameCount(), 0) self.assertEqual(game.notFoldCount(), 3) self.assertEqual(game.state, "muck") class TestRaise(TestAllIn): def setUp(self): TestAllIn.setUp(self, "holdem", "10-20-no-limit") def test1_Raise(self): # # 2 players (counting 1-2 included). # # player[1] money = 2000 # player[2] money = 2000 # game = self.game player = {} for serial in xrange(1,3): player[serial] = serial - 1 self.make_new_player(serial, 200000) game.beginTurn(1) self.assertEqual(game.state, "pre-flop") self.assertEqual(game.position, player[2]) game.call(2) game.callNraise(1, 50000) self.assertEqual(game.betLimits(2), (100000, 198000, 50000)) class TestHoldemAllIn(TestAllIn): def setUp(self): TestAllIn.setUp(self, "holdem", "0-0-limit") def test1_ChipLeft(self): """ Two players are even, 3 to split, 1 odd chip """ game = self.game self.prepareGame(2) game.pot = 3 game.side_pots = { 'pots': { 0: (3, 3) }, 'contributions': { 'total': { 1: 2, 2: 1 } } } game.serial2player[1].hand = self.make_cards(False, '7h', '3h') game.serial2player[2].hand = self.make_cards(False, '7d', '3s') game.board = self.make_cards(True, '6h', '4d', '7s', 'Kc', '7c') game.distributeMoney() self.assertEqual(len(game.winners), 2) self.assertEqual(game.pot, 0) winner = game.serial2player[1] self.assertEqual(winner.money, 2) # # Dealer is player[1], player next to dealer is player[2], # the odd chips go to the player next to the dealer # winner = game.serial2player[2] self.assertEqual(winner.money, 3) game.endTurn() class TestOmaha8AllIn(TestAllIn): def setUp(self): TestAllIn.setUp(self, "omaha8", "0-0-limit") def dealCardsOne(self): """ 1) A player is all in and wins nothing. However, he was all-in for an amount greater than the highest bet and gets back the difference. 2) A player is all in and wins one side of the pot. 3) Two players tie for one side of the pot. 4) Odd chips are distributed. 5) A player is all in for an amount larger than all other bets and get it back. player[1] is all-in with a side pot of 90 and loses but get the extra chips back (200 - 90) = 110 player[2] is all-in with a side pot of 50 player[2] wins hi (Straight) => 50/2 = 25 player[5] win lo (NoPair) => 50/2 = 25 player[3,4,5] are still playing for a pot of (90 - 50) = 40 player[3,4] tie for hi (Pair)=> (40 / 2) / 2 = 10 each player[5] win lo (Nopair) => (40 / 2) = 20 """ game = self.game game.side_pots = {'pots': { 0: (5000, 5000), 1: (4000, 9000), 2: (11000, 20000) }, 'contributions': { 'total': { 1: 13000, 2: 1000, 3: 2000, 4: 2000, 5: 2000 } } } player = self.player game.board = self.make_cards(True, 'As', '4d', '5h', '7d', '9c') player[1].hand = self.make_cards(False, 'Th', 'Js', 'Qs', '2c') player[1].side_pot_index = 2 player[1].all_in = True self.assertEqual(self.bestWithStrings("hi", 1), ('NoPair', ['As', 'Qs', 'Js', '9c', '7d'])) player[2].hand = self.make_cards(False, '6c', '8c', 'Qd', 'Kd') player[2].side_pot_index= 0 player[2].all_in = True self.assertEqual(self.bestWithStrings("hi", 2), ('Straight', ['9c', '8c', '7d', '6c', '5h'])) self.assertEqual(self.bestWithStrings("low", 2), ('NoPair', ['8c', '6c', '5h', '4d', 'As'])) player[3].hand = self.make_cards(False, 'Ac', '8s', 'Qh', 'Kh') player[3].side_pot_index= 1 self.assertEqual(self.bestWithStrings("hi", 3), ('OnePair', ['As', 'Ac', 'Kh', '9c', '7d'])) self.assertEqual(self.bestWithStrings("low", 3), ('NoPair', ['8s', '7d', '5h', '4d', 'Ac'])) player[4].hand = self.make_cards(False, 'Ad', '8d', 'Qc', 'Kc') player[4].side_pot_index= 1 self.assertEqual(self.bestWithStrings("hi", 4), ('OnePair', ['As', 'Ad', 'Kc', '9c', '7d'])) player[5].hand = self.make_cards(False, '2s', '6s', 'Jd', 'Ks') player[5].side_pot_index= 1 self.assertEqual(self.bestWithStrings("low", 5), ('NoPair', ['6s', '5h', '4d', '2s', 'As'])) def dealCardsTwo(self): """ Simple situation, no all-in, player[3] with straight """ game = self.game game.side_pots = {'pots': { 0: (10000, 10000) }, 'contributions': { 'total': { 1: 2000, 2: 2000, 3: 2000, 4: 2000, 5: 2000 } } } player = self.player game.board = self.make_cards(True, 'As', '4d', '5h', '7d', '9c') player[1].hand = self.make_cards(False, 'Th', 'Js', 'Qs', '2c') self.assertEqual(self.bestWithStrings("hi", 1), ('NoPair', ['As', 'Qs', 'Js', '9c', '7d'])) self.assertEqual(self.bestWithStrings("low", 1), ('Nothing', [])) player[2].hand = self.make_cards(False, 'Ac', '8s', 'Qh', 'Kh') self.assertEqual(self.bestWithStrings("hi", 2), ('OnePair', ['As', 'Ac', 'Kh', '9c', '7d'])) self.assertEqual(self.bestWithStrings("low", 2), ('NoPair', ['8s', '7d', '5h', '4d', 'Ac'])) player[3].hand = self.make_cards(False, '6c', '8c', 'Qd', 'Kd') self.assertEqual(self.bestWithStrings("hi", 3), ('Straight', ['9c', '8c', '7d', '6c', '5h'])) self.assertEqual(self.bestWithStrings("low", 3), ('NoPair', ['8c', '6c', '5h', '4d', 'As'])) player[4].hand = self.make_cards(False, '2s', 'Ts', 'Jd', '3s') self.assertEqual(self.bestWithStrings("hi", 4), ('Straight', ['5h', '4d', '3s', '2s', 'As'])) self.assertEqual(self.bestWithStrings("low", 4), ('NoPair', ['5h', '4d', '3s', '2s', 'As'])) player[5].hand = self.make_cards(False, 'Ad', '8d', 'Qc', 'Kc') self.assertEqual(self.bestWithStrings("hi", 5), ('OnePair', ['As', 'Ad', 'Kc', '9c', '7d'])) self.assertEqual(self.bestWithStrings("low", 5), ('NoPair', ['8d', '7d', '5h', '4d', 'Ad'])) def test1_distributeMoney(self): self.prepareGame(5) self.dealCardsOne() game = self.game game.uncalled_serial = 1 game.uncalled = 11000 money = self.money player = self.player game.distributeMoney() self.assertEqual(len(game.winners), 4) self.assertEqual(game.pot, 0) game_state = game.showdown_stack[0] self.assertEqual(game_state['serial2delta'], {1: -2000, 2: 1500, 3: -1000, 4: -1000, 5: 2500}) self.assertEqual(game_state['serial2share'], {1: 11000, 2: 2500, 3: 1000, 4: 1000, 5: 4500}) def test2_showdown(self): self.prepareGame(5) self.dealCardsOne() game = self.game game.uncalled_serial = 1 game.uncalled = 11000 money = self.money player = self.player game.muckState(pokergame.WON_ALLIN) self.assertEqual(game.side2winners["hi"], [2, 3, 4]) self.assertEqual(game.side2winners["low"], [5]) self.assertEqual(player[1].hand.areVisible(), False) self.assertEqual(player[2].hand.areVisible(), True) self.assertEqual(player[3].hand.areVisible(), True) self.assertEqual(player[4].hand.areVisible(), True) self.assertEqual(player[5].hand.areVisible(), True) def test3_showdown(self): self.prepareGame(5) self.dealCardsTwo() game = self.game money = self.money player = self.player game.muckState(pokergame.WON_REGULAR) self.assertEqual(game.side2winners["hi"], [3]) self.assertEqual(game.side2winners["low"], [4]) self.assertEqual(player[1].hand.areVisible(), False) self.assertEqual(player[2].hand.areVisible(), True) self.assertEqual(player[3].hand.areVisible(), True) self.assertEqual(player[4].hand.areVisible(), True) self.assertEqual(player[5].hand.areVisible(), False) class TestHoldemPlayBoard(TestAllIn): def setUp(self): TestAllIn.setUp(self, "holdem", "0-0-limit") def dealCardsOne(self): """ Two players play the board """ game = self.game game.side_pots = {'pots': { 0: (1000, 1000), }, 'contributions': { 'total': { 1: 500, 2: 500, } } } player = self.player game.board = self.make_cards(True, 'As', 'Ac', 'Ad', '7d', '7c') player[1].hand = self.make_cards(False, 'Th', 'Js') self.assertEqual(self.bestWithStrings("hi", 1), ('FlHouse', ['As', 'Ac', 'Ad', '7c', '7d'])) player[2].hand = self.make_cards(False, '9c', '8s') self.assertEqual(self.bestWithStrings("hi", 2), ('FlHouse', ['As', 'Ac', 'Ad', '7c', '7d'])) def test1_showdown(self): self.prepareGame(2) self.dealCardsOne() game = self.game money = self.money player = self.player game.distributeMoney() self.assertEqual(game.side2winners["hi"], [1, 2]) class TestHoldemSplit(TestAllIn): def setUp(self): TestAllIn.setUp(self, "holdem", "0-0-limit") def dealCardsOne(self): """ Two players, one """ game = self.game game.side_pots = {'pots': { 0: (1000, 1000), }, 'contributions': { 'total': { 1: 200, 2: 800, } } } player = self.player game.board = self.make_cards(True, 'As', 'Ac', 'Ad', '7d', '7c') player[1].hand = self.make_cards(False, 'Th', 'Js') self.assertEqual(self.bestWithStrings("hi", 1), ('FlHouse', ['As', 'Ac', 'Ad', '7c', '7d'])) player[2].hand = self.make_cards(False, '9c', '8s') self.assertEqual(self.bestWithStrings("hi", 2), ('FlHouse', ['As', 'Ac', 'Ad', '7c', '7d'])) def test1_showdown(self): self.prepareGame(2) self.dealCardsOne() game = self.game money = self.money player = self.player game.distributeMoney() self.assertEqual(game.side2winners["hi"], [1, 2]) def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestRaise)) suite.addTest(unittest.makeSuite(TestHoldemAllIn)) suite.addTest(unittest.makeSuite(TestCommonAllIn)) suite.addTest(unittest.makeSuite(TestAllInCase2)) suite.addTest(unittest.makeSuite(TestOmaha8AllIn)) suite.addTest(unittest.makeSuite(TestHoldemPlayBoard)) suite.addTest(unittest.makeSuite(TestHoldemSplit)) # Comment out any of the above and use line below this when you wish # to run just one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestHoldemSplit, prefix = # "test12")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/allin.py ) ; ( cd ../tests ; make TESTS='allin.py' check )" # End: poker-engine-1.3.6/tests/buyin.py.in0000644000175000017500000000776711344205422014312 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") import unittest from pokerengine.pokergame import PokerGameServer class TestBuyIn(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game.setVariant("holdem") self.game.setBettingStructure("2-4-limit") def tearDown(self): del self.game def log(self, string): print string def make_new_player(self, serial, seat): game = self.game self.failUnless(game.addPlayer(serial, seat)) self.failUnless(game.payBuyIn(serial, game.bestBuyIn())) self.failUnless(game.sit(serial)) game.botPlayer(serial) game.noAutoBlindAnte(serial) def pay_blinds(self): game = self.game for serial in game.serialsAll(): game.autoBlindAnte(serial) for serial in game.serialsAll(): game.noAutoBlindAnte(serial) def test1(self): game = self.game self.failUnless(game.addPlayer(1)) self.failIf(game.payBuyIn(1, game.buyIn() - 1)) self.failIf(game.getPlayer(1).buy_in_payed) self.failIf(game.payBuyIn(1, game.maxBuyIn() + 1)) self.failIf(game.getPlayer(1).buy_in_payed) self.failUnless(game.payBuyIn(1, game.bestBuyIn())) self.failUnless(game.getPlayer(1).buy_in_payed) self.failUnless(game.addPlayer(2)) self.failUnless(game.payBuyIn(2, game.maxBuyIn())) self.failUnless(game.getPlayer(2).buy_in_payed) def test2(self): for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_player(serial, seat) self.game.beginTurn(1) self.failIf(self.game.rebuy(300000, self.game.bestBuyIn())) self.failUnless(self.game.rebuy(1, 1)) self.assertEqual(self.game.getPlayer(1).rebuy, 1) self.failIf(self.game.rebuy(1, self.game.maxBuyIn())) self.assertEqual(self.game.getPlayer(1).rebuy, 1) self.failUnless(self.game.rebuy(1, 1)) self.assertEqual(self.game.getPlayer(1).rebuy, 2) self.pay_blinds() self.assertEqual(self.game.getPlayer(1).rebuy, 0) money = self.game.getPlayerMoney(1) self.failUnless(self.game.rebuy(1, 1)) self.assertEqual(self.game.getPlayerMoney(1), money + 1) def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestBuyIn)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestBuyIn, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/buyin.py ) ; ( cd ../tests ; make TESTS='buyin.py' check )" # End: poker-engine-1.3.6/tests/libxml2leak.py.in0000644000175000017500000001341611344205422015356 00000000000000# -*- mode: python -*- # # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2008 Bradley M. Kuhn # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # checks that the workarounds for the libxml2 memory leak are effective # read more about the leak at # https://mail.gna.org/public/pokersource-users/2008-12/msg00049.html # import sys, os, gc sys.path.insert(0, "@top_srcdir@") import unittest import libxml2 from pokerengine import pokerengineconfig from pokerengine import pokergame def getVsize(): return int(os.popen("echo -n $(ps h -o vsize -p " + str(os.getpid()) + ")").read()) class LeakTestCase(unittest.TestCase): def leakWatch(self, func, message): # # check for memory usage every iteration and iterate * times # chunk = 5 leaks = [0] * self.iterations # # stabilize memory usage # initial = 10 for j in range(0, initial): func() gc.collect() leaks[0] = getVsize() for i in range(1, self.iterations): for j in range(0, chunk): func() gc.collect() leaks[i] = getVsize() increases = 0 previous = None # # keep track of the greater size found so that decreasing memory # does not create false positive (i.e. 1000 996 1000 996 1000 996...) # greater = None for leak in leaks: if previous and previous < leak and leak > greater: increases += 1 previous = leak if leak > greater: greater = leak # # It is almost impossible to be precise when watching the vsize of a process. # This test suite is not about making sure the process never grows. It is # designed to spot cases where the process grows most of the time, i.e. has # a significant leak. # self.assertTrue(increases < len(leaks) / 25, " vsize grows " + str(leaks)) def test01_config(self): def func(): config = pokerengineconfig.Config(['@srcdir@/../conf']) config.load('poker.holdem.xml') self.leakWatch(func, "pokerengineconfig.Config") def test02_libxml_freeDoc(self): def func(): mydoc = libxml2.parseFile('@srcdir@/../conf/poker.holdem.xml') mydoc.freeDoc() self.leakWatch(func, "libxml2.freeDoc") def test03_game_setVariant(self): game = pokergame.PokerGame("poker.%s.xml", False, ['@srcdir@/../conf']) def func(): game.setVariant("holdem") self.leakWatch(func, "game.setVariant") def test04_config_load(self): config = pokerengineconfig.Config(['@srcdir@/../conf']) def func(): config.load('poker.holdem.xml') self.leakWatch(func, "Config.load") config.free() def test05_config_reload(self): config = pokerengineconfig.Config(['@srcdir@/../conf']) config.load('poker.holdem.xml') def func(): config.reload() self.leakWatch(func, "Config.reload") def test06_config_save(self): config = pokerengineconfig.Config(['@srcdir@/../conf']) config.load('poker.holdem.xml') config.path = "leaktmp" def func(): config.save() self.leakWatch(func, "Config.save") os.unlink("leaktmp") def test07_config_headerGet(self): config = pokerengineconfig.Config(['@srcdir@/../conf']) config.load('poker.holdem.xml') def func(): config.headerGet("/poker/@poker_engine_version") self.leakWatch(func, "Config.headerGet") def test08_config_headerGetProperties(self): config = pokerengineconfig.Config(['@srcdir@/../conf']) config.load('poker.holdem.xml') def func(): config.headerGetProperties("/poker") self.leakWatch(func, "Config.headerGetProperties") class QuickLeakTestCase(LeakTestCase): def setUp(self): self.iterations = 100 class LongLeakTestCase(LeakTestCase): def setUp(self): self.iterations = 1000 # --------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(QuickLeakTestCase)) # , prefix = "test08")) # suite.addTest(unittest.makeSuite(LongLeakTestCase)) # , prefix = "test08")) return suite # --------------------------------------------------------- def GetTestedModule(): return pokerengineconfig # --------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # --------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/libxml2leak.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokerengineconfig.py' TESTS='coverage-reset libxml2leak.py coverage-report' check )" # End: poker-engine-1.3.6/tests/bugs.py0000644000175000017500000000441511540702071013502 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Johan Euphrosine # import sys, os sys.path.insert(0, "..") sys.path.insert(0, "..") import unittest from pokereval import PokerEval from pokerengine import pokergame from pokerengine.pokergame import PokerGameServer, PokerGame from pokerengine.pokercards import PokerCards class TestBugUncalled(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "../conf" ]) self.game.verbose = 3 self.game.setVariant("holdem") self.game.setBettingStructure(".10-.25-no-limit") def tearDown(self): del self.game def test01(self): pass def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestBugUncalled)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestBugUncalled, prefix = # "test01")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/bugs.py ) ; ( cd ../tests ; make TESTS='bugs.py' check )" # End: poker-engine-1.3.6/tests/test-pokerchips.py.in0000644000175000017500000002702711344205422016277 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest import os.path import types from pokerengine import pokerchips class PokerChipsTestCase(unittest.TestCase): # ----------------------------------------------------------------------------------------------------- def setUp(self): pass # ----------------------------------------------------------------------------------------------------- def tearDown(self): pass # ----------------------------------------------------------------------------------------------------- def testInit(self): """Test Poker Chips : Initialisation""" values = [5, 10, 20] pokerchip = pokerchips.PokerChips(values) self.failUnlessEqual(pokerchip, pokerchips.PokerChips(values, 0)) self.failUnlessEqual(pokerchip.toint(), 0) pokerchip1 = pokerchips.PokerChips(values, 153) pokerchip2 = pokerchips.PokerChips(values, pokerchip1) self.failUnlessEqual(pokerchip1, pokerchip2) self.failUnlessEqual(pokerchip2.toint(), 153) pokerchip1 = pokerchips.PokerChips(values, [10, 5, 1]) self.failUnlessEqual(pokerchip1.toint(), 120) # ----------------------------------------------------------------------------------------------------- def testOperatorEqu(self): """Test Poker Chips : Equality""" values = [5, 10, 20] pokerchip1 = pokerchips.PokerChips(values, 153) pokerchip2 = pokerchips.PokerChips(values, 153) pokerchip3 = pokerchips.PokerChips(values, 154) self.failUnlessEqual(pokerchip1, pokerchip2) self.failIfEqual(pokerchip1, pokerchip3) self.failUnlessEqual(pokerchip1 != pokerchip2, False) self.failUnlessEqual(pokerchip1 != pokerchip3, True) self.failUnlessEqual(pokerchip1 != 153, True) # ----------------------------------------------------------------------------------------------------- def testToInt(self): """Test Poker Chips : To integer""" values = [5, 10, 20] pokerchip = pokerchips.PokerChips(values) self.failUnlessEqual(pokerchip.toint(), 0) pokerchip = pokerchips.PokerChips(values, 153) self.failUnlessEqual(pokerchip.toint(), 153) pokerchip = pokerchips.PokerChips(values, [1, 1, 1]) self.failUnlessEqual(pokerchip.toint(), 35) # ----------------------------------------------------------------------------------------------------- def testAdd(self): """Test Poker Chips : Addition""" values = [5, 10, 20] pokerchip1 = pokerchips.PokerChips(values, 155) pokerchip2 = pokerchips.PokerChips(values, 223) pokerchip1.add(pokerchip2) self.failUnlessEqual(pokerchip1.toint(), 155 + 223) # ----------------------------------------------------------------------------------------------------- def testSub(self): """Test Poker Chips : Substraction""" values = [5, 10, 20] pokerchip1 = pokerchips.PokerChips(values, [3, 2, 1]) pokerchip2 = pokerchips.PokerChips(values, [1, 1, 1]) pokerchip1.subtract(pokerchip2) self.failUnlessEqual(pokerchip1, pokerchips.PokerChips(values, [2, 1, 0])) pokerchip1 = pokerchips.PokerChips(values, 155) pokerchip1.subtract(130) self.failUnlessEqual(pokerchip1.toint(), 25) pokerchip1 = pokerchips.PokerChips(values, 155) pokerchip1.subtract(160) self.failUnlessEqual(pokerchip1.toint(), 0) # ----------------------------------------------------------------------------------------------------- def testToString(self): """Test Poker Chips : String representation""" self.failUnlessEqual(pokerchips.PokerChips.tostring(0), '0') self.failUnlessEqual(pokerchips.PokerChips.tostring(1), '0.01') self.failUnlessEqual(pokerchips.PokerChips.tostring(10), '0.10') self.failUnlessEqual(pokerchips.PokerChips.tostring(99), '0.99') self.failUnlessEqual(pokerchips.PokerChips.tostring(200), '2') self.failUnlessEqual(pokerchips.PokerChips.tostring(220), '2.20') self.failUnlessEqual(pokerchips.PokerChips.tostring(1000), '10') self.failUnlessEqual(pokerchips.PokerChips.tostring(1333), '13.33') # ----------------------------------------------------------------------------------------------------- def testToFloat(self): """Test Poker Chips : To float""" self.failUnlessEqual(pokerchips.PokerChips.tofloat(0), 0) self.failUnlessEqual(pokerchips.PokerChips.tofloat(1), 0.01) self.failUnlessEqual(pokerchips.PokerChips.tofloat(133), 1.33) self.failUnlessEqual(pokerchips.PokerChips.tofloat(1333), 13.33) # ----------------------------------------------------------------------------------------------------- def testInt2Chips(self): """Test Poker Chips : From integer""" values = [5, 10, 20] self.failUnlessEqual(pokerchips.PokerChips.int2chips([], pokerchips.INT2CHIPS_FACTOR, 15), ([], 15)) self.failUnlessEqual(pokerchips.PokerChips.int2chips(values, pokerchips.INT2CHIPS_FACTOR, 0), ([0, 0, 0], 0)) self.failUnlessEqual(pokerchips.PokerChips.int2chips(values, pokerchips.INT2CHIPS_FACTOR, 5), ([1, 0, 0], 0)) self.failUnlessEqual(pokerchips.PokerChips.int2chips(values, pokerchips.INT2CHIPS_FACTOR, 7), ([1, 0, 0], 2)) self.failUnlessEqual(pokerchips.PokerChips.int2chips(values, pokerchips.INT2CHIPS_FACTOR, 15), ([3, 0, 0], 0)) self.failUnlessEqual(pokerchips.PokerChips.int2chips(values, pokerchips.INT2CHIPS_FACTOR, 50), ([8, 1, 0], 0)) self.failUnlessEqual(pokerchips.PokerChips.int2chips(values, pokerchips.INT2CHIPS_FACTOR, 90), ([8, 3, 1], 0)) self.failUnlessEqual(pokerchips.PokerChips.int2chips(values, pokerchips.INT2CHIPS_FACTOR, 93), ([6, 4, 1], 3)) # ----------------------------------------------------------------------------------------------------- def testToList(self): """Test Poker Chips : To list""" values = [5, 10, 20] self.failUnlessEqual(pokerchips.PokerChips(values, 0).tolist(), []) self.failUnlessEqual(pokerchips.PokerChips(values, 3).tolist(), [1,3]) self.failUnlessEqual(pokerchips.PokerChips(values, 5).tolist(), [5, 1]) self.failUnlessEqual(pokerchips.PokerChips(values, 7).tolist(), [1, 2 ,5, 1]) self.failUnlessEqual(pokerchips.PokerChips(values, 15).tolist(), [5, 3]) self.failUnlessEqual(pokerchips.PokerChips(values, 50).tolist(), [5, 8, 10, 1]) self.failUnlessEqual(pokerchips.PokerChips(values, 90).tolist(), [5, 8, 10, 3, 20, 1]) self.failUnlessEqual(pokerchips.PokerChips(values, 93).tolist(), [1, 3, 5, 6, 10, 4, 20, 1]) values = [1, 2, 4] self.failUnlessEqual(pokerchips.PokerChips(values, 7).tolist(), [1, 7]) # ----------------------------------------------------------------------------------------------------- def testlimitChips(self): """Test Poker Chips : Limit chips""" values = [5, 10, 20] chips = pokerchips.PokerChips(values, [pokerchips.MAX_CHIPS_PER_STACK + 2, 0, 0]) self.failUnlessEqual(chips.tolist(), [5, pokerchips.MAX_CHIPS_PER_STACK, 10, 1]) chips = pokerchips.PokerChips(values, [pokerchips.MAX_CHIPS_PER_STACK + 3, 0, 0]) self.failUnlessEqual(chips.tolist(), [5, pokerchips.MAX_CHIPS_PER_STACK + 1, 10, 1]) chips = pokerchips.PokerChips(values, [pokerchips.MAX_CHIPS_PER_STACK + 4, pokerchips.MAX_CHIPS_PER_STACK, pokerchips.MAX_CHIPS_PER_STACK]) self.failUnlessEqual(chips.tolist(), [5, pokerchips.MAX_CHIPS_PER_STACK, 10, pokerchips.MAX_CHIPS_PER_STACK, 20, pokerchips.MAX_CHIPS_PER_STACK +1]) # ----------------------------------------------------------------------------------------------------- def testStrOperator(self): """Test Poker Chips : String representation""" values = [5, 10, 20] pokerchip = pokerchips.PokerChips(values, 93) self.failUnlessEqual(str(pokerchip), 'PokerChips(%s) = %d (-%d)' %([6, 4, 1], 93, 3)) # ----------------------------------------------------------------------------------------------------- def testReprOperator(self): """Test Poker Chips : Representation""" values = [5, 10, 20] pokerchip = pokerchips.PokerChips(values, 93) self.failUnlessEqual(repr(pokerchip), '%s(%s)' %('PokerChips', [6, 4, 1])) # ----------------------------------------------------------------------------------------------------- def testCopy(self): """Test Poker Chips : Copy""" values = [5, 10, 20] pokerchip1 = pokerchips.PokerChips(values, 93) pokerchip2 = pokerchip1.copy() self.failUnlessEqual(pokerchip1, pokerchip2) self.failUnlessEqual(pokerchip2.toint(), 93) pokerchip1.add(7) self.failIfEqual(pokerchip1, pokerchip2) self.failUnlessEqual(pokerchip1.toint(), 100) self.failUnlessEqual(pokerchip2.toint(), 93) # ----------------------------------------------------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerChipsTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(PokerChipsTestCase, prefix = "test2")) return suite # ----------------------------------------------------------------------------------------------------- def GetTestedModule(): return pokerchips # ----------------------------------------------------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # ----------------------------------------------------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-pokerchips.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokerchips.py' TESTS='coverage-reset test-pokerchips.py coverage-report' check )" # End: poker-engine-1.3.6/tests/deal.py.in0000644000175000017500000000621711344205422014056 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") from random import shuffle import unittest from pokerengine.pokergame import PokerGameServer from pokerengine.pokercards import PokerCards from pokereval import PokerEval poker_eval = PokerEval() _initial_money = 1000 class TestDeal(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game.setVariant("7stud") self.game.setBettingStructure("ante-10-20-limit") def tearDown(self): del self.game def log(self, string): print string def make_new_player(self, i, initial_money): self.assert_(self.game.addPlayer(i)) player = self.game.serial2player[i] player.money = initial_money player.buy_in_payed = True self.assert_(self.game.sit(i)) player.auto_blind_ante = True def test1(self): """ 8 players, non fold, last card is a community card """ game = self.game for serial in xrange(1,9): self.make_new_player(serial, 2000) game.beginTurn(1) while True: if game.isLastRound(): self.assertEqual(len(game.board.tolist(True)), 1) for x in xrange(1,9): serial = game.getSerialInPosition() self.assertEqual(game.check(serial), True) if not game.isRunning(): break; def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestDeal)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestDeal, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/deal.py ) ; ( cd ../tests ; make TESTS='deal.py' check )" # End: poker-engine-1.3.6/tests/testmessages.py0000644000175000017500000000571511344205422015255 00000000000000# # Copyright (C) 2006, 2007, 2008 Loic Dachary # Copyright (C) 2006 Mekensleep # 26 rue des rosiers, 75004 Paris # # This software's license gives you freedom; you can copy, convey, # propagate, redistribute and/or modify this program under the terms of # the GNU General Public License (GPL) as published by the Free Software # Foundation (FSF), either version 3 of the License, or (at your option) # any later version of the GPL published by the FSF. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program in a file in the toplevel directory called # "GPLv3". If not, see . # # Authors: # Loic Dachary # import sys, os classes = [] from pokerengine import pokergame classes.append(pokergame.PokerGame) from pokerengine import pokerprizes classes.append(pokerprizes.PokerPrizes) verbose = int(os.environ.get('VERBOSE_T', '-1')) # # for coverage purpose, make sure all message functions # are called at least once # def call_messages(): import StringIO for a_class in classes: stdout = sys.stdout sys.stdout = StringIO.StringIO() class F(a_class): def __init__(self, *args, **kwargs): self._prefix = 'P' self.prefix = 'P' self.id = 1 self.name = 'name' F().message('') sys.stdout = stdout call_messages() def messages_append(string): if verbose > 3: print "OUTPUT: " + string if not hasattr(string, '__str__'): raise Exception, "Message comes in as non-stringifiable object" string = string.__str__() messages_out.append(string) class2message = { pokergame.PokerGame: lambda self, string: messages_append(self.prefix + "[PokerGame " + str(self.id) + "] " + string) } messages_out = [] def redirect_messages(a_class): if not hasattr(a_class, 'orig_message'): a_class.orig_message = [ ] a_class.orig_message.append(a_class.message) a_class.message = class2message.get(a_class, lambda self, string: messages_append(string)) def silence_all_messages(): messages_out = [] for a_class in classes: redirect_messages(a_class) def restore_all_messages(): for a_class in classes: a_class.message = a_class.orig_message.pop() def search_output(what): if verbose > 1: print "search_output: " + what for message in messages_out: if message.find(what) >= 0: return True if verbose > 1: print "\tnot in " + message return False def clear_all_messages(): global messages_out messages_out = [] def get_messages(): return messages_out poker-engine-1.3.6/tests/test-pokerrake.py.in0000644000175000017500000000674511344205422016117 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest import os.path import types from pokerengine import pokerrake, pokergame class PokerRakeTestCase(unittest.TestCase): # ----------------------------------------------------------------------------------------------------- def setUp(self): pass # ----------------------------------------------------------------------------------------------------- def tearDown(self): pokerrake._get_rake_instance = None # ----------------------------------------------------------------------------------------------------- def test01_Init(self): """Test Poker rake : get_rake_instance""" game = pokergame.PokerGameClient("unittest.%s.xml", ['nodir']) rake = pokerrake.get_rake_instance(game) # ----------------------------------------------------------------------------------------------------- def test02_AlternatePokerRake(self): """Test Poker rake : get_rake_instance alternate PokerRake""" game = pokergame.PokerGameClient("unittest.%s.xml", ['nodir', '@srcdir@/test-data']) game.verbose = int(os.environ.get('VERBOSE_T', 3)) rake = pokerrake.get_rake_instance(game) self.failUnless(hasattr(rake, 'gotcha')) # ----------------------------------------------------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerRakeTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(PokerRakeTestCase, prefix = "test2")) return suite # ----------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------- def Run(verbose): return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # ----------------------------------------------------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-pokerrake.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokerrake.py' TESTS='coverage-reset test-pokerrake.py coverage-report' check )" # End: poker-engine-1.3.6/tests/eval.py.in0000644000175000017500000000742511344205422014102 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") import unittest from pokerengine.pokergame import PokerGameServer, PokerGameClient, PokerGame from pokerengine.pokercards import PokerCards from pokereval import PokerEval poker_eval = PokerEval() _initial_money = 1000 class TestPosition(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.setVariant("holdem") self.game.setBettingStructure("2-4-limit") def tearDown(self): del self.game def log(self, string): print string def make_cards(self, *args): return PokerCards(poker_eval.string2card(args)) def make_new_player(self, i, initial_money = _initial_money): self.assert_(self.game.addPlayer(i)) player = self.game.serial2player[i] player.money = initial_money player.buy_in_payed = True self.assert_(self.game.sit(i)) player.auto_blind_ante = True def make_cards(self, *args): return PokerCards(poker_eval.string2card(args)) def test1(self): """ """ game = self.game player = {} for serial in xrange(1,6): self.make_new_player(serial) player[serial] = game.serial2player[serial] game.beginTurn(1) for serial in (2, 3, 4, 5): player[serial].hand = self.make_cards('__', '__') player[1].hand = self.make_cards('Ad', 'As') self.failUnless(game.handEV(1, 10000) in (547,559) ) player[1].hand = self.make_cards('2c', '7s') self.failUnless(game.handEV(1, 10000) in (102,105) ) game.board = self.make_cards('2c', '3c', '4s') player[1].hand = self.make_cards('2s', '7s') self.failUnless(game.handEV(1, 10000) in (171,172) ) game.board = self.make_cards('2c', '3c', '4s', '4c') player[1].hand = self.make_cards('2s', '7s') self.failUnless(game.handEV(1, 10000) in (74,75) ) game.board = self.make_cards('2c', '3c', '4s', '4c', 'Kc') player[1].hand = self.make_cards('2s', '7s') self.assertEqual(game.handEV(1, 10000), 5) def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestPosition)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestPosition, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/eval.py ) ; ( cd ../tests ; make TESTS='eval.py' check )" # End: poker-engine-1.3.6/tests/blinds.py.in0000644000175000017500000014630711344205422014431 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2008 Bradley M. Kuhn # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Loic Dachary # Bradley M. Kuhn # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") from pprint import pprint import unittest from pokerengine.pokergame import PokerGameServer from string import split class PokerPredefinedDecks: def __init__(self, decks): self.decks = decks self.index = 0 def shuffle(self, deck): deck[:] = self.decks[self.index][:] self.index += 1 if self.index >= len(self.decks): self.index = 0 class TestBlinds(unittest.TestCase): def setUp(self): self.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = self.verbose self.game.setVariant("holdem") self.game.setBettingStructure("2-4-limit") self.amounts = {} self.amounts['big'] = 200 self.amounts['small'] = 100 predefined_decks = [ "8d 2h 2c 8c 4c Kc Ad 9d Ts Jd 5h Tc 4d 9h 8h 7h 9c 2s 3c Kd 5s Td 5d Th 3s Kh Js Qh 7d 2d 3d 9s Qd Ac Jh Jc Qc 6c 7s Ks 5c 4h 7c 4s Qs 6s 6h Ah 6d As 3h 8s", # distributed from the end ] self.game.shuffler = PokerPredefinedDecks(map(lambda deck: self.game.eval.string2card(split(deck)), predefined_decks)) def tearDown(self): del self.game def log(self, string): print string def make_new_bot(self, serial, seat): game = self.game self.failUnless(game.addPlayer(serial, seat)) self.failUnless(game.payBuyIn(serial, game.bestBuyIn())) self.failUnless(game.sit(serial)) game.botPlayer(serial) game.noAutoBlindAnte(serial) def make_new_player(self, serial, seat): game = self.game self.failUnless(game.addPlayer(serial, seat)) self.failUnless(game.payBuyIn(serial, game.bestBuyIn())) self.failUnless(game.sit(serial)) def pay_blinds(self, skipSerials = {}): game = self.game for serial in game.serialsAll(): if skipSerials.has_key(serial): continue game.autoBlindAnte(serial) for serial in game.serialsAll(): if skipSerials.has_key(serial): continue game.noAutoBlindAnte(serial) def check_button(self, serial): self.assertEquals(self.game.player_list[self.game.dealer], serial) def check_blinds(self, descriptions): players = self.game.playersAll() players.sort(lambda a,b: int(a.seat - b.seat)) failStr = None ii = 0 for player in players: ii += 1 (blind, missed, wait, missedCount) = descriptions.pop(0) if(blind != player.blind or missed != player.missed_blind or wait != player.wait_for or player.missed_big_blind_count != missedCount): failStr = "%d check_blinds FAILED actual %s != from expected %s" % ( ii, (player.blind, player.missed_blind, player.wait_for, player.missed_big_blind_count), (blind, missed, wait, missedCount) ) if self.verbose >= 0: print failStr else: goodStr = "%d check_blinds %s == %s" % (ii, (player.blind, player.missed_blind, player.wait_for, player.missed_big_blind_count), (blind, missed, wait, missedCount) ) if self.verbose > 0: print goodStr if failStr: self.fail(failStr) def confirm_blind(self, hist, acceptedEntries): for ee in acceptedEntries: (val1, val2, val3) = ee ee = ('blind', val1, val2, val3) self.assertEquals(ee in hist, True) hist.remove(ee) for hh in hist: self.assertNotEquals(hh[0], 'blind') self.assertNotEquals(hh[0], 'ante') def confirm_hist(self, hist, acceptedEntries): for ee in acceptedEntries: self.assertEquals(ee in hist, True) hist.remove(ee) def test1(self): big = self.amounts['big'] small = self.amounts['small'] seat2serial = {} for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_bot(serial, seat) seat2serial[seat] = serial self.game.beginTurn(1) # (blind, missed, wait, missedCount) self.check_button(1) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 (None, None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(3, big, 0), (2, small, 0)]) self.game.beginTurn(2) self.check_button(2) # (blind, missed, wait, missedCount) self.check_blinds([(None, None, False, 0), # 1 (None, None, False, 0), # 2 ('small', None, False, 0), # 3 ('big', None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(4, big, 0), (3, small, 0)]) self.game.beginTurn(3) self.check_button(3) # (blind, missed, wait, missedCount) self.check_blinds([('big', None, False, 0), # 1 (None, None, False, 0), # 2 (None, None, False, 0), # 3 ('small', None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(1, big, 0), (4, small, 0)]) self.game.beginTurn(4) # (blind, missed, wait) self.check_button(4) self.check_blinds([('small', None, False, 0), # 1 ('big', None, False, 0), # 2 (None, None, False, 0), # 3 (None, None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(2, big, 0), (1, small, 0)]) # -------------------------------------------------------------------------- def test2(self): """ Two new players enter the game and both pay the big blind """ big = self.amounts['big'] small = self.amounts['small'] for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 8)): self.make_new_bot(serial, seat) self.game.beginTurn(1) self.check_button(1) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 (None, None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(3, big, 0), (2, small, 0)]) for (serial, seat) in ((10, 4), (11, 5)): self.make_new_bot(serial, seat) self.game.beginTurn(2) self.check_button(2) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 (None, None, False, 0), # 2 ('small', None, False, 0), # 3 ('big', 'n/a', False, 0), # 10 ('late', 'n/a', False, 0), # 11 (None, None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(11, big, 0), (10, big, 0), (3, small, 0)]) # -------------------------------------------------------------------------- def test3(self): """ Two new players enter the game between the small and big blind. They are allowed to play during the second turn because they cannot be awarded the button as they arrive. """ big = self.amounts['big'] small = self.amounts['small'] for (serial, seat) in ((1, 0), (2, 1), (3, 7), (4, 8)): self.make_new_bot(serial, seat) self.game.beginTurn(1) self.check_button(1) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 (None, None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(2, small, 0), (3, big, 0)]) for (serial, seat) in ((10, 4), (11, 5)): self.make_new_bot(serial, seat) self.game.beginTurn(2) # (blind, missed, wait) self.check_button(2) self.check_blinds([(None, None, False, 0), # 1 (None, None, False, 0), # 2 (None, 'n/a', 'late', 0), # 10 (None, 'n/a', 'late', 0), # 11 ('small', None, False, 0), # 3 ('big', None, False, 0), # 4 ] ) self.pay_blinds() history = self.game.turn_history self.confirm_blind(history, [(4, big, 0), (3, small, 0)]) # players who did not pay the big blind are removed from # the history by historyReduce game_index = 0 player_list_index = 7 serial2chips_index = 9 self.assertEqual(history[game_index][player_list_index], [1, 2, 10, 11, 3, 4]) self.assertEqual(history[game_index][serial2chips_index].keys(), [1, 2, 3, 4, 10, 11]) self.game.historyReduce() self.assertEqual(history[game_index][player_list_index], [1, 2, 3, 4]) self.assertEqual(history[game_index][serial2chips_index].keys(), [1, 2, 3, 4]) self.game.beginTurn(3) self.check_button(3) # (blind, missed, wait) self.check_blinds([('big', None, False, 0), # 1 (None, None, False, 0), # 2 ('late', 'n/a', False, 0), # 10 ('late', 'n/a', False, 0), # 11 (None, None, False, 0), # 3 ('small', None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(1, big, 0), (10, big, 0), (11, big, 0), (4, small, 0)]) self.game.beginTurn(4) # (blind, missed, wait) self.check_button(4) self.check_blinds([('small', None, False, 0), # 1 ('big', None, False, 0), # 2 (None, None, False, 0), # 10 (None, None, False, 0), # 11 (None, None, False, 0), # 3 (None, None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(1, small, 0), (2, big, 0)]) # -------------------------------------------------------------------------- def test4_fourPlayers_player4missedBothBlinds_onlyBigRequired(self): """ Less than 6 players, player 4 missed the big and small blinds and must pay the big blind when back in the game. The missed blind count only ever goes to one, because the player is not passed again. """ big = self.amounts['big'] small = self.amounts['small'] for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): self.make_new_bot(serial, seat) self.game.beginTurn(1) self.check_button(1) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 (None, None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(2, small, 0), (3, big, 0)]) self.game.sitOut(4) self.game.beginTurn(2) self.check_button(2) # (blind, missed, wait) self.check_blinds([('big', None, False, 0), # 1 (None, None, False, 0), # 2 ('small', None, False, 0), # 3 (None, 'big', False, 1), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(3, small, 0), (1, big, 0)]) self.game.beginTurn(3) self.check_button(3) # (blind, missed, wait) self.check_blinds([('small', None, False, 0), # 1 ('big', None, False, 0), # 2 (None, None, False, 0), # 3 (None, 'big', False, 1), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(1, small, 0), (2, big, 0)]) self.assertEquals(self.game.serial2player[4].getMissedRoundCount(), 1) self.assertEquals(self.game.serial2player[1].getMissedRoundCount(), 0) self.game.sit(4) self.game.beginTurn(4) self.check_button(1) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 ('late', 'big', False, 1), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(2, small, 0), (3, big, 0), (4, big, 0)]) self.game.beginTurn(5) self.check_button(2) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 (None, None, False, 0), # 2 ('small', None, False, 0), # 3 ('big', None, False, 0), # 4 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(3, small, 0), (4, big, 0)]) # -------------------------------------------------------------------------- def test5_sixPlayers_missedBothBlinds_bothRequired(self): """ At six players, player 4 missed the big and small blinds and must pay BOTH when back in the game. The missed blind count only ever goes to one, because the player is not passed again. """ big = self.amounts['big'] small = self.amounts['small'] for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3), (5, 4), (6, 5)): self.make_new_bot(serial, seat) self.game.beginTurn(1) self.check_button(1) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 (None, None, False, 0), # 4 (None, None, False, 0), # 5 (None, None, False, 0), # 6 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(2, small, 0), (3, big, 0)]) self.game.sitOut(4) self.game.beginTurn(2) self.check_button(2) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 (None, None, False, 0), # 2 ('small', None, False, 0), # 3 (None, 'big', False, 1), # 4 ('big', None, False, 0), # 5 (None, None, False, 0), # 6 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(3, small, 0), (5, big, 0)]) self.game.beginTurn(3) self.check_button(3) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 (None, None, False, 0), # 2 (None, None, False, 0), # 3 (None, 'big', False, 1), # 4 ('small', None, False, 0), # 5 ('big', None, False, 0), # 6 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(5, small, 0), (6, big, 0)]) self.assertEquals(self.game.serial2player[4].getMissedRoundCount(), 1) self.game.sit(4) self.game.beginTurn(4) self.check_button(5) # (blind, missed, wait) self.check_blinds([('big', None, False, 0), # 1 (None, None, False, 0), # 2 (None, None, False, 0), # 3 ('big_and_dead', 'big', False, 1), # 4 (None, None, False, 0), # 5 ('small', None, False, 0), # 6 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(6, small, 0), (1, big, 0), (4, big, small)]) self.game.beginTurn(5) # (blind, missed, wait) self.check_blinds([('small', None, False, 0), # 1 ('big', None, False, 0), # 2 (None, None, False, 0), # 3 (None, None, False, 0), # 4 (None, None, False, 0), # 5 (None, None, False, 0), # 6 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(1, small, 0), (2, big, 0)]) # -------------------------------------------------------------------------- def test6_fivePlayers_multiDecline_noHandStarts(self): """Five players, goes 2 handed before first hand dealt. Others sit in after. At five players, 1, 2 and 4 sit out before first hand begins. 3 accepts the small blind, as 1, 2, and 4 sit back in. 5 rejects the big blind, and the turn ends. We restart with the five sitting out and blinds in the right place. """ big = self.amounts['big'] small = self.amounts['small'] for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3), (5, 4)): self.make_new_bot(serial, seat) self.game.sitOut(1) self.game.sitOut(2) self.game.sitOut(4) self.game.beginTurn(1) self.check_button(5) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 (None, 'small', False, 0), # 2 ('small', None, False, 0), # 3 (None, 'big', False, 1), # 4 ('big', None, False, 0), # 5 ]) self.assertEquals(self.game.serial2player[4].getMissedRoundCount(), 1) self.game.sit(1) self.game.sit(2) self.game.autoBlindAnte(3) self.game.noAutoBlindAnte(3) self.game.sit(4) self.confirm_hist(self.game.turn_history, [('blind_request', 5, big, 0, 'big'), ('blind', 3, small, 0)]) self.check_button(5) # (blind, missed, wait) self.check_blinds([(None, None, 'first_round', 0), # 1 (None, 'small', 'first_round', 0), # 2 (True, None, False, 0), # 3 (None, 'big', 'first_round', 1), # 4 ('big', None, False, 0), # 5 ]) self.game.sitOut(5) self.confirm_hist(self.game.turn_history, [('canceled', 3, small)]) self.failUnless(self.game.state, "end") self.failUnless(self.game.serial2player[3].money, self.game.bestBuyIn()) self.game.sitOut(5) self.game.beginTurn(2) self.check_button(1) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 (None, None, False, 0), # 4 (None, None, False, 0), # 5 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(2, small, 0), (3, big, 0)]) # -------------------------------------------------------------------------- def test7_specialTwoWaitForPost(self): """Special case where two players came in waiting to post. """ game = self.game # for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3)): for (serial, seat) in ((1, 2), (2, 3)): self.make_new_bot(serial, seat) game.beginTurn(1) self.pay_blinds() self.game.beginTurn(2) # (blind, missed, wait) self.check_blinds([ ('small', None, False, 0), # 1 ('big', None, False, 0), # 2 ] ) game.autoBlindAnte(1) game.noAutoBlindAnte(1) game.autoBlindAnte(2) game.noAutoBlindAnte(2) game.sitOutNextTurn(2) self.failUnless(self.game.state, "end") # # Two players came in and are waiting for # the late blind because they attempted to enter # either on the small blind or the dealer position. # Fake this situation instead of playing hands that # will lead to the same because it introduces an # complexity that is not necessary. This case can happen # indeed although very rarely. # for (serial, seat) in ((3, 0), (4, 7)): self.make_new_player(serial, seat) game.getPlayer(serial).wait_for = 'late' self.game.beginTurn(3) # (blind, missed, wait) self.check_blinds([('big', None, False, 0), # 1 (None, None, False, 0), # 2 (None, 'small', False, 0), # 3 ('small', None, False, 0) # 4 ]) # -------------------------------------------------------------------------- def test8_updateBlinds(self): """updateBlinds() test """ game = self.game for (serial, seat) in ((1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)): self.make_new_bot(serial, seat) game.player_list = [1, 3, 4, 5, 6] game.dealer_seat = 3 for ( serial, blind_info ) in ( (1, ("big", "n/a", False, 0)), (2, ("late", "n/a", "first_round", 0)), (3, (None, None, False, 0)), (4, (None, "n/a", "late", 0)), (5, (None, "n/a", "late", 0)), (6, (True, None, False, 0)), ): player = game.getPlayer(serial) ( player.blind, player.missed_blind, player.wait_for, player.missed_big_blind_count ) = blind_info game.updateBlinds() self.check_blinds([ ("big", "n/a", False, 0), ("late", "n/a", "first_round", 0), (None, None, False, 0), (None, "n/a", "late", 0), (None, "n/a", "late", 0), (True, None, False, 0), ]) # -------------------------------------------------------------------------- def test9_fivePlayers_missedBothBlinds_onlyBigRequired(self): """ Less than 6 players, player 4 missed the big and small blinds and must pay the big blind when back in the game. The missed blind count only ever goes to one, because the player is not passed again. """ big = self.amounts['big'] small = self.amounts['small'] for (serial, seat) in ((1, 0), (2, 1), (3, 2), (4, 3), (5, 4)): self.make_new_bot(serial, seat) self.game.beginTurn(1) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 (None, None, False, 0), # 4 (None, None, False, 0), # 5 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(2, small, 0), (3, big, 0)]) self.game.sitOut(4) self.game.beginTurn(2) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 (None, None, False, 0), # 2 ('small', None, False, 0), # 3 (None, 'big', False, 1), # 4 ('big', None, False, 0), # 5 ] ) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(3, small, 0), (5, big, 0)]) self.game.beginTurn(3) # (blind, missed, wait) self.check_blinds([('big', None, False, 0), # 1 (None, None, False, 0), # 2 (None, None, False, 0), # 3 (None, 'big', False, 1), # 4 ('small', None, False, 0), # 5 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(5, small, 0), (1, big, 0)]) self.assertEquals(self.game.serial2player[4].getMissedRoundCount(), 1) self.game.sit(4) self.game.beginTurn(4) # (blind, missed, wait) self.assertEquals(self.game.serial2player[4].getMissedRoundCount(), 1) self.check_blinds([('small', None, False, 0), # 1 ('big', None, False, 0), # 2 (None, None, False, 0), # 3 ('late', 'big', False, 1), # 4 (None, None, False, 0), # 5 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(1, small, 0), (2, big, 0), (4, big, 0)]) self.assertEquals(self.game.serial2player[4].getMissedRoundCount(), 0) self.game.beginTurn(5) # (blind, missed, wait) self.check_blinds([(None, None, False, 0), # 1 ('small', None, False, 0), # 2 ('big', None, False, 0), # 3 (None, None, False, 0), # 4 (None, None, False, 0), # 5 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(2, small, 0), (3, big, 0)]) # -------------------------------------------------------------------------- def test11_sixPlayers_fiveSitsOutForALongTime(self): """test11_sixPlayers_fiveSitsOutForALongTime Tests six players where the fifth sits out for a long time and the counter runs. """ big = self.amounts['big'] small = self.amounts['small'] for (serial, seat) in ((100, 0), (101, 1), (102, 2), (103, 3), (104, 4), (105, 5)): self.make_new_bot(serial, seat) turn = 0 missedCounterVerify = 0 missedSoFar = None self.assertEquals(self.game.sitOut(105), True) while missedCounterVerify < 4: for serial in [100, 101, 102, 103, 104, 105]: amount = self.game.maxBuyIn() - self.game.serial2player[serial].money self.game.rebuy(serial, amount) turn += 1 self.game.beginTurn(turn) self.check_button(100) self.assertEquals(self.game.isSitOut(105), True) self.check_blinds([(None, None, False, 0), # 100 ('small', None, False, 0), # 101 ('big', None, False, 0), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 (None, missedSoFar, False, missedCounterVerify), # 105 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(101, small, 0), (102, big, 0)]) turn += 1 self.assertEquals(self.game.isSitOut(105), True) self.game.beginTurn(turn) self.check_button(101) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 ('small', None, False, 0), # 102 ('big', None, False, 0), # 103 (None, None, False, 0), # 104 (None, missedSoFar, False, missedCounterVerify), # 105 ]) self.pay_blinds(skipSerials = { 105 : 105 }) self.confirm_blind(self.game.turn_history, [(102, small, 0), (103, big, 0)]) turn += 1 self.assertEquals(self.game.isSitOut(105), True) self.game.beginTurn(turn) self.check_button(102) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 (None, None, False, 0), # 102 ('small', None, False, 0), # 103 ('big', None, False, 0), # 104 (None, missedSoFar, False, missedCounterVerify), # 105 ]) self.pay_blinds(skipSerials = { 105 : 105 }) self.confirm_blind(self.game.turn_history, [(103, small, 0), (104, big, 0)]) turn += 1 missedCounterVerify += 1 self.assertEquals(self.game.isSitOut(105), True) self.game.beginTurn(turn) self.check_button(103) missedSoFar = 'big' self.check_blinds([('big', None, False, 0), # 100 (None, None, False, 0), # 101 (None, None, False, 0), # 102 (None, None, False, 0), # 103 ('small', None, False, 0), # 104 (None, missedSoFar, False, missedCounterVerify), # 105 ]) self.pay_blinds(skipSerials = { 105 : 105 }) self.confirm_blind(self.game.turn_history, [(104, small, 0), (100, big, 0)]) turn += 1 self.game.beginTurn(turn) self.check_button(104) self.assertEquals(self.game.isSitOut(105), True) self.check_blinds([('small', None, False, 0), # 100 ('big', None, False, 0), # 101 (None, None, False, 0), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 (None, missedSoFar, False, missedCounterVerify), # 105 ]) self.pay_blinds(skipSerials = { 105 : 105 }) self.confirm_blind(self.game.turn_history, [(100, small, 0), (101, big, 0)]) # -------------------------------------------------------------------------- def test12_fourPlayers_fourSitsOutForALongTime(self): """test12_fourPlayers_fourSitsOutForALongTime Tests four players where the fourth sits out for a long time and the counter runs. """ big = self.amounts['big'] small = self.amounts['small'] for (serial, seat) in ((100, 0), (101, 1), (102, 2), (103, 3)): self.make_new_bot(serial, seat) turn = 0 missedCounterVerify = 0 missedSoFar = None self.assertEquals(self.game.sitOut(103), True) while missedCounterVerify < 4: for serial in [100, 101, 102, 103]: amount = self.game.maxBuyIn() - self.game.serial2player[serial].money self.game.rebuy(serial, amount) turn += 1 self.game.beginTurn(turn) self.check_button(100) self.assertEquals(self.game.isSitOut(103), True) self.check_blinds([(None, None, False, 0), # 100 ('small', None, False, 0), # 101 ('big', None, False, 0), # 102 (None, missedSoFar, False, missedCounterVerify), # 103 ]) self.pay_blinds(skipSerials = { 103 : 103 }) self.confirm_blind(self.game.turn_history, [(101, small, 0), (102, big, 0)]) self.assertEquals(self.game.serial2player[103].getMissedRoundCount(), missedCounterVerify) turn += 1 missedCounterVerify += 1 missedSoFar = 'big' self.assertEquals(self.game.isSitOut(103), True) self.game.beginTurn(turn) self.check_button(101) self.check_blinds([('big', None, False, 0), # 100 (None, None, False, 0), # 101 ('small', None, False, 0), # 102 (None, missedSoFar, False, missedCounterVerify), # 103 ]) self.pay_blinds(skipSerials = { 103 : 103 }) self.confirm_blind(self.game.turn_history, [(102, small, 0), (100, big, 0)]) self.assertEquals(self.game.serial2player[103].getMissedRoundCount(), missedCounterVerify) turn += 1 self.assertEquals(self.game.isSitOut(103), True) self.game.beginTurn(turn) self.check_button(102) self.check_blinds([('small', None, False, 0), # 100 ('big', None, False, 0), # 101 (None, None, False, 0), # 102 (None, missedSoFar, False, missedCounterVerify), # 103 ]) self.pay_blinds(skipSerials = { 103 : 103 }) self.confirm_blind(self.game.turn_history, [(100, small, 0), (101, big, 0)]) self.assertEquals(self.game.serial2player[103].getMissedRoundCount(), missedCounterVerify) def helperForTest13and14(self, big, small): """This just sets up a situation that can have two outcomes; after sitting out for a very long time, the 102 player can sit in while the blinds are being posted, or before they are.""" for (serial, seat) in ((100, 0), (101, 1), (102, 2), (103, 3), (104, 4), (105, 5), (106, 6)): self.make_new_bot(serial, seat) turn = 0 missedCounterVerify = 0 missedSoFar = None turn += 1 self.game.beginTurn(turn) self.check_button(100) self.check_blinds([(None, None, False, 0), # 100 ('small', None, False, 0), # 101 ('big', None, False, 0), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 (None, missedSoFar, False, missedCounterVerify), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(101, small, 0), (102, big, 0)]) turn += 1 self.game.beginTurn(turn) self.check_button(101) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 ('small', None, False, 0), # 102 ('big', None, False, 0), # 103 (None, None, False, 0), # 104 (None, None, False, 0), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(102, small, 0), (103, big, 0)]) turn += 1 self.game.beginTurn(turn) self.check_button(102) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 (None, None, False, 0), # 102 ('small', None, False, 0), # 103 ('big', None, False, 0), # 104 (None, None, False, 0), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(103, small, 0), (104, big, 0)]) self.assertEquals(self.game.sitOut(102), True) missedCounterVerify = 0 missedSoFar = None self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), 0) while missedCounterVerify < 4: for serial in [100, 101, 102, 103, 104, 105, 106]: amount = self.game.maxBuyIn() - self.game.serial2player[serial].money self.game.rebuy(serial, amount) turn += 1 self.game.beginTurn(turn) self.check_button(103) self.assertEquals(self.game.isSitOut(102), True) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 (None, missedSoFar, False, missedCounterVerify), # 102 (None, None, False, 0), # 103 ('small', None, False, 0), # 104 ('big', None, False, 0), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds(skipSerials = { 102 : 102 }) self.confirm_blind(self.game.turn_history, [(104, small, 0), (105, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) turn += 1 self.assertEquals(self.game.isSitOut(102), True) self.game.beginTurn(turn) self.check_button(104) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 (None, missedSoFar, False, missedCounterVerify), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 ('small', None, False, 0), # 105 ('big', None, False, 0), # 106 ]) self.pay_blinds(skipSerials = { 102 : 102 }) self.confirm_blind(self.game.turn_history, [(105, small, 0), (106, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) turn += 1 self.assertEquals(self.game.isSitOut(102), True) self.game.beginTurn(turn) self.check_button(105) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.check_blinds([('big', None, False, 0), # 100 (None, None, False, 0), # 101 (None, missedSoFar, False, missedCounterVerify), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 (None, None, False, 0), # 105 ('small', None, False, 0), # 106 ]) self.pay_blinds(skipSerials = { 102 : 102 }) self.confirm_blind(self.game.turn_history, [(106, small, 0), (100, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) turn += 1 self.assertEquals(self.game.isSitOut(102), True) self.game.beginTurn(turn) self.check_button(106) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.check_blinds([('small', None, False, 0), # 100 ('big', None, False, 0), # 101 (None, missedSoFar, False, missedCounterVerify), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 (None, None, False, 0), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds(skipSerials = { 102 : 102 }) self.confirm_blind(self.game.turn_history, [(100, small, 0), (101, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) turn += 1 missedCounterVerify += 1 missedSoFar = 'big' self.game.beginTurn(turn) self.check_button(100) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.assertEquals(self.game.isSitOut(102), True) self.check_blinds([(None, None, False, 0), # 100 ('small', None, False, 0), # 101 (None, missedSoFar, False, missedCounterVerify), # 102 ('big', None, False, 0), # 103 (None, None, False, 0), # 104 (None, None, False, 0), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds(skipSerials = { 102 : 102 }) self.confirm_blind(self.game.turn_history, [(101, small, 0), (103, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) turn += 1 self.game.beginTurn(turn) self.check_button(101) self.assertEquals(self.game.isSitOut(102), True) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 (None, missedSoFar, False, missedCounterVerify), # 102 ('small', None, False, 0), # 103 ('big', None, False, 0), # 104 (None, None, False, 0), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds(skipSerials = { 102 : 102 }) self.confirm_blind(self.game.turn_history, [(103, small, 0), (104, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) return(turn, missedSoFar, missedCounterVerify) # -------------------------------------------------------------------------- def test13_sevenPlayers_fiveSitsOutForALongTimeAfterInitialPayment_duringBlinds(self): """test13_sevenPlayers_fiveSitsOutForALongTimeAfterInitialPayment_duringBlinds Tests seven players where the fifth sits out for a long time and the counter runs. """ big = self.amounts['big'] small = self.amounts['small'] (turn, missedSoFar, missedCounterVerify) = self.helperForTest13and14(big, small) # end of while, now let's try to sit back in! In this test, we # sit back in during the blind posting period. turn += 1 self.game.beginTurn(turn) self.check_button(103) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.assertEquals(self.game.sit(102), True) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 (None, 'big', 'first_round', missedCounterVerify), # 102 (None, None, False, 0), # 103 ('small', None, False, 0), # 104 ('big', None, False, 0), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(104, small, 0), (105, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) turn += 1 self.game.beginTurn(turn) self.check_button(104) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.assertEquals(self.game.isSit(102), True) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 ('big_and_dead', 'big', False, missedCounterVerify), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 ('small', None, False, 0), # 105 ('big', None, False, 0), # 106 ]) self.pay_blinds() # We find 102 has posted big and small, since he can now play again. self.confirm_blind(self.game.turn_history, [(105, small, 0), (106, big, 0), (102, big, small)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), 0) turn += 1 self.game.beginTurn(turn) self.check_button(105) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), 0) self.assertEquals(self.game.isSit(102), True) self.check_blinds([('big', None, False, 0), # 100 (None, None, False, 0), # 101 (None, None, False, 0), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 (None, None, False, 0), # 105 ('small', None, False, 0), # 106 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(106, small, 0), (100, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), 0) # -------------------------------------------------------------------------- def test14_sevenPlayers_fiveSitsOutForALongTimeAfterInitialPayment_beforeBlinds(self): """test14_sevenPlayers_fiveSitsOutForALongTimeAfterInitialPayment_beforeBlinds Tests seven players where the fifth sits out for a long time and the counter runs. Then, he sits abck but while they are posting blinds. """ big = self.amounts['big'] small = self.amounts['small'] (turn, missedSoFar, missedCounterVerify) = self.helperForTest13and14(big, small) # end of while, now let's try to sit back in! In this test, we # sit back in before the blinds are posted self.assertEquals(self.game.sit(102), True) turn += 1 self.game.beginTurn(turn) self.check_button(103) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), missedCounterVerify) self.assertEquals(self.game.isSit(102), True) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 ('big_and_dead', 'big', False, missedCounterVerify), # 102 (None, None, False, 0), # 103 ('small', None, False, 0), # 104 ('big', None, False, 0), # 105 (None, None, False, 0), # 106 ]) self.pay_blinds() # We find 102 has posted big and small, since he can now play again. self.confirm_blind(self.game.turn_history, [(104, small, 0), (105, big, 0), (102, big, small)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), 0) turn += 1 self.game.beginTurn(turn) self.check_button(104) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), 0) self.assertEquals(self.game.isSit(102), True) self.check_blinds([(None, None, False, 0), # 100 (None, None, False, 0), # 101 (None, None, False, 0), # 102 (None, None, False, 0), # 103 (None, None, False, 0), # 104 ('small', None, False, 0), # 105 ('big', None, False, 0), # 106 ]) self.pay_blinds() self.confirm_blind(self.game.turn_history, [(105, small, 0), (106, big, 0)]) self.assertEquals(self.game.serial2player[102].getMissedRoundCount(), 0) def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestBlinds)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestBlinds, prefix = # "test12")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/blinds.py ) ; ( cd ../tests ; make TESTS='blinds.py' check )" # End: poker-engine-1.3.6/tests/bugs.py.in0000644000175000017500000000444111344205422014106 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2004, 2005, 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Johan Euphrosine # import sys, os sys.path.insert(0, "@top_srcdir@") sys.path.insert(0, "..") import unittest from pokereval import PokerEval from pokerengine import pokergame from pokerengine.pokergame import PokerGameServer, PokerGame from pokerengine.pokercards import PokerCards class TestBugUncalled(unittest.TestCase): def setUp(self): self.game = PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) self.game.verbose = 3 self.game.setVariant("holdem") self.game.setBettingStructure(".10-.25-no-limit") def tearDown(self): del self.game def test01(self): pass def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestBugUncalled)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(TestBugUncalled, prefix = # "test01")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/bugs.py ) ; ( cd ../tests ; make TESTS='bugs.py' check )" # End: poker-engine-1.3.6/tests/test-i18n.py.in0000644000175000017500000000751111344205422014703 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2008 Bradley M. Kuhn # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Jerome Jeannin # Bradley M. Kuhn import sys, os sys.path.insert(0, "@top_srcdir@") import unittest from pokerengine import pokergame #--------------------------- class FakePlatform: def __init__(self, system): self._system = system def system(self): return self._system class FakeLocale: def __init__(self, lang): self._lang = lang def getdefaultlocale(self): return (self._lang, None) # --------------------------------------------------------- class PokerI18NTest(unittest.TestCase): # --------------------------------------------------------- def testTranslationFails(self): """Test I18N : domains/lang fails""" # When we do the init, we've already set it to an _() that returns # text. self.assertEquals(pokergame.init_i18n(None)("ANYTHING"), "ANYTHING") self.failUnlessEqual(pokergame._("Ace"), "Ace") # --------------------------------------------------------- def testWindowsFails(self): """Test I18N : windows fails""" pokergame.platform = FakePlatform("Windows") pokergame.locale = FakeLocale("french") pokergame.init_i18n(None) self.failUnlessEqual(pokergame._("Ace"), "Ace") # --------------------------------------------------------- def testWindowsSuccess(self): """Test I18N : windows success""" pokergame.platform = FakePlatform("Windows") pokergame.locale = FakeLocale("french") pokergame.init_i18n("./tmp") self.failUnlessEqual(pokergame._("Ace"), "As") # --------------------------------------------------------- def testUserWrittenTranslationFunction(self): """Test I18N : user written translation function""" self.assertEquals(pokergame.init_i18n(None, lambda text : "All your string are translated to us.") ("DUMMY TEXT RETURN"), "DUMMY TEXT RETURN") self.failUnlessEqual(pokergame._("Ace"), "All your string are translated to us.") # --------------------------------------------------------- def run(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerI18NTest)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(PokerI18NTest, prefix = "test2")) verbosity = int(os.environ.get('VERBOSE_T', 2)) return unittest.TextTestRunner(verbosity=verbosity).run(suite) if __name__ == '__main__': if run().wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-i18n.py ) ; ( cd ../tests ; make TESTS='test-i18n.py' check )" # End: poker-engine-1.3.6/tests/test-game.py.in0000644000175000017500000067071011344205422015044 00000000000000# -*- mode: python -*- # Copyright (C) 2006 - 2010 Loic Dachary # Copyright (C) 2006 Mekensleep # # Mekensleep # 26 rue des rosiers # 75004 Paris # licensing@mekensleep.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # # Authors: # Pierre-Andre (05/2006) # Loic Dachary # import sys, os sys.path.insert(0, "@top_srcdir@") import unittest import os.path import shutil import platform import libxml2 import time import string import tempfile import math from types import * from pokerengine import pokercards from pokerengine import pokergame CallbackIds = None CallbackArgs = None # --------------------------------------------------------- def InitCallback(): global CallbackIds global CallbackArgs CallbackIds = None CallbackArgs = None # --------------------------------------------------------- def Callback(id, *args): global CallbackIds global CallbackArgs if not CallbackIds: CallbackIds = [] if not CallbackArgs: CallbackArgs = [] CallbackIds.append(id) CallbackArgs.append(args) # --------------------------------------------------------- class PokerPredefinedDecks: def __init__(self, decks): self.decks = decks self.index = 0 def shuffle(self, deck): deck[:] = self.decks[self.index][:] self.index += 1 if self.index >= len(self.decks): self.index = 0 # --------------------------------------------------------- class PokerGameTestCase(unittest.TestCase): TestConfDirectory = '@srcdir@/test-data/conf' TestVariantInvalidFile = 'unittest.variant.invalid.xml' TestVariantTemplateFile = 'unittest.variant.template.xml' TestConfigTemplateFile = 'unittest.config.template.xml' TestLevelsTemplateFile = 'unittest.levels.template.xml' TestUrl = 'unittest.%s.xml' TestConfigTemporaryFile = 'config' TestVariantTemporaryFile = 'variant' # --------------------------------------------------------- def setUp(self): self.VariantInvalidFile = os.path.join(PokerGameTestCase.TestConfDirectory, PokerGameTestCase.TestVariantInvalidFile) self.ConfigTmplFile = os.path.join(PokerGameTestCase.TestConfDirectory, PokerGameTestCase.TestConfigTemplateFile) self.VariantTmplFile = os.path.join(PokerGameTestCase.TestConfDirectory, PokerGameTestCase.TestVariantTemplateFile) self.LevelsTmplFile = os.path.join(PokerGameTestCase.TestConfDirectory, PokerGameTestCase.TestLevelsTemplateFile) self.ConfigTempFile = os.path.join(tempfile.gettempdir(), PokerGameTestCase.TestUrl % PokerGameTestCase.TestConfigTemporaryFile) self.VariantTempFile = os.path.join(tempfile.gettempdir(), PokerGameTestCase.TestUrl % PokerGameTestCase.TestVariantTemporaryFile) self.CreateGameServer() self.InitGame() InitCallback() # --------------------------------------------------------- def tearDown(self): self.DeleteFile(self.ConfigTempFile) self.DeleteFile(self.VariantTempFile) # --------------------------------------------------------- def testUniq(self): """Test Poker Game : Uniq""" self.failUnlessEqual(pokergame.uniq([1, 4, 4, 7]).sort(), [1, 4, 7].sort()) self.failUnlessEqual(pokergame.uniq([1, 4, 4, 7, 3, 3, 3, 9, 7]).sort(), [1, 3, 4, 7, 9].sort()) # --------------------------------------------------------- def testPokerRandom(self): """Test Poker Game : Poker Random""" # Only available on unix like systems if os.name != "posix": return # Standard random dev random1 = pokergame.PokerRandom(False) # Paranoid random dev random2 = pokergame.PokerRandom(True) # These functions are not implemented self.failUnlessEqual(random1.getstate(), None) self.failUnlessEqual(random1.setstate('Ignore'), None) self.failUnlessEqual(random1.jumpahead('Ignore'), None) # Re open the random dev random1.seed(None) random2.seed(None) numbers1 = [] numbers2 = [] for num in range(20): numbers1.append(random1.random()) numbers2.append(random2.random()) # All the numbers should be different pokergame.uniq(numbers1) pokergame.uniq(numbers2) self.failUnlessEqual(len(numbers1), 20) self.failUnlessEqual(len(numbers2), 20) # --------------------------------------------------------- def testGetSerialByNameNoCase(self): """Test Poker Game : Get serial by name no case sensitive""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Set the player's name player1.name = 'Player1' player2.name = 'Player2' # Seach player by his name (no case sensitive) self.failUnlessEqual(self.game.getSerialByNameNoCase('player1'), 1) self.failUnlessEqual(self.game.getSerialByNameNoCase('pLaYEr2'), 2) self.failUnlessEqual(self.game.getSerialByNameNoCase('unknown'), 0) # --------------------------------------------------------- def testSetPosition(self): """Test Poker Game : Set position""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Position initially set to 0 self.failUnlessEqual(self.game.position, 0) # The game is not running, the set position function is not avalaible self.failIf(self.game.isRunning()) self.game.setPosition(5) self.failUnlessEqual(self.game.position, 0) # Blind and ante turn self.game.forced_dealer_seat = 2 self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The game is running, the set position function is available self.failUnless(self.game.isRunning()) self.game.setPosition(2) self.failUnlessEqual(self.game.position, 2) self.failUnlessEqual(self.game.getSerialInPosition(), 3) # Invalid position self.game.setPosition(-1) self.failUnlessEqual(self.game.getSerialInPosition(), 0) # --------------------------------------------------------- def testPokerGameSetInvalidMaxPlayer(self): """Test Poker Game : Set an invalid number max of player""" # The minimum number of player is 2 self.game.setMaxPlayers(0) self.failUnlessEqual(self.game.seatsLeftCount(), 0) self.failUnlessEqual(self.game.seatsCount(), 0) self.game.setMaxPlayers(1) self.failUnlessEqual(self.game.seatsLeftCount(), 0) self.failUnlessEqual(self.game.seatsCount(), 0) # The maximum number of player is sepcified by the ABSOLUTE_MAX_PLAYERS constant self.game.setMaxPlayers(pokergame.ABSOLUTE_MAX_PLAYERS + 1) self.failUnlessEqual(self.game.seatsLeftCount(), 0) self.failUnlessEqual(self.game.seatsCount(), 0) # --------------------------------------------------------- def testPokerGameSetValidMaxPlayer(self): """Test Poker Game : Set a valid number max of player""" # Test all the valid numbers of player for num in range(2,pokergame.ABSOLUTE_MAX_PLAYERS): self.game.setMaxPlayers(num) self.failUnlessEqual(self.game.seatsLeftCount(), num) self.failUnlessEqual(self.game.seatsCount(), num) # --------------------------------------------------------- def testSetSeats(self): """Test Poker Game : Set seats""" # Set the number maximum of players, the available seats are [1, 3, 6, 8] self.game.setMaxPlayers(4) # Create players for player in range(1, 5): player = self.AddPlayerAndSit(player) # Set the seats of all the players seats = [0] * pokergame.ABSOLUTE_MAX_PLAYERS seats[1] = 1 seats[3] = 3 seats[6] = 4 seats[8] = 2 self.game.setSeats(seats) self.failUnlessEqual(self.GetPlayer(1).seat, 1) self.failUnlessEqual(self.GetPlayer(2).seat, 8) self.failUnlessEqual(self.GetPlayer(3).seat, 3) self.failUnlessEqual(self.GetPlayer(4).seat, 6) # Set the seats of all the players # The seat of the player 3 is not available seats = [0] * pokergame.ABSOLUTE_MAX_PLAYERS seats[1] = 1 seats[4] = 3 seats[6] = 4 seats[8] = 2 self.game.setSeats(seats) self.failUnlessEqual(self.GetPlayer(3).seat, -1) # --------------------------------------------------------- def testPokerGameOpen(self): """Test Poker Game : Open and close""" self.failUnlessEqual(self.game.is_open, True) self.game.close() self.failUnlessEqual(self.game.is_open, False) self.game.open() self.failUnlessEqual(self.game.is_open, True) # --------------------------------------------------------- def testPokerGameCanAddPlayer(self): """Test Poker Game : Can add player""" # The player can be added to the game self.failUnless(self.game.canAddPlayer(1)) # No player can be added if the game is closed self.game.close() self.failIf(self.game.canAddPlayer(2)) # Player can be added if the game is opened self.game.open() self.failUnless(self.game.canAddPlayer(2)) # --------------------------------------------------------- def testPokerGameAddPlayerWithoutSelectedSeat(self): """Test Poker Game : Add a player without a selected seat""" # Add a new player self.failUnless(self.game.addPlayer(1)) self.failUnless(self.game.isSeated(1)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add the same player self.failIf(self.game.addPlayer(1)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Add a new player self.failUnless(self.game.addPlayer(2)) self.failUnless(self.game.isSeated(2)) self.failUnlessEqual(self.game.seatsLeftCount(), 0) # Try to add new one but there is no seat left self.failIf(self.game.addPlayer(3)) self.failIf(self.game.isSeated(3)) self.failUnlessEqual(self.game.seatsLeftCount(), 0) # --------------------------------------------------------- def testPokerGameAddPlayerWithSelectedSeat(self): """Test Poker Game : Add a player with a selected seat""" # Add a player on the seat 2 self.failUnless(self.game.addPlayer(1,2)) self.failUnless(self.game.isSeated(1)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add the same player on the same seat self.failUnless(self.game.addPlayer(1,2)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add the same player on another seat self.failIf(self.game.addPlayer(1,7)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add a new player on an invalid seat self.failIf(self.game.addPlayer(2,3)) self.failIf(self.game.isSeated(2)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add a new player on an unavailable seat self.failIf(self.game.addPlayer(2,2)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Add a player on the seat 7 self.failUnless(self.game.addPlayer(2,7)) self.failUnless(self.game.isSeated(2)) self.failUnlessEqual(self.game.seatsLeftCount(), 0) # --------------------------------------------------------- def testPokerGameAddPlayerClientGame(self): """Test Poker Game : Add a player client game""" # Create a client game self.CreateGameClient() self.InitGame() # Try to add a new player without a selected seat self.failIf(self.game.addPlayer(1)) self.failIf(self.game.isSeated(1)) self.failUnlessEqual(self.game.seatsLeftCount(), 2) # Add a player on the seat 2 self.failUnless(self.game.addPlayer(1,2)) self.failUnless(self.game.isSeated(1)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add the same player on the same seat self.failUnless(self.game.addPlayer(1,2)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add the same player on another seat self.failIf(self.game.addPlayer(1,7)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add a new player on an invalid seat self.failIf(self.game.addPlayer(2,3)) self.failIf(self.game.isSeated(2)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Try to add a new player on an unavailable seat self.failIf(self.game.addPlayer(2,2)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Add a player on the seat 7 self.failUnless(self.game.addPlayer(2,7)) self.failUnless(self.game.isSeated(2)) self.failUnlessEqual(self.game.seatsLeftCount(), 0) # --------------------------------------------------------- def testPokerGameGetPlayer(self): """Test Poker Game : Get player""" self.failUnlessEqual(self.game.serialsAll(), []) self.failUnlessEqual(self.game.playersAll(), []) self.failUnlessEqual(self.game.allCount(), 0) self.failUnless(self.game.addPlayer(1)) player = self.GetPlayer(1) self.failUnlessEqual(self.game.getPlayer(2), None) self.failUnlessEqual(self.game.serialsAll(), [1]) self.failUnlessEqual(self.game.playersAll(), [player]) self.failUnlessEqual(self.game.allCount(), 1) # --------------------------------------------------------- def testPokerGameSeats(self): """Test Poker Game : Seats""" seats = self.game.seats() for seat in seats: self.failUnlessEqual(seats[seat], 0) self.failUnlessEqual(self.game.addPlayer(1, 2), True) self.failUnlessEqual(self.game.addPlayer(2, 7), True) seats = self.game.seats() self.failUnlessEqual(seats[2], 1) self.failUnlessEqual(seats[7], 2) # --------------------------------------------------------- def testPokerGamePlayerCanComeBack(self): """Test Poker Game : Player can come back""" # Unknown player self.failIf(self.game.canComeBack(1)) self.failIf(self.game.comeBack(1)) # Add a new player player1 = self.AddPlayerAndSit(1, 2) # Initially the player are connected and not auto self.failIf(self.game.canComeBack(1)) self.failIf(self.game.comeBack(1)) # Player disconnected player1.remove_next_turn = True self.failUnlessEqual(self.game.serialsDisconnected(), [1]) # The player can now come back self.failUnless(self.game.canComeBack(1)) self.failUnless(self.game.comeBack(1)) # The player is now in the game self.failIf(self.game.canComeBack(1)) self.failIf(player1.remove_next_turn) self.failIf(player1.sit_out_next_turn) self.failIf(player1.sit_requested) self.failIf(player1.auto) # The player is an automatic player player1.auto = True self.failUnless(player1.isAuto()) # The player now can come back self.failUnless(self.game.canComeBack(1)) self.failUnless(self.game.comeBack(1)) # The player is now in the game self.failIf(self.game.canComeBack(1)) self.failIf(player1.remove_next_turn) self.failIf(player1.sit_out_next_turn) self.failIf(player1.sit_requested) self.failIf(player1.auto) # --------------------------------------------------------- def testPokerGameSitPlayer(self): """Test Poker Game : Player sit""" self.failUnlessEqual(self.game.sitCount(), 0) self.failUnlessEqual(self.game.serialsSit(), []) self.failUnlessEqual(self.game.playersSit(), []) self.failUnlessEqual(self.game.sitOutCount(), 0) self.failUnlessEqual(self.game.serialsSitOut(), []) self.failUnlessEqual(self.game.playersSitOut(), []) self.failUnlessEqual(self.game.addPlayer(1), True) player = self.GetPlayer(1) self.failUnlessEqual(self.game.sitCount(), 0) self.failUnlessEqual(self.game.serialsSit(), []) self.failUnlessEqual(self.game.playersSit(), []) self.failUnlessEqual(self.game.sitOutCount(), 1) self.failUnlessEqual(self.game.serialsSitOut(), [1]) self.failUnlessEqual(self.game.playersSitOut(), [player]) player.sit_out = False self.failUnlessEqual(self.game.sitCount(), 1) self.failUnlessEqual(self.game.serialsSit(), [1]) self.failUnlessEqual(self.game.playersSit(), [player]) self.failUnlessEqual(self.game.sitOutCount(), 0) self.failUnlessEqual(self.game.serialsSitOut(), []) self.failUnlessEqual(self.game.playersSitOut(), []) # --------------------------------------------------------- def testPokerGameCallback(self): """Test Poker Game : Callback""" # No callback registered InitCallback() self.game.runCallbacks('Args1', 'Args2') self.failUnlessEqual(len(self.game.callbacks), 0) self.failUnlessEqual(CallbackIds, None) self.failUnlessEqual(CallbackArgs, None) # Register a callback InitCallback() self.game.registerCallback(Callback) self.game.runCallbacks('Args1', 'Args2') self.failUnlessEqual(len(self.game.callbacks), 1) self.failUnlessEqual(CallbackIds, [self.game.id]) self.failUnlessEqual(CallbackArgs, [('Args1', 'Args2')]) # Unregister the previous callback InitCallback() self.game.unregisterCallback(Callback) self.game.runCallbacks('Args1', 'Args2') self.failUnlessEqual(len(self.game.callbacks), 0) self.failUnlessEqual(CallbackIds, None) self.failUnlessEqual(CallbackArgs, None) # --------------------------------------------------------- def testPokerGameBettingStructure(self): """Test Poker Game : Initialisation of the betting structure""" self.failUnlessEqual(self.game.getBettingStructureName(), 'Bet Description') self.failUnlessEqual(self.game.buyIn(), 50) self.failUnlessEqual(self.game.maxBuyIn(), 10000) self.failUnlessEqual(self.game.bestBuyIn(), 1600) self.failUnlessEqual(self.game.getChipUnit(), 300) bet_properties = { 'buy-in' : '100', 'max-buy-in' : '20000', 'best-buy-in' : '1000', 'unit' : '600' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', None, bet_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnlessEqual(self.game.buyIn(), 100) self.failUnlessEqual(self.game.maxBuyIn(), 20000) self.failUnlessEqual(self.game.bestBuyIn(), 1000) self.failUnlessEqual(self.game.getChipUnit(), 600) rounds_properties = [ \ { 'name' : 'pre-flop', \ 'cap' : 3 \ }, \ { 'name' : 'flop', \ 'cap' : sys.maxint \ }, \ { 'name' : 'turn', \ 'cap' : sys.maxint \ }, \ { 'name' : 'river', \ 'cap' : 3 \ } \ ] self.failUnlessEqual(len(self.game.bet_info), len(rounds_properties)) self.game.current_round = 0 for round_properties in rounds_properties: for property, value in round_properties.items(): self.failUnlessEqual(self.game.betInfo()[property], value) self.game.current_round += 1 # --------------------------------------------------------- def testPokerGameBlindBettingStructure(self): """Test Poker Game : Initialisation of the blind betting structure""" self.failUnlessEqual(self.game.smallBlind(), 500) self.failUnlessEqual(self.game.bigBlind(), 1000) # Change the blind properties blind_properties = { 'small' : '1000', 'big' : '2000', } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnlessEqual(self.game.smallBlind(), 1000) self.failUnlessEqual(self.game.bigBlind(), 2000) # Change the blind properties blind_properties = { 'change' : 'double', 'frequency' : '15', 'unit' : 'minute', 'small' : '2000', 'big' : '4000' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnlessEqual(self.game.blind_info['small'], 2000) self.failUnlessEqual(self.game.blind_info['small_reference'], 2000) self.failUnlessEqual(self.game.blind_info['big'], 4000) self.failUnlessEqual(self.game.blind_info['big_reference'], 4000) # Change the blind properties blind_properties = { 'change' : 'levels', 'levels' : PokerGameTestCase.TestLevelsTemplateFile } levels_info = [ { 'small' : 1000, 'big' : 1500, 'value' : 100, 'bring-in' : 150 }, { 'small' : 1500, 'big' : 3000, 'value' : 150, 'bring-in' : 300 }, { 'small' : 2500, 'big' : 5000, 'value' : 250, 'bring-in' : 500 } ] if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnlessEqual(self.game.blind_info["levels"], levels_info) # --------------------------------------------------------- def testPokerGameAnteBettingStructure(self): """Test Poker Game : Initialisation of the ante betting structure""" # Change the ante properties ante_properties = { 'value' : '200', 'bring-in' : '1000', } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnlessEqual(self.game.ante_info["value"], 200) self.failUnlessEqual(self.game.ante_info["bring-in"] , 1000) # Change the ante properties ante_properties = { 'change' : 'double', 'frequency' : '15', 'unit' : 'minute', 'value' : '50', 'bring-in' : '200' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/ante', None, ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnlessEqual(self.game.ante_info['value'], 50) self.failUnlessEqual(self.game.ante_info['value_reference'], 50) self.failUnlessEqual(self.game.ante_info['bring-in'], 200) self.failUnlessEqual(self.game.ante_info['bring-in_reference'], 200) # Change the ante properties ante_properties = { 'change' : 'levels', 'levels' : PokerGameTestCase.TestLevelsTemplateFile } levels_info = [ { 'small' : 1000, 'big' : 1500, 'value' : 100, 'bring-in' : 150 }, { 'small' : 1500, 'big' : 3000, 'value' : 150, 'bring-in' : 300 }, { 'small' : 2500, 'big' : 5000, 'value' : 250, 'bring-in' : 500 } ] if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/ante', None, ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnlessEqual(self.game.ante_info["levels"], levels_info) # --------------------------------------------------------- def testPokerGameGetLevelValues(self): """Test Poker Game : Get level values""" # Change the blind properties blind_properties = { 'change' : 'double', 'frequency' : '15', 'unit' : 'minute', 'small' : '2000', 'big' : '4000' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Change the ante properties ante_properties = { 'change' : 'double', 'frequency' : '15', 'unit' : 'minute', 'value' : '50', 'bring-in' : '200' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Change double, check the blind and ante infos for level in range(3): blind_info, ante_info = self.game.getLevelValues(level) self.failUnlessEqual(blind_info['small'], 2000 * pow(2, level - 1)) self.failUnlessEqual(blind_info['big'], 4000 * pow(2, level - 1)) self.failUnlessEqual(ante_info['value'], 50 * pow(2, level - 1)) self.failUnlessEqual(ante_info['bring-in'], 200 * pow(2, level - 1)) # Change the blind properties blind_properties = { 'change' : 'levels', 'levels' : PokerGameTestCase.TestLevelsTemplateFile } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Change the ante properties ante_properties = { 'change' : 'levels', 'levels' : PokerGameTestCase.TestLevelsTemplateFile } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/ante', None, ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Change levels, check the blind and ante infos levels_info = [ { 'small' : 1000, 'big' : 1500, 'value' : 100, 'bring-in' : 150 }, { 'small' : 1500, 'big' : 3000, 'value' : 150, 'bring-in' : 300 }, { 'small' : 2500, 'big' : 5000, 'value' : 250, 'bring-in' : 500 } ] for level in range(3): blind_info, ante_info = self.game.getLevelValues(level + 1) self.failUnlessEqual(blind_info['small'], levels_info[level]['small']) self.failUnlessEqual(blind_info['big'], levels_info[level]['big']) self.failUnlessEqual(ante_info['value'], levels_info[level]['value']) self.failUnlessEqual(ante_info['bring-in'], levels_info[level]['bring-in']) # Change the blind properties blind_properties = { 'change' : 'invalid' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Change the ante properties ante_properties = { 'change' : 'invalid' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/ante', None, ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Change invalid, check the blind and ante infos blind_info, ante_info = self.game.getLevelValues(0) self.failUnlessEqual(blind_info, None) self.failUnlessEqual(blind_info, ante_info) # --------------------------------------------------------- def testPokerGameSetLevelValues(self): """Test Poker Game : Set level values""" # Change the blind properties blind_properties = { 'change' : 'levels', 'frequency' : '15', 'unit' : 'minute', 'levels' : PokerGameTestCase.TestLevelsTemplateFile } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Change the ante properties ante_properties = { 'change' : 'levels', 'frequency' : '15', 'unit' : 'minute', 'levels' : PokerGameTestCase.TestLevelsTemplateFile } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Change the level and check the blind and ante infos levels_info = [ { 'small' : 1000, 'big' : 1500, 'value' : 100, 'bring-in' : 150 }, { 'small' : 1500, 'big' : 3000, 'value' : 150, 'bring-in' : 300 }, { 'small' : 2500, 'big' : 5000, 'value' : 250, 'bring-in' : 500 } ] # Change the level and check for level in range(3): blind_info, ante_info = self.game.getLevelValues(level + 1) self.game.setLevel(level + 1) self.failUnlessEqual(self.game.getLevel(), level + 1) self.failUnlessEqual(self.game.blind_info['small'], blind_info['small']) self.failUnlessEqual(self.game.blind_info['big'], blind_info['big']) self.failUnlessEqual(self.game.ante_info['value'], ante_info['value']) self.failUnlessEqual(self.game.ante_info['bring-in'], ante_info['bring-in']) self.failUnlessEqual(self.game.blind_info['hands'], self.game.hands_count) self.failUnlessEqual(self.game.blind_info['time'], self.game.time) self.failUnlessEqual(self.game.ante_info['hands'], self.game.hands_count) self.failUnlessEqual(self.game.ante_info['time'], self.game.time) # --------------------------------------------------------- def testPokerGameSetVariantInvalid(self): """Test Poker Game : Variant with invalid specifications""" if not self.CopyFile(self.VariantInvalidFile, self.VariantTempFile): self.fail('Error during creation of variant file ' + self.VariantInvalidFile) self.failUnlessRaises(UserWarning, self.game.setVariant,PokerGameTestCase.TestVariantTemporaryFile) # --------------------------------------------------------- def testPokerGameSetVariantWinnerOrder(self): """Test Poker Game : Set variant winner order""" # The winner order is set to high in the self.VariantTmplFile file self.failIf(self.game.isLow()) self.failIf(self.game.hasLow()) self.failUnless(self.game.isHigh()) self.failUnless(self.game.hasHigh()) self.failIf(self.game.isHighLow()) # Change the winner order to low if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/wins/winner', None, {'order' : 'low8'}): self.fail('Error during modification of variant file ' + self.VariantTempFile) self.game.setVariant(PokerGameTestCase.TestVariantTemporaryFile) # The winner order is now low self.failUnless(self.game.isLow()) self.failUnless(self.game.hasLow()) self.failIf(self.game.isHigh()) self.failIf(self.game.hasHigh()) self.failIf(self.game.isHighLow()) # Invalid winner order if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/wins/winner', None, {'order' : 'invalid'}): self.fail('Error during modification of variant file ' + self.VariantTempFile) # An exception is raised if the order is not low8 or hi self.failUnlessRaises(UserWarning,self.game.setVariant, PokerGameTestCase.TestVariantTemporaryFile) # --------------------------------------------------------- def testPokerGameSetVariantRoundInfos(self): """Test Poker Game : Set variant round infos""" # 2 rounds in the template file self.failUnlessEqual(len(self.game.round_info),4) self.failUnlessEqual(len(self.game.round_info_backup),4) for round in range(len(self.game.round_info)): self.failUnlessEqual(self.game.round_info[round],self.game.round_info_backup[round]) round1_info = { 'name': 'pre-flop', 'position': 'under-the-gun', 'board': [], 'board_size': 0, 'hand_size': 2, 'cards': ['down', 'down'] } round2_info = { 'name': 'flop', 'position': 'next-to-dealer', 'board': ['', '', ''], 'board_size': 3, 'hand_size': 2, 'cards': [] } self.failUnlessEqual(self.game.round_info[0], round1_info) self.failUnlessEqual(self.game.round_info[1], round2_info) self.failUnlessEqual(self.game.round_info[0],self.game.round_info_backup[0]) self.failUnlessEqual(self.game.round_info[1],self.game.round_info_backup[1]) # --------------------------------------------------------- def testPokerGameResetRoundInfos(self): """Test Poker Game : Reset round infos""" round1_info = { 'name': 'pre-flop', 'position': 'under-the-gun', 'board': [], 'board_size': 0, 'hand_size': 2, 'cards': ['down', 'down'] } # The round info are loaded from the VariantTmplFile file self.failUnlessEqual(self.game.round_info[0], round1_info) # Change all the round infos self.game.round_info[0]['name'] = 'ModifiedRound' self.game.round_info[0]['position'] = 'ModifiedPosition' self.game.round_info[0]['board'] = ['ModifiedBoard'] self.game.round_info[0]['board_size'] = 'ModifiedBoardSize' self.game.round_info[0]['hand_size'] = 'ModifiedHandSize' self.game.round_info[0]['cards'] = ['up'] # Restore the round backup self.failIfEqual(self.game.round_info[0], round1_info) self.game.resetRoundInfo() self.failUnlessEqual(self.game.round_info[0], round1_info) # --------------------------------------------------------- def testPokerGameLoadTournamentLevels(self): """Test Poker Game : Load tournament levels""" # The levels are loaded from the LevelsTmplFile file levels_info = [ { 'small' : 1000, 'big' : 1500, 'value' : 100, 'bring-in' : 150 }, { 'small' : 1500, 'big' : 3000, 'value' : 150, 'bring-in' : 300 }, { 'small' : 2500, 'big' : 5000, 'value' : 250, 'bring-in' : 500 } ] levels = self.game.loadTournamentLevels(self.LevelsTmplFile) self.failUnlessEqual(levels, levels_info) # --------------------------------------------------------- def testPokerGamePayBuyIn(self): """Test Poker Game : Pay buy in""" self.failUnlessEqual(self.game.addPlayer(1), True) player = self.GetPlayer(1) # Get the buy in values self.failUnlessEqual(self.game.buyIn(), 50) self.failUnlessEqual(self.game.maxBuyIn(), 10000) self.failUnlessEqual(self.game.bestBuyIn(), 1600) # Can not pay more then the max buy in self.failIf(self.game.payBuyIn(1,20000)) self.failIf(player.isBuyInPayed()) # Can not pay less than the min buy in self.failIf(self.game.payBuyIn(1,40)) self.failIf(player.isBuyInPayed()) # Pay the buy in self.failUnless(self.game.payBuyIn(1,100)) self.failUnless(player.isBuyInPayed()) self.failUnlessEqual(self.game.getPlayerMoney(1), 100) # The game in now a tournament, there is no maximum limit # Change the blind properties blind_properties = { 'change' : 'double', 'frequency' : '15', 'unit' : 'minute', 'small' : '2000', 'big' : '4000' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # The player can pay more than the max buy in self.failUnless(self.game.payBuyIn(1,20000)) self.failUnless(player.isBuyInPayed()) self.failUnlessEqual(self.game.getPlayerMoney(1), 20000) # --------------------------------------------------------- def testPokerGameSitRequested(self): """Test Poker Game : Sit requested""" self.failUnlessEqual(self.game.addPlayer(1), True) self.game.sitRequested(1) player = self.GetPlayer(1) self.failUnlessEqual(player.isSitRequested(), True) self.failUnlessEqual(player.isWaitForBlind(), False) self.failUnlessEqual(player.sit_out_next_turn, False) # --------------------------------------------------------- def testPokerGameSit(self): """Test Poker Game : Sit""" self.failUnlessEqual(self.game.addPlayer(1), True) player = self.GetPlayer(1) self.failUnlessEqual(self.game.sit(1), False) self.failUnlessEqual(self.game.payBuyIn(1,self.game.bestBuyIn()), True) self.failUnlessEqual(player.isBuyInPayed(), True) self.failUnlessEqual(self.game.sit(1), True) # --------------------------------------------------------- def testPokerGameBuildPlayerList(self): """Test Poker Game : Build player list""" player1 = self.AddPlayerAndSit(1, 7) self.failUnless(self.game.addPlayer(2, 2)) self.failUnless(self.game.payBuyIn(2,self.game.bestBuyIn())) # Can not construct the player list because there is only one player sit self.failIf(self.game.buildPlayerList(False)) # The player 2 is now sit self.failUnlessEqual(self.game.sit(2), True) # The construction of the player list is now possible self.failUnless(self.game.buildPlayerList(False)) # The players are ordered by his seat self.failUnlessEqual(self.game.player_list, [2, 1]) # The player 1 is waiting for blind and first round player1.wait_for = 'first_round' self.failUnless(player1.isWaitForBlind()) self.failUnless(self.game.buildPlayerList(False)) self.failUnlessEqual(self.game.player_list, [2]) self.failUnless(self.game.buildPlayerList(True)) self.failUnlessEqual(self.game.player_list, [2]) # The player 1 is only waiting for blind player1.wait_for = 'big' self.failUnless(player1.isWaitForBlind()) self.failUnless(self.game.buildPlayerList(False)) self.failUnlessEqual(self.game.player_list, [2]) self.failUnless(self.game.buildPlayerList(True)) self.failUnlessEqual(self.game.player_list, [2, 1]) # --------------------------------------------------------- def testMoveDealerLeft(self): """Test Poker Game : Move dealer left""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # The construction of the player list self.failUnless(self.game.buildPlayerList(False)) self.failUnlessEqual(self.game.player_list, [1, 2]) # The dealer is the player 1 self.failUnlessEqual(self.game.dealer_seat, 2) self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getPlayerDealer(), player1) # Move the dealer self.game.moveDealerLeft() # The player 2 is now the dealer self.failUnlessEqual(self.game.dealer_seat, 7) self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getPlayerDealer(), player2) # Re init the game players self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # The construction of the player list self.failUnless(self.game.buildPlayerList(False)) self.failUnlessEqual(self.game.player_list, [1, 2, 3]) # The dealer is the player 1 self.failUnlessEqual(self.game.dealer_seat, 2) self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getPlayerDealer(), player1) # Move the dealer player2.missed_blind = None self.game.moveDealerLeft() # The player 2 is now the dealer self.failUnlessEqual(self.game.dealer_seat, 5) self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getPlayerDealer(), player2) # No blind info, nothing done self.game.blind_info = None player1.missed_blind = None self.game.moveDealerLeft() # The player 2 is still the dealer self.failUnlessEqual(self.game.dealer_seat, 5) self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getPlayerDealer(), player2) # --------------------------------------------------------- def testDealerFromDealerSeat(self): """Test Poker Game : Dealer from dealer seat""" self.game.setMaxPlayers(3) self.failUnlessEqual(self.game.dealer, -1) self.failUnlessEqual(self.game.dealer_seat, -1) self.game.dealerFromDealerSeat() # The dealer and his seat are not initialised self.failUnlessEqual(self.game.dealer, -1) self.failUnlessEqual(self.game.dealer_seat, -1) # Create player 1 player1 = self.AddPlayerAndSit(1, 2) self.failUnlessEqual(self.game.dealer_seat, 2) self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.dealer, -1) # Create player 2 player2 = self.AddPlayerAndSit(2, 5) self.failUnlessEqual(self.game.dealer_seat, 2) # Construct the player list self.failUnlessEqual(self.game.buildPlayerList(False), True) self.failUnlessEqual(self.game.player_list, [1, 2]) # The dealer is the player 1 self.failUnlessEqual(self.game.dealer_seat, 2) self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getSerialDealer(), 1) self.failUnlessEqual(self.game.getPlayerDealer(), player1) # Change the dealer seat self.game.dealer_seat = 5 # The dealer is now the player 2 self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getSerialDealer(), 2) self.failUnlessEqual(self.game.getPlayerDealer(), player2) # Add a player but do not reconstruct the player list player3 = self.AddPlayerAndSit(3) # Change the dealer seat self.game.dealer_seat = 7 # The dealder is still the player 2 self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getSerialDealer(), 2) self.failUnlessEqual(self.game.getPlayerDealer(), player2) # --------------------------------------------------------- def testSetDealer(self): """Test Poker Game : Set dealer""" player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Construct the player list self.failUnless(self.game.buildPlayerList(False)) # The game is not running self.failIf(self.game.isRunning()) # The dealer can be set because the game is not running self.game.setDealer(7) # The dealer is the player 2 self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getSerialDealer(), 2) # The dealer can be set because the game is not running self.game.setDealer(2) # The dealer is the player 1 self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getSerialDealer(), 1) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The game is now running self.failUnless(self.game.isRunning()) self.failUnlessEqual(self.game.getSerialDealer(), 1) # The set dealer function has no effect self.game.setDealer(7) # The dealer is still the player 1 self.game.dealerFromDealerSeat() self.failUnlessEqual(self.game.getSerialDealer(), 1) # --------------------------------------------------------- def testPokerGameMoney2Bet(self): """Test Poker Game : Money to bet""" self.game.registerCallback(Callback) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Initial player money and bet self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(self.game.getPlayerMoney(1), 1600) # Transfert from money to bet InitCallback() self.game.money2bet(1, 500) self.failUnlessEqual(self.game.getPlayerMoney(1), 1100) self.failUnlessEqual(player1.bet, 500) self.failUnlessEqual(player1.isAllIn(), False) # Check the callback self.failUnlessEqual(CallbackIds, [self.game.id]) self.failUnlessEqual(CallbackArgs, [('money2bet', 1, 500)]) # Initial player money and bet InitCallback() self.failUnlessEqual(player2.bet, 0) self.failUnlessEqual(self.game.getPlayerMoney(2), 1600) # Transfert from money to bet self.game.money2bet(2, 2000) self.failUnlessEqual(self.game.getPlayerMoney(2), 0) self.failUnlessEqual(player2.bet, 1600) self.failUnlessEqual(player2.isAllIn(), True) # Check the callback self.failUnlessEqual(CallbackIds, [self.game.id, self.game.id]) self.failUnlessEqual(CallbackArgs, [('money2bet', 2, 1600), ('all-in', 2)]) # --------------------------------------------------------- def testNotFoldCount(self): """Test Poker Game : Not fold count""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(self.game.notFoldCount(), 2) self.failUnlessEqual(self.game.serialsNotFold(), [1, 2]) self.failUnlessEqual(self.game.playersNotFold(), [player1, player2]) player1.fold = True self.failUnlessEqual(self.game.notFoldCount(), 1) self.failUnlessEqual(self.game.serialsNotFold(), [2]) self.failUnlessEqual(self.game.playersNotFold(), [player2]) # --------------------------------------------------------- def testPot2Money(self): """Test Poker Game : Pot to money""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(self.game.getPlayerMoney(1), self.game.bestBuyIn()) self.game.pot = 500 self.game.pot2money(1) self.failUnlessEqual(self.game.getPlayerMoney(1), self.game.bestBuyIn() + 500) self.failUnlessEqual(self.game.pot, 0) # --------------------------------------------------------- def testGetPotAmount(self): """Test Poker Game : getPotAmount""" # Create players player1 = self.AddPlayerAndSit(1) player2 = self.AddPlayerAndSit(2) self.game.beginTurn(1) self.failUnlessEqual(0 ,self.game.getPotAmount()) self.game.state = pokergame.GAME_STATE_END self.failUnlessEqual(0 ,self.game.getPotAmount()) # --------------------------------------------------------- def testCancelState(self): """Test Poker Game : Cancel state""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) Attributes = { 'current_round' : -2, 'position' : -1, 'state' : 'end' } self.game.position = -1 self.game.cancelState() for key, value in Attributes.items(): self.failUnlessEqual(getattr(self.game,key), value) self.game.position = 0 self.game.turn_history = [] self.game.cancelState() self.failUnlessEqual(self.game.turn_history, [('position', -1)] ) # --------------------------------------------------------- def testHighestBet(self): """Test Poker Game : Highest bet""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(player2.bet, 0) player1.bet = 500 self.failUnlessEqual(self.game.highestBetNotFold(), 500) self.failUnlessEqual(self.game.highestBetInGame(), 500) player2.bet = 1000 self.failUnlessEqual(self.game.highestBetNotFold(), 1000) self.failUnlessEqual(self.game.highestBetInGame(), 1000) player2.fold = True self.failUnlessEqual(self.game.highestBetNotFold(), 500) self.failUnlessEqual(self.game.highestBetInGame(), 500) player2.fold = False player2.all_in = True self.failUnlessEqual(self.game.highestBetNotFold(), 1000) self.failUnlessEqual(self.game.highestBetInGame(), 500) # --------------------------------------------------------- def testBetsEqual(self): """Test Poker Game : Bets equal""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(player2.bet, 0) player1.bet = 500 self.failUnlessEqual(self.game.betsEqual(), False) player2.bet = 500 self.failUnlessEqual(self.game.betsEqual(), True) player2.bet = 1000 player2.all_in = True self.failUnlessEqual(self.game.betsEqual(), False) player2.fold = True self.failUnlessEqual(self.game.betsEqual(), True) player2.fold = False player1.all_in = True self.failUnlessEqual(self.game.betsEqual(), True) # --------------------------------------------------------- def testCanCall(self): """Test Poker Game : Can call""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.canCall(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) player1.bet = 1000 self.failUnless(self.game.canCall(2)) player2.bet = 1500 self.failIf(self.game.canCall(2)) # --------------------------------------------------------- def testCall(self): """Test Poker Game : Call""" self.game.setMaxPlayers(3) player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.call(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) self.failIf(self.game.canAct(1)) self.failIf(self.game.call(1)) # Deal cards self.game.dealCards() self.failUnless(self.game.callNraise(1, 100)) self.failUnless(self.game.canAct(2)) self.failIf(player2.talked_once) self.failUnless(self.game.call(2)) self.failUnlessEqual(player2.bet, 100) self.failUnlessEqual(self.game.getPlayerMoney(2), 1500) self.failUnless(player2.talked_once) self.failUnless(self.game.canAct(3)) # --------------------------------------------------------- def testCanCheck(self): """Test Poker Game : Can check""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.canCheck(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) player1.bet = 1000 player2.bet = 500 self.failIf(self.game.canCheck(2)) player2.bet = 1000 self.failUnless(self.game.canCheck(2)) player2.bet = 1500 self.failUnless(self.game.canCheck(2)) # --------------------------------------------------------- def testCheck(self): """Test Poker Game : Check""" # Create Players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Check is not available during blind and ante round self.failIf(self.game.check(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() # Player 1 can now raise self.failUnless(self.game.canAct(1)) self.failUnless(self.game.callNraise(1, 100)) # Player 2 bet is less than the highest bet self.failUnless(self.game.canAct(2)) self.failIf(self.game.canCheck(2)) self.failIf(self.game.check(2)) # Player 2 can now check player2.bet = 100 self.failUnless(self.game.canCheck(2)) self.failIf(player2.talked_once) # Player 2 check self.failUnless(self.game.check(2)) # Second round self.failUnless(self.game.isSecondRound()) # --------------------------------------------------------- def testCanFold(self): """Test Poker Game : Can fold""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player can not fold self.failIf(self.game.canFold(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # The player can now fold self.failUnless(self.game.canFold(1)) # The player 2 is not in game so he can not fold player2.all_in = True self.failIf(self.game.isInGame(2)) self.failIf(self.game.canFold(2)) # --------------------------------------------------------- def testFold(self): """Test Poker Game : Fold""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Player can not fold self.failIf(self.game.fold(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Player 1 not in position self.failIf(self.game.canAct(1)) self.failIf(self.game.fold(1)) # Deal cards self.game.dealCards() # Player 1 raise self.failUnless(self.game.callNraise(1, 100)) # Player 2 already fold, the fold function has no effect player2.fold = True self.failUnless(self.game.canAct(2)) self.failUnless(self.game.fold(2)) self.failUnless(self.game.canAct(2)) # Player 2 fold player2.fold = False player2.bet = 300 self.failIf(player2.isFold()) self.failUnless(self.game.canAct(2)) self.failUnless(self.game.fold(2)) self.failUnless(player2.isFold()) self.failUnlessEqual(player2.bet, 0) self.failUnlessEqual(self.game.pot, 300) # Player 3 can act self.failUnless(self.game.canAct(3)) # --------------------------------------------------------- def testCanRaise(self): """Test Poker Game : Can raise""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.canRaise(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # The player can now raise self.failUnless(self.game.canRaise(1)) self.game.round_cap_left = 0 self.failIf(self.game.canRaise(1)) self.game.round_cap_left = sys.maxint player1.bet = 1000 player1.money = 600 self.failUnless(self.game.canRaise(2)) player1.talked_once = False self.failUnless(self.game.canRaise(1)) player1.talked_once = True self.failIf(self.game.canRaise(1)) player1.bet = player2.money + 1000 self.failIf(self.game.canRaise(2)) player2.bet = 1600 player2.money = 0 self.failIf(self.game.canRaise(2)) # --------------------------------------------------------- def testCallNRaise(self): """Test Poker Game : Call N raise""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3 ,7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.canAct(1)) self.failIf(self.game.callNraise(1, 100)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # The card are not dealt so the players can not act self.failIf(self.game.canAct(1)) self.failIf(self.game.callNraise(1, 100)) # Deal cards self.game.dealCards() if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/variants/round', None, {'min' : '100', 'max' : '300'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnlessEqual(self.game.betLimits(1), (100, 300 , 0)) self.failUnless(self.game.callNraise(1, 50)) self.failUnlessEqual(player1.bet, 100) self.failUnlessEqual(self.game.betLimits(2), (200, 400 , 100)) self.failUnless(self.game.canAct(2)) self.failUnless(self.game.callNraise(2, 500)) self.failUnlessEqual(player2.bet, 400) self.failUnless(self.game.canAct(3)) self.game.round_cap_left = 0 self.failIf(self.game.callNraise(3, 100)) self.game.round_cap_left = -1 self.failIf(self.game.callNraise(3, 100)) # --------------------------------------------------------- def testCanAct(self): """Test Poker Game : Can act""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # It the blind and ante turn so the player can act self.failUnless(self.game.canAct(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Can not act because the cards are not dealt self.failIf(self.game.cardsDealt()) self.failIf(self.game.canAct(1)) # Deal cards self.game.dealCards() # The cards are now dealt so the player 1 can act self.failUnless(self.game.cardsDealt()) self.failUnless(self.game.canAct(1)) # The player 2 can not act because it is not its turn self.failIfEqual(self.game.getSerialInPosition(), 2) self.failIf(self.game.canAct(2)) self.game.callNraise(1, 1000) # The player 2 can now play self.failUnlessEqual(self.game.getSerialInPosition(), 2) #self.game.setPosition(1) self.failUnless(self.game.canAct(2)) # --------------------------------------------------------- def testWillAct(self): """Test Poker Game : Will act""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # The game is not running self.failIf(self.game.isRunning()) self.failIf(self.game.willAct(1)) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() self.failUnless(self.game.isRunning()) # The player 1 can not call self.failIf(self.game.canCall(1)) self.failUnless(self.game.willAct(1)) # The player 1 raise self.game.callNraise(1, 100) # The player 2 can call and will act self.failUnless(self.game.canCall(2)) self.failIf(player2.talked_once) self.failUnless(self.game.willAct(2)) # The player 2 call self.game.callNraise(2, 200) # The player 2 has talked so he won't act self.failUnless(player2.talked_once) self.failIf(self.game.willAct(2)) # --------------------------------------------------------- def testPossibleActions(self): """Test Poker Game : Possible actions""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # It is the blind and ante turn so there is no possible action self.failUnless(self.game.canAct(1)) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(self.game.possibleActions(1), []) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() # The player 1 can raise or check self.failUnless(self.game.canAct(1)) self.failUnlessEqual(self.game.possibleActions(1), ['raise', 'check']) # The player 2 can not do anything because it is not its turn self.failUnlessEqual(self.game.possibleActions(2), []) # The player 1 raise 1000 self.game.callNraise(1, 1000) # The player 2 can now call, raise or fold self.failUnlessEqual(self.game.possibleActions(2), ['call', 'raise', 'fold']) # The player 2 can not raise because he has not enough money player1.bet = 1800 self.failUnlessEqual(self.game.possibleActions(2), ['call', 'fold']) # --------------------------------------------------------- def testBetsNull(self): """Test Poker Game : Bets null""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Game is not running self.failIf(self.game.betsNull()) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Game is running self.failUnless(self.game.betsNull()) # The player 1 has bet player1.bet = 1000 self.failIf(self.game.betsNull()) # Th eplayer 1 is fold player1.fold =True self.failUnless(self.game.betsNull()) # --------------------------------------------------------- def testRoundCap(self): """Test Poker Game : Round cap""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Round cap is 0 because the game is not running self.failIf(self.game.isRunning()) self.failUnlessEqual(self.game.roundCap(), 0) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # The game is running self.failUnless(self.game.isRunning()) # First round cap initially equal to 3 self.failUnlessEqual(self.game.roundCap(), 3) # Change the cap of the first level if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/variants/round[@name="pre-flop"]', None, {'cap' : '20'}): self.fail('Error during modification of variant file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # First round cap equal to 20 self.failUnlessEqual(self.game.roundCap(), 20) # --------------------------------------------------------- def testBetLimits(self): """Test Poker Game : Bet limits""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # The game is not running self.failUnlessEqual(self.game.betLimits(1), 0) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # No limit set in the configuration file player1.bet = 1000 self.failUnlessEqual(self.game.betLimits(2), (1000, 1600 , 1000)) # MIN and MAX limits # Change the bet infos if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/variants/round', None, {'min' : '100', 'max' : '300'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Check the bet limits self.failUnlessEqual(self.game.betLimits(2), (1100, 1300 , 1000)) # MIN and POT limits if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/variants/round', None, {'min' : 'big', 'max' : 'pot'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Check the bet limts player1.bet = 400 self.failUnlessEqual(self.game.betLimits(2), (1400, 1400, 400)) # POW LEVEL limits # Change the bet infos if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/variants/round', None, {'pow_level' : '100'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Check the bet limits for level 0 self.failUnlessEqual(self.game.getLevel(), 0) self.failUnlessEqual(self.game.betLimits(2), (400 + 100 * math.pow(2,-1), 400 + 100 * math.pow(2,-1), 400)) # FIXED limits # Change the bet infos if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/variants/round', None, {'fixed' : '100'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Check the bet limits self.failUnlessEqual(self.game.betLimits(2), (500, 500, 400)) # ROUND CAP LEFT 0 self.game.round_cap_left = 0 # Check the bet limits self.failUnlessEqual(self.game.betLimits(2), (0, 0, 400)) # --------------------------------------------------------- def testBestHand(self): """Test Poker Game : Best hand""" player1 = self.AddPlayerAndSit(1, 2) player1.hand = pokercards.PokerCards(['Ad', 'As', 'Ah', '3s']) self.game.board = pokercards.PokerCards(['9d', '6s', 'Td', '4d', '4h']) self.failUnless(self.game.isHigh()) self.game.variant = 'holdem' bestHand = pokercards.PokerCards(['Ad', 'Ah', 'As', '4d', '4h']) hand = self.game.bestHand('hi', 1) self.failUnlessEqual(pokercards.PokerCards(hand[1][1:]), bestHand) self.failUnlessEqual(self.game.readablePlayerBestHand('hi', 1), 'Aces full of Fours: As, Ad, Ah, 4d, 4h') self.game.variant = 'omaha' bestHand = pokercards.PokerCards(['Ad', 'Ah', '4d', '4h', 'Td']) hand = self.game.bestHand('hi', 1) self.failUnlessEqual(pokercards.PokerCards(hand[1][1:]), bestHand) self.failUnlessEqual(self.game.readablePlayerBestHand('hi', 1), 'Two pairs Aces and Fours, Ten kicker: Ad, Ah, 4d, 4h, Td') value, cards = self.game.bestHand('hi', 1) self.failUnlessEqual(self.game.bestHandValue('hi', 1), value) self.failUnlessEqual(self.game.bestHandCards('hi', 1), cards) # --------------------------------------------------------- def testBestHands(self): """Test Poker Game : Best hands""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Players and board cards player1.hand = pokercards.PokerCards(['Ad', 'As', 'Ah', '3s']) player2.hand = pokercards.PokerCards(['Jh', '5c', '7d', '2d']) self.game.board = pokercards.PokerCards(['9d', '6s', 'Td', '4d', '4h']) # Best hands bestHand1 = pokercards.PokerCards(['Ad', 'Ah', 'As', '4d', '4h']) bestHand2 = pokercards.PokerCards(['7d', '2d', '9d', 'Td', '4d']) self.game.variant = 'holdem' self.failUnless(self.game.isHigh()) # Check best hands results = self.game.bestHands([1, 2]) # Player 1 hand self.failUnless(results.has_key(1)) self.failUnless(results[1].has_key('hi')) self.failUnlessEqual(pokercards.PokerCards(results[1]['hi'][1][1:]), bestHand1) self.failUnlessEqual(self.game.readablePlayerBestHands(1), 'Aces full of Fours: As, Ad, Ah, 4d, 4h') # Player 2 hand self.failUnless(results.has_key(2)) self.failUnless(results[2].has_key('hi')) self.failUnlessEqual(pokercards.PokerCards(results[2]['hi'][1][1:]), bestHand2) self.failUnlessEqual(self.game.readablePlayerBestHands(2), 'Flush Ten high: Td, 9d, 7d, 4d, 2d') # Then hand with a NOCARD can not be evaluate player1.hand = pokercards.PokerCards(['Jh', '5c', '7d', pokercards.PokerCards.NOCARD]) results = self.game.bestHands([1]) self.failUnlessEqual(len(results), 0) # --------------------------------------------------------- def testBestHandsHoldemFlopStreet(self): """Test Poker Game : Best hands, holdem viariant, flop street""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Players and board cards player1.hand = pokercards.PokerCards(['Ad', 'As']) player2.hand = pokercards.PokerCards(['Jh', '5c']) self.game.board = pokercards.PokerCards(['9d', '6s', 'Td']) self.game.variant = 'holdem' self.failUnless(self.game.isHigh()) # Player 1 hand self.failUnlessEqual(self.game.readablePlayerBestHands(1), 'A pair of Aces, Ten kicker: As, Ad, Td, 9d, 6s') # Player 2 hand self.failUnlessEqual(self.game.readablePlayerBestHands(2), 'High card Jack: Jh, Td, 9d, 6s, 5c') # --------------------------------------------------------- def testReadableHandValue(self): """Test Poker Game : Readable hand value""" self.game.variant = 'holdem' player1 = self.AddPlayerAndSit(1, 2) player1.hand = pokercards.PokerCards(['2h', '5s', '6h', '9s', 'Ks']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'High card King') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'High card King') player1.hand = pokercards.PokerCards(['2h', '2s', '6h', '9s', 'Ks']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Pair of Deuces') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'A pair of Deuces, King kicker') player1.hand = pokercards.PokerCards(['3h', '3s', '6h', '6s', 'Ks']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Pairs of Sixes and Treys') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'Two pairs Sixes and Treys, King kicker') player1.hand = pokercards.PokerCards(['Th', 'Ts', 'Td', '6s', 'Qs']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Trips Tens') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'Three of a kind Tens, Queen kicker') player1.hand = pokercards.PokerCards(['7h', '8s', '9d', 'Ts', 'Js']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Straight Jack high') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'Straight Jack to Seven') player1.hand = pokercards.PokerCards(['2s', '5s', '6s', '9s', 'Ks']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Flush King high') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'Flush King high') player1.hand = pokercards.PokerCards(['Qh', 'Qs', 'Qc', 'Ts', 'Td']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Queens full of Tens') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'Queens full of Tens') player1.hand = pokercards.PokerCards(['6h', '6s', '6d', '6c', 'Qs']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Quads Sixes, Queen kicker') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'Four of a kind Sixes, Queen kicker') player1.hand = pokercards.PokerCards(['7h', '8h', '9h', 'Th', 'Jh']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Straight flush') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'Straight flush Jack high') player1.hand = pokercards.PokerCards(['Ts', 'Js', 'Qs', 'Ks', 'As']) cards = self.game.bestHandCards('hi', 1) self.failUnlessEqual(self.game.readableHandValueShort('hi', cards[0], cards[1:]), 'Royal flush') self.failUnlessEqual(self.game.readableHandValueLong('hi', cards[0], cards[1:]), 'Royal flush') player1.hand = pokercards.PokerCards(['Ac', '2s', '3h', '4d', '5s']) cards = self.game.bestHandCards('low', 1) self.failUnlessEqual(self.game.readableHandValueShort('low', cards[0], cards[1:]), 'The wheel') self.failUnlessEqual(self.game.readableHandValueLong('low', cards[0], cards[1:]), 'The wheel') player1.hand = pokercards.PokerCards(['8h', '2s', '3h', '4d', '5s']) cards = self.game.bestHandCards('low', 1) self.failUnlessEqual(self.game.readableHandValueShort('low', cards[0], cards[1:]), '8, 5, 4, 3, 2') self.failUnlessEqual(self.game.readableHandValueLong('low', cards[0], cards[1:]), '8, 5, 4, 3, 2') # Unknown values self.failUnlessEqual(self.game.readableHandValueShort('low', 'Unknown', cards[1:]), 'Unknown') self.failUnlessEqual(self.game.readableHandValueLong('low', 'Unknown', cards[1:]), 'Unknown') # --------------------------------------------------------- def testHandEV(self): """Test Poker Game : Hand eval""" self.game.variant = 'holdem' # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) player1.hand = pokercards.PokerCards(['Ad', 'As']) self.failUnless(self.game.handEV(1, 10000) in range(830,870)) player1.hand = pokercards.PokerCards(['2c', '7s']) self.failUnless(self.game.handEV(1, 10000) in range(330,370)) self.game.board = pokercards.PokerCards(['2c', '3c', '4s']) self.failUnless(self.game.handEV(1, 10000) in range(430,470)) player2.hand = pokercards.PokerCards(['4h', '5c']) self.failUnless(self.game.handEV(1, 10000, True) in range(430,470)) self.failUnless(self.game.handEV(1, 10000) in range(100, 140)) self.failUnless(self.game.handEV(2, 10000, True) in range(690, 730)) self.failUnless(self.game.handEV(2, 10000) in range(860, 900)) self.failUnlessEqual(self.game.handEV(3, 10000), None) # --------------------------------------------------------- def testMoneyMap(self): """Test Poker Game : Money map""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) player1.money = 1500 player2.money = 600 self.failUnlessEqual(self.game.moneyMap(), { 1 : 1500, 2 : 600}) player2.fold = True self.failUnlessEqual(self.game.moneyMap(), { 1 : 1500}) # --------------------------------------------------------- def testHasLevel(self): """Test Poker Game : Has level""" self.failIf(self.game.hasLevel()) # Change the blind properties blind_properties = { 'change' : 'double', 'frequency' : '15', 'unit' : 'minute', 'small' : '2000', 'big' : '4000' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnless(self.game.hasLevel()) if not self.CopyFile(self.ConfigTmplFile, self.ConfigTempFile): self.fail('Error during creation of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failIf(self.game.hasLevel()) # Change the ante properties ante_properties = { 'change' : 'double', 'frequency' : '15', 'unit' : 'minute', 'value' : '50', 'bring-in' : '200' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnless(self.game.hasLevel()) # --------------------------------------------------------- def testLevelUp(self): """Test Poker Game : Level up""" # The blind properties self.failIf(self.game.delayToLevelUp()) # Change the blind properties blind_properties = { 'change' : 'levels', 'levels' : PokerGameTestCase.TestLevelsTemplateFile, 'frequency' : '3', 'unit' : 'minute', } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failUnless(self.game.hasLevel()) # Level 0 self.game.setLevel(0) self.failUnless(self.game.delayToLevelUp(), (0, 'minute')) # Level 1 self.game.setLevel(1) # The level is not finished self.failIf(self.game.levelUp()) # 3 minutes to wait is a little bit long so this test is not active # time.sleep(3 * 60) # self.failUnless(self.game.levelUp()) # Change the blind properties blind_properties = { 'change' : 'levels', 'levels' : PokerGameTestCase.TestLevelsTemplateFile, 'frequency' : '3', 'unit' : 'hand', } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Level 0 self.game.setLevel(0) self.failUnless(self.game.delayToLevelUp(), (0, 'hand')) # Level 1 self.game.setLevel(1) self.game.setHandsCount(2) self.failUnless(self.game.delayToLevelUp(), (5, 'hand')) self.failIf(self.game.levelUp()) # Change the blind properties blind_properties = { 'change' : 'levels', 'levels' : PokerGameTestCase.TestLevelsTemplateFile, 'frequency' : '3', 'unit' : 'Invalid', } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.failIf(self.game.delayToLevelUp()) # The game is not directing self.game.is_directing = False self.failIf(self.game.levelUp()) # --------------------------------------------------------- def testCardsDealt(self): """Test Poker Game : Cards dealt""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnless(self.game.cardsDealt()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) self.failIf(self.game.cardsDealt()) self.failUnlessEqual(self.game.roundInfo()["hand_size"], 2) self.failUnlessEqual(self.game.roundInfo()["board_size"], 0) player1.hand = pokercards.PokerCards(['Ad', 'As']) player2.hand = pokercards.PokerCards(['4d', 'Ts']) self.failUnless(self.game.cardsDealt()) # Second round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isSecondRound()) self.failIf(self.game.cardsDealt()) self.failUnlessEqual(self.game.roundInfo()["hand_size"], 2) self.failUnlessEqual(self.game.roundInfo()["board_size"], 3) self.game.board = pokercards.PokerCards(['Qd', 'Kh', '8c']) self.failUnless(self.game.cardsDealt()) # --------------------------------------------------------- def testBet2Pot(self): """Test Poker Game : Bet to pot""" self.game.registerCallback(Callback) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) InitCallback() player1.bet = 500 self.game.bet2pot(serial = 1, dead_money = True) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(player1.dead, 500) self.failUnlessEqual(self.game.pot, 500) self.failUnlessEqual(CallbackIds, [self.game.id]) self.failUnlessEqual(CallbackArgs, [('bet2pot', 1, 500)]) # --------------------------------------------------------- def testDealCards(self): """Test Poker Game : Deal cards""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Client game, the deal card has no effect self.failIf(self.game.cardsDealt()) self.game.is_directing = False # Deal cards self.game.dealCards() self.failIf(self.game.cardsDealt()) self.game.is_directing = True # Deal the cards self.failIf(self.game.cardsDealt()) # Deal cards self.game.dealCards() self.failUnless(self.game.cardsDealt()) # The cards are hidden self.failUnless(player1.hand.areHidden()) self.failUnless(player2.hand.areHidden()) # Check the players cards player1_cards = pokercards.PokerCards(['8s', 'As']) player2_cards = pokercards.PokerCards(['3h', '6d']) player1_cards.allHidden() player2_cards.allHidden() self.failUnlessEqual(player1.hand, player1_cards) self.failUnlessEqual(player2.hand, player2_cards) # Second round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isSecondRound()) # Deal cards self.game.dealCards() # Check the board cards self.failUnlessEqual(self.game.board, pokercards.PokerCards(['6s', '6h', 'Ah'])) # Next round self.game.nextRound() self.game.initRound() # There is not enough cards in the deck for all the players info = self.game.roundInfo() info['board'] = ['board', 'board'] info["board_size"] = 2 info['cards'] = ['up', 'down'] info["hand_size"] = 2 self.game.deck = ['8d', '2h', '2c', '8c'] # Deal cards self.game.dealCards() # The player cards are transfered to the board self.failUnlessEqual(info["hand_size"], 0) self.failUnlessEqual(info["board_size"], 4) # Can not deal all the cards needed info = self.game.roundInfo() info['board'] = ['board', 'board'] info["board_size"] = 2 info['cards'] = ['up', 'unknown', 'down'] info["hand_size"] = 3 self.game.deck = ['8d', '2h', '2c', '8c'] self.failUnlessRaises(UserWarning,self.game.dealCards) # --------------------------------------------------------- def testBotAutoPlay(self): """Test Poker Game : Bot auto play""" # Change the bet properties if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/variants/round', None, {'min' : '100', 'max' : '300'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Change the variant name for cards evaluation self.game.variant = 'holdem' # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # No possible action because the cards are not dealt self.failUnlessEqual(self.game.possibleActions(1), []) self.game.botPlayer(1) self.failIf(player1.talked_once) # Deal cards self.game.dealCards() # Player 1 is a bot self.failUnlessEqual(self.game.possibleActions(1), ['raise', 'check']) self.game.botPlayer(1) self.failUnless(player1.isBot()) self.failUnless(player1.isAutoBlindAnte()) self.failUnlessEqual(player1.auto_muck, pokergame.AUTO_MUCK_ALWAYS) self.failUnless(player1.isAuto()) # Player 1 automatically bet the minimum self.failUnlessEqual(player1.bet, 100) self.failUnlessEqual(player1.money, 1500) self.failUnless(player1.talked_once) # Player 2 automatically call self.game.botPlayer(2) # The game is finished self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_END) # --------------------------------------------------------- def testGetRequestedAction(self): """Test Poker Game : Get requested action""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 2 is in position self.failUnlessEqual(self.game.getSerialInPosition(), 2) self.failUnlessEqual(self.game.getRequestedAction(1), None) self.failUnlessEqual(self.game.getRequestedAction(2), 'blind_ante') # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Player 2 is in position self.failUnlessEqual(self.game.getSerialInPosition(), 2) self.failUnlessEqual(self.game.getRequestedAction(2), 'play') # Add a third player self.failUnless(self.game.addPlayer(3)) player3 = self.GetPlayer(3) # The buy in is not payed self.failIf(player3.isBuyInPayed()) self.failUnlessEqual(self.game.getRequestedAction(3), 'buy-in') # Pay the buy in self.failUnless(self.game.payBuyIn(3,self.game.bestBuyIn())) self.failUnlessEqual(self.game.getRequestedAction(3), None) # Player 3 has no money player3.money = 0 self.failUnlessEqual(self.game.getRequestedAction(3), 'rebuy') # Change the blind properties blind_properties = { 'change' : 'levels', 'levels' : PokerGameTestCase.TestLevelsTemplateFile, 'frequency' : '15', 'unit' : 'minute' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # The game is now a tournament self.failUnless(self.game.isTournament()) # The player 1 and 3 are not in position self.failUnlessEqual(self.game.getRequestedAction(3), None) self.failUnlessEqual(self.game.getRequestedAction(1), None) # The player 2 is in position self.failUnlessEqual(self.game.getRequestedAction(2), 'play') # --------------------------------------------------------- def testTalked(self): """Test Poker Game : Talked""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.call(1)) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() # Player 1 can talk self.failUnless(self.game.isInPosition(1)) self.failUnless(self.game.canAct(1)) self.failIf(player1.talked_once) self.failUnless(self.game.callNraise(1, 600)) self.failUnlessEqual(player1.bet, 600) self.failUnlessEqual(self.game.getPlayerMoney(1), 1000) self.failUnless(player1.talked_once) # Player 2 can talk self.failUnless(self.game.isInPosition(2)) self.failUnless(self.game.canAct(2)) self.failIf(player2.talked_once) self.failUnless(self.game.call(2)) self.failUnlessEqual(self.game.getPlayerMoney(2), 1000) # Second round self.failUnless(self.game.isSecondRound()) # --------------------------------------------------------- def testTalkedClientGame(self): """Test Poker Game : Talked Client game""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.call(1)) # Automatically pay the blind self.game.autoBlindAnte(1) self.game.autoBlindAnte(2) # First round self.failUnless(self.game.isFirstRound()) # Client game self.game.is_directing = False # player 1 raise self.failUnless(self.game.callNraise(1, 600)) # Player 2 call self.failUnless(self.game.call(2)) # Init round is not done # The players are mot reset self.failUnless(player1.talked_once) self.failUnless(player2.talked_once) # --------------------------------------------------------- def testBlindInfo(self): """Test Poker Game : Blind info""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Blind info has been set self.failUnless(self.game.blind_info) # Check the blind values self.failUnlessEqual(self.game.bigBlind(), 1000) self.failUnlessEqual(self.game.smallBlind(), 500) # Check blind amounts self.game.setPlayerBlind(1, 'big') self.failUnlessEqual(self.game.blindAmount(1), (self.game.bigBlind(), 0, 'big')) self.game.setPlayerBlind(1, 'late') self.failUnlessEqual(self.game.blindAmount(1), (self.game.bigBlind(), 0, 'late')) self.game.setPlayerBlind(1, 'small') self.failUnlessEqual(self.game.blindAmount(1), (self.game.smallBlind(), 0, 'small')) self.game.setPlayerBlind(1, 'big_and_dead') self.failUnlessEqual(self.game.blindAmount(1), (self.game.bigBlind(), self.game.smallBlind(), 'big_and_dead')) self.game.setPlayerBlind(1, None) self.failUnlessEqual(self.game.blindAmount(1), (0, 0, None)) self.game.setPlayerBlind(1, True) self.failUnlessEqual(self.game.blindAmount(1), (0, 0, True)) self.game.setPlayerBlind(1, 'invalid') self.failUnlessEqual(self.game.blindAmount(1), None) # Unset the blind infos self.game.blind_info = None self.failUnlessEqual(self.game.bigBlind(), None) self.failUnlessEqual(self.game.smallBlind(), None) self.failUnlessEqual(self.game.blindAmount(1), (0, 0, False)) # --------------------------------------------------------- def testSitOutNextTurn(self): """Test Poker Game : Sit out next turn""" self.game.setMaxPlayers(3) # Create all the players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 2 is in position self.failUnlessEqual(self.game.getSerialInPosition(), 2) # The player 2 sit out next turn self.failIf(self.game.isSitOut(2)) self.failUnless(self.game.sitOutNextTurn(2)) self.failUnless(player2.isSitOut()) self.failIf(player2.sit_out_next_turn) self.failIf(player2.sit_requested) self.failIf(player2.wait_for) # The player 1 is not in position but he want to sit out self.failIfEqual(self.game.getSerialInPosition(), 1) self.failIf(player1.sit_out_next_turn) self.failIf(player1.sit_requested) self.failIf(self.game.sitOutNextTurn(1)) self.failUnless(player1.sit_out_next_turn) self.failIf(player1.sit_requested) # Client game self.game.is_directing = False # Player 3 sit out self.failUnlessEqual(self.game.getSerialInPosition(), 3) self.failIf(player3.sit_out_next_turn) self.failIf(player3.sit_requested) self.failIf(self.game.sitOutNextTurn(3)) self.failUnless(player3.sit_out_next_turn) self.failIf(player3.sit_requested) self.failUnlessEqual(player3.wait_for, False) # --------------------------------------------------------- def testSitOut(self): """Test Poker Game : Sit out""" self.game.setMaxPlayers(4) player1 = self.AddPlayerAndSit(1, 1) player2 = self.AddPlayerAndSit(2, 3) player3 = self.AddPlayerAndSit(3, 6) player4 = self.AddPlayerAndSit(4, 8) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Sit out self.game.setPosition(0) self.failIf(self.game.getSitOut(1)) self.failUnless(self.game.sitOut(1)) self.failUnless(self.game.getSitOut(1)) self.failIf(player1.sit_out_next_turn) self.failIf(player1.sit_requested) self.failIf(player1.wait_for) # the player is already sit out self.failIf(self.game.sitOut(1)) self.game.setPosition(1) self.failUnlessEqual(self.game.getSerialInPosition(), 2) self.game.setPosition(2) self.failIf(self.game.getSitOut(3)) self.failUnless(self.game.sitOut(3)) self.failUnless(self.game.getSitOut(3)) self.failIf(player3.sit_out_next_turn) self.failIf(player3.sit_requested) self.failIf(player3.wait_for) self.failUnlessEqual(self.game.getSerialInPosition(), 4) # # Check that autoPayBlindAnte skips players that are sit out for some reason. # player1.sit_out = True self.game.setPosition(0) self.assertEquals([1, 2, 3, 4], self.game.player_list) self.game.autoPayBlindAnte() # --------------------------------------------------------- def testSit(self): """Test Poker Game : Sit""" self.game.setMaxPlayers(3) # Add Player self.failUnless(self.game.addPlayer(1, 2)) player1 = self.GetPlayer(1) self.failIf(player1.isSit()) # The buy in is not payed, the player can not be added self.failIf(player1.isBuyInPayed()) self.failIf(self.game.sit(1)) # Pay the buy in self.failUnless(self.game.payBuyIn(1,self.game.bestBuyIn())) self.failUnless(player1.isBuyInPayed()) # The player is broke, the player can not be added money = self.game.getPlayerMoney(1) player1.money = 0 self.failUnless(self.game.isBroke(1)) self.failIf(self.game.sit(1)) # Restore the player money player1.money = money self.failIf(self.game.isBroke(1)) # The player can sit player1.wait_for = 'big' self.failUnless(self.game.sit(1)) self.failUnless(player1.isSit()) self.failUnlessEqual(player1.wait_for, False) self.failIf(player1.auto) # Add a second player player2 = self.AddPlayerAndSit(2, 5) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Add the third player self.failUnless(self.game.addPlayer(3, 7)) self.failUnless(self.game.payBuyIn(3,self.game.bestBuyIn())) player3 = self.GetPlayer(3) self.failIf(player3.isSit()) # The player sit self.failUnless(self.game.sit(3)) self.failUnless(player3.isSit()) self.failUnlessEqual(player3.wait_for, 'first_round') # --------------------------------------------------------- def testRebuy(self): """Test Poker Game : Rebuy""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) self.failUnlessEqual(self.game.maxBuyIn(), 10000) # The player 3 is unknown so it can not rebuy self.failIf(self.game.rebuy(3, 100)) # The player money + the rebuy amount is too high player1.money = 5000 self.failIf(self.game.rebuy(1, 5001)) # The player money + the player rebuy + the rebuy amount is too high player1.rebuy = 2000 self.failIf(self.game.rebuy(1, 3001)) # The player 1 rebuy 1000 but the game is not running so the money is added to it rebuy amount self.failIf(self.game.isPlaying(1)) self.failUnless(self.game.rebuy(1, 1000)) self.failUnless(player1.rebuy, 3000) self.failUnless(self.game.getPlayerMoney(1), 5000) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 1 rebuy 1000 and the game is not running so the money is added directly to its money amount self.failUnless(self.game.isPlaying(1)) self.failUnless(self.game.rebuy(1, 1000)) self.failUnless(player1.rebuy, 3000) self.failUnless(self.game.getPlayerMoney(1), 6000) # --------------------------------------------------------- def testFullEmpty(self): """Test Poker Game : Full empty""" # The game must be empty self.failUnless(self.game.empty()) self.failIf(self.game.full()) # Add one player player1 = self.AddPlayerAndSit(1, 2) # The game is not empty and not full self.failIf(self.game.empty()) self.failIf(self.game.full()) # Add the second player, the game is now full player2 = self.AddPlayerAndSit(2, 7) self.failIf(self.game.empty()) self.failUnless(self.game.full()) # --------------------------------------------------------- def testSerialsAllSorted(self): """Test Poker Game : Serials all sorted""" self.game.setMaxPlayers(3) player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # The dealer is not specified or incorrect so get the list of player sorted by serial number self.game.dealer = -1 self.failUnlessEqual(self.game.serialsAllSorted(), [1, 2, 3]) self.game.dealer = 4 self.failUnlessEqual(self.game.serialsAllSorted(), [1, 2, 3]) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(self.game.dealer, 0) self.failUnlessEqual(self.game.serialsAllSorted(), [2, 3, 1]) # Remove the player 1, do not reconstruct the player list del self.game.serial2player[1] self.failUnlessEqual(self.game.serialsAll(), [2, 3]) self.failUnlessEqual(self.game.player_list, [1, 2, 3]) # The dealer can not be the player 2 self.failUnlessEqual(self.game.serialsAllSorted(), [3, 2]) # --------------------------------------------------------- def testBlind(self): """Test Poker Game : Blind""" self.game.setMaxPlayers(3) player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Not Blind or Ante turn self.failIf(self.game.isBlindAnteRound()) self.failIf(self.game.blind(1)) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 1 can not act so it can not blind self.failIf(self.game.canAct(1)) self.failIf(self.game.isBlindRequested(1)) self.failIf(self.game.blind(1)) # Get the blind limits for player 2 self.game.setPlayerBlind(2, 'big_and_dead') self.failUnlessEqual(self.game.blindAmount(2), (1000, 500, 'big_and_dead')) # The player 2 can blind, use the defined limits self.failUnless(self.game.isBlindRequested(2)) self.game.blind(2) self.failUnlessEqual(player2.bet, 1000) self.failUnlessEqual(self.game.pot, 500) self.failUnlessEqual(self.game.getPlayerMoney(2), 100) # The player 2 has blind self.failUnless(player2.blind) self.failUnlessEqual(player2.missed_blind, None) self.failIf(player2.wait_for) # The player 3 can blind, bet 400 and 200 for the dead self.failUnless(self.game.isBlindRequested(3)) self.game.blind(3, 400, 200) self.failUnlessEqual(player3.bet, 400) self.failUnlessEqual(self.game.pot, 500 + 200) self.failUnlessEqual(player3.money, 1000) # Blind structure unknown self.game.blind_info = None # The blind has not effect self.failIf(self.game.isBlindRequested(1)) self.game.blind(1, 400, 200) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(self.game.pot, 500 + 200) self.failUnlessEqual(self.game.getPlayerMoney(1), 1600) # --------------------------------------------------------- def testBlindAnteRoundEnd(self): """Test Poker Game : Blind and ante round end""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # No effect for server game self.game.blindAnteRoundEnd() self.failUnless(self.game.isBlindAnteRound()) # Client game self.game.is_directing = False # First Round self.game.blindAnteRoundEnd() self.failUnless(self.game.isFirstRound()) # Blind and ante round self.game.resetRound() self.game.initBlindAnte() self.failUnless(self.game.isBlindAnteRound()) # Player 1 is all in self.game.payBlind(1, 1600, 0) self.failUnlessEqual(player1.bet, 1600) self.failUnlessEqual(self.game.getPlayerMoney(1), 0) self.failUnless(player1.isAllIn()) self.failIf(self.game.isInGame(1)) self.game.payBlind(2, 1600, 0) # All the players are all in except one self.game.blindAnteRoundEnd() self.failUnlessEqual(self.game.pot, 3200) # First Round self.failUnless(self.game.isFirstRound()) # --------------------------------------------------------- def testPayBlind(self): """Test Poker Game : Pay blind""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.isBlindAntePayed()) # The player 1 pay blind self.game.payBlind(1, 600, 200) self.failUnlessEqual(player1.bet, 600) self.failUnlessEqual(self.game.pot, 200) self.failUnlessEqual(self.game.getPlayerMoney(1), 800) self.failUnless(player1.blind) self.failUnlessEqual(player1.missed_blind, None) self.failIf(player1.wait_for) # All blinds are not payed self.failIf(self.game.isBlindAntePayed()) # The blind is higher than the player money self.game.payBlind(2, 2000, 100) self.failUnlessEqual(player2.bet, 1600) self.failUnlessEqual(self.game.pot, 200 + 0) self.failUnlessEqual(self.game.getPlayerMoney(2), 0) self.failUnless(player2.blind) self.failUnlessEqual(player2.missed_blind, None) self.failIf(player2.wait_for) # All blinds are not payed self.failIf(self.game.isBlindAntePayed()) # The blind + the dead is higher than the player money self.game.payBlind(3, 1000, 1000) self.failUnlessEqual(player3.bet, 1000) self.failUnlessEqual(self.game.pot, 200 + 0 + 600) self.failUnlessEqual(player3.money, 0) self.failUnless(player3.blind) self.failUnlessEqual(player3.missed_blind, None) self.failIf(player3.wait_for) # All blinds are now payed self.failUnless(self.game.isBlindAntePayed()) # --------------------------------------------------------- def testWaitBigBlind(self): """Test Poker Game : Wait big blind""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 2 can not act self.failIf(self.game.canAct(2)) self.failIf(self.game.waitBigBlind(2)) # No blind info blind_info = self.game.blind_info self.game.blind_info = None self.failIf(self.game.waitBigBlind(1)) self.failIf(self.game.waitBigBlind(2)) self.game.blind_info = blind_info # The player 1 can act self.failUnless(self.game.canAct(1)) self.failUnless(self.game.waitBigBlind(1)) self.failUnlessEqual(player1.wait_for, 'big') # Player 2 pay the blind self.failUnless(self.game.canAct(2)) self.game.autoBlindAnte(2) self.failUnlessEqual(self.game.getPlayerMoney(2), 600) self.failUnlessEqual(player2.bet, 1000) self.failUnless(player2.isBlind()) # Player 1 pay the blind self.failUnless(self.game.canAct(1)) self.game.autoBlindAnte(1) self.failUnlessEqual(self.game.getPlayerMoney(1), 1100) self.failUnlessEqual(player1.bet, 500) self.failUnless(player1.isBlind()) # Blind and ante turn finished self.failIf(self.game.isBlindAnteRound()) # Waiting big blind is unavalaible self.failIf(self.game.waitBigBlind(1)) self.failIf(self.game.waitBigBlind(2)) # --------------------------------------------------------- def testAnte(self): """Test Poker Game : Ante""" # Change the ante properties ante_properties = { 'value' : '100', 'bring-in' : '200' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.game.setMaxPlayers(3) player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Not Blind or Ante turn self.failIf(self.game.isBlindAnteRound()) self.failIf(self.game.ante(1)) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 1 can not act so it can not ante self.failIf(self.game.canAct(1)) self.failIf(self.game.isAnteRequested(1)) self.failIf(self.game.ante(1)) # Get the ante value self.failUnlessEqual(self.game.ante_info['value'], 100) # The player 2 can ante, use the defined limits self.failUnless(self.game.isAnteRequested(2)) self.game.ante(2) self.failUnlessEqual(player2.bet, 0) self.failUnlessEqual(self.game.pot, 100) self.failUnlessEqual(self.game.getPlayerMoney(2), 1500) # The player 2 has ante self.failUnless(player2.ante) # The player 3 can ante 400 self.failUnless(self.game.isAnteRequested(3)) self.game.ante(3, 400) self.failUnlessEqual(player3.bet, 0) self.failUnlessEqual(self.game.pot, 100 + 400) self.failUnlessEqual(player3.money, 1200) # Ante structure unknown self.game.ante_info = None # The ante has not effect self.failIf(self.game.isAnteRequested(1)) self.game.ante(1, 400) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(self.game.pot, 100 + 400) self.failUnlessEqual(self.game.getPlayerMoney(1), 1600) # --------------------------------------------------------- def testAutoPayBlind(self): """ Test Poker Game : Auto pay blind""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The players are not auto self.failIf(player1.isAutoBlindAnte()) self.failIf(player2.isAutoBlindAnte()) self.failIf(player3.isAutoBlindAnte()) # The auto pay blind has no effect self.failUnlessEqual(self.game.getSerialInPosition(), 2) self.game.autoPayBlindAnte() # The player 2 is still in position self.failUnlessEqual(self.game.getSerialInPosition(), 2) # The turn is still blind and ante self.failUnless(self.game.isBlindAnteRound()) # pay the blind for player 2 player2.auto_blind_ante = True self.game.autoPayBlindAnte() # The player 3 sit out self.failUnless(self.game.sitOut(3)) self.failUnless(player3.isSitOut()) self.failUnlessEqual(self.game.getSerialInPosition(), 1) # pay the blind for player 1 player1.auto_blind_ante = True self.game.autoPayBlindAnte() self.failUnlessEqual(True, player1.isBlind()) # The blind of the player 1 and 2 are automatically payed self.game.autoPayBlindAnte() self.failUnlessEqual(self.game.getPlayerMoney(1), 600) self.failUnlessEqual(player1.bet, 1000) self.failUnless(player1.blind) self.failUnlessEqual(self.game.getPlayerMoney(2), 1100) self.failUnlessEqual(player2.bet, 500) self.failUnless(player2.blind) # First round self.failUnless(self.game.isFirstRound()) # --------------------------------------------------------- def testAutoPayBlindAllIn(self): """ Test Poker Game : Auto pay blind all in""" self.game.variant = 'holdem' # Create players player1 = self.AddPlayerAndSit(1, 2) player1.money = 400 player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The players 1 automatically pay the blind self.game.autoBlindAnte(1) self.failUnlessEqual(self.game.getPlayerMoney(1), 0) self.failUnlessEqual(player1.bet, 400) self.failUnless(player1.blind) # Player 1 is all in self.failUnless(player1.isAllIn()) # The players 2 automatically pay the blind self.game.autoBlindAnte(2) # The game is finished self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_END) # Check the end information self.failUnless(self.game.isGameEndInformationValid()) # The player 1 win self.failUnlessEqual(self.game.winners, [1]) self.failUnlessEqual(player1.money, 400 + ( 400 - self.game.getRakedAmount() )) self.failUnlessEqual(player2.money, 1600 - 400) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(player2.bet, 0) self.failUnlessEqual(self.game.pot, 0) # --------------------------------------------------------- def testAutoPayBlindAllIn2(self): """ Test Poker Game : Auto pay blind all in and a third player is to act""" self.game.variant = 'holdem' # Create players self.game.setMaxPlayers(3) player1 = self.AddPlayerAndSit(1, 2) player1.money = 600 player2 = self.AddPlayerAndSit(2, 5) player2.money = 400 player3 = self.AddPlayerAndSit(3, 7) player3.money = 600 # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The players 2 automatically pay the blind self.game.autoBlindAnte(2) self.failUnlessEqual(self.game.getPlayerMoney(2), 0) self.failUnlessEqual(player2.bet, 400) self.failUnless(player2.blind) # Player 2 is all in self.failUnless(player2.isAllIn()) # The players 3 automatically pay the blind self.game.autoBlindAnte(3) # The players 1 is to act and calls self.failUnless(self.game.canAct(1)) self.failUnless(self.game.call(1)) # The game is finished self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_END) # Check the end information self.failUnless(self.game.isGameEndInformationValid()) # The player 3 win self.failUnlessEqual(self.game.winners, [3]) self.failUnlessEqual(player3.money, 600 + 600 + 400 - self.game.getRakedAmount() ) self.failUnlessEqual(player2.money, 0) self.failUnlessEqual(player1.money, 0) self.failUnlessEqual(self.game.pot, 0) # --------------------------------------------------------- def testAutoPayAnte(self): """ Test Poker Game : Auto pay ante""" # Change the ante properties ante_properties = { 'value' : '100', 'bring-in' : '200' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Reset the blind infos self.game.blind_info = None # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The players are not auto self.failIf(player1.isAutoBlindAnte()) self.failIf(player2.isAutoBlindAnte()) # The auto pay ante has no effect self.failUnlessEqual(self.game.getSerialInPosition(), 1) self.game.autoPayBlindAnte() # The player 2 is still in position self.failUnlessEqual(self.game.getSerialInPosition(), 1) # The turn is still blind and ante self.failUnless(self.game.isBlindAnteRound()) # The antes will be automatically payed player1.auto_blind_ante = True player2.auto_blind_ante = True # The ante of the player 1 and 2 are automatically payed self.game.autoPayBlindAnte() self.failUnlessEqual(self.game.getPlayerMoney(1), 1500) self.failUnlessEqual(player1.bet, 0) self.failUnless(player1.ante) self.failUnlessEqual(self.game.getPlayerMoney(2), 1500) self.failUnlessEqual(player2.bet, 0) self.failUnless(player2.ante) self.failUnlessEqual(self.game.pot, 100 + 100) # The blind and ante turn is finished self.failIf(self.game.isBlindAnteRound()) # --------------------------------------------------------- def testAutoPayAnteAllIn(self): """ Test Poker Game : Auto pay ante all in""" self.game.variant = 'holdem' # Change the ante properties ante_properties = { 'value' : '900', 'bring-in' : '200' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Reset the blind infos self.game.blind_info = None # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The players 1 automatically pay the blind self.game.autoBlindAnte(1) self.failUnlessEqual(self.game.getPlayerMoney(1), 700) self.failUnlessEqual(self.game.pot, 900) self.failUnless(player1.ante) # Player 1 is all in player1.all_in = True self.failUnless(player1.isAllIn()) # The players 2 automatically pay the blind self.game.autoBlindAnte(2) # The game is finished self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_END) # Check the end information self.failUnless(self.game.isGameEndInformationValid()) # The player 1 win self.failUnlessEqual(self.game.winners, [1]) rake = self.game.getRakedAmount() self.failUnlessEqual(int(900 * 0.05), rake) self.failUnlessEqual(player1.money, 1600 + ( 900 - rake )) self.failUnlessEqual(player2.money, 1600 - ( 900 )) self.failUnlessEqual(self.game.pot, 0) # # The rake must be deduced from the delta # showdown_info = self.game.showdown_stack[0] self.failUnlessEqual(900 - rake, showdown_info['serial2delta'][1]) self.failUnlessEqual(-900, showdown_info['serial2delta'][2]) # --------------------------------------------------------- def testPayAnte(self): """Test Poker Game : Pay ante""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) self.game.variant = 'holdem' # Change the ante properties ante_properties = { 'value' : '100', 'bring-in' : '200' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Reset the blind infos self.game.blind_info = None # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failIf(self.game.isBlindAntePayed()) # The player 1 pay ante self.game.payAnte(1, 600) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(self.game.pot, 600) self.failUnlessEqual(self.game.getPlayerMoney(1), 1000) self.failUnless(player1.ante) # All antes are not payed self.failIf(self.game.isBlindAntePayed()) # The ante is higher than the player money self.game.payAnte(2, 2000) self.failUnlessEqual(player2.bet, 0) self.failUnlessEqual(self.game.pot, 600 + 1600) self.failUnlessEqual(self.game.getPlayerMoney(2), 0) self.failUnless(player2.ante) # All antes are not payed self.failIf(self.game.isBlindAntePayed()) # The player 3 is sit out self.game.setPosition(2) self.failUnless(self.game.sitOut(3)) # All antes are now payed self.failUnless(self.game.isBlindAntePayed()) # --------------------------------------------------------- def testMinMoney(self): """Test Poker Game : min money""" # # game with blinds # self.failUnless(self.game.minMoney() > self.game.blind_info["big"]); # # game with antes # # Change the ante properties ante_properties = { 'value' : '100', 'bring-in' : '200' } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet', 'ante', ante_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # Reset the blind infos self.game.blind_info = None self.failUnless(self.game.minMoney() > self.game.ante_info["bring-in"]); # # tournament # self.game.ante_info["change"] = True; self.failUnlessEqual(self.game.minMoney(), 0) # # no blinds, no antes # self.game.blind_info = None self.game.ante_info = None self.failUnlessEqual(self.game.minMoney(), 0) # --------------------------------------------------------- def testIsBroke(self): """Test Poker Game : Is broke""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Unknown players are not broke self.failIf(self.game.isBroke(3)) # No player is broke self.failIf(self.game.isBroke(1)) self.failIf(self.game.isBroke(2)) self.failUnlessEqual(self.game.brokeCount(), 0) # The player 1 is broke, no money player1.money = 0 # One player broke self.failUnless(self.game.isBroke(1)) self.failUnlessEqual(self.game.brokeCount(), 1) self.failUnlessEqual(self.game.serialsBroke(), [1]) self.failUnlessEqual(self.game.playersBroke(), [player1]) # The player 2 is borke, not enough money to play self.failIf(self.game.isTournament()) # Change the blind properties blind_properties = { 'small' : '1000', 'big' : '2000', } if not self.ModifyXMLFile(self.ConfigTempFile, '/bet/blind', None, blind_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) # All the players are broke self.failUnless(self.game.isBroke(2)) self.failUnlessEqual(self.game.brokeCount(), 2) self.failUnlessEqual(self.game.serialsBroke(), [1, 2]) self.failUnlessEqual(self.game.playersBroke(), [player1, player2]) # --------------------------------------------------------- def testAllIn(self): """Test Poker Game : All in""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The players are not initially all in self.failIf(player1.isAllIn()) self.failIf(player2.isAllIn()) self.failUnlessEqual(self.game.allInCount(), 0) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() # The player 1 put all his money self.failUnless(self.game.callNraise(1, self.game.getPlayerMoney(1))) self.failUnless(player1.isAllIn()) self.failUnlessEqual(self.game.allInCount(), 1) self.failUnlessEqual(self.game.serialsAllIn(), [1]) self.failUnlessEqual(self.game.playersAllIn(), [player1]) # --------------------------------------------------------- def testUncalledInvalid(self): """Test Poker Game : uncalled amount does not pass distributeMoney checks""" self.game.setVariant('holdem') # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) player2.money += player1.money uncalled = player2.money # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The players are not initially all in self.failIf(player1.isAllIn()) self.failIf(player2.isAllIn()) self.failUnlessEqual(self.game.allInCount(), 0) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() # The player 1 put all his money self.failUnless(self.game.call(1)) self.failUnless(self.game.callNraise(2, self.game.getPlayerMoney(2))) self.failUnless(player2.isAllIn()) self.failUnlessEqual(self.game.allInCount(), 1) self.failUnlessEqual(self.game.serialsAllIn(), [2]) self.failUnlessEqual(self.game.playersAllIn(), [player2]) self.failUnlessEqual(self.game.uncalled, uncalled) distributeMoney = self.game.distributeMoney def f(): self.game.uncalled = 42 # invalid value distributeMoney() self.game.distributeMoney = f try: self.game.call(1) except UserWarning, arg: self.failUnlessEqual(str(arg), "serial2side_pot[winner.serial] != self.uncalled (1600 != 42)") # --------------------------------------------------------- def testRakeContributions(self): """Test Poker Game : rake contributions""" self.game.setVariant('holdem') # Create players self.game.setMaxPlayers(3) for i in xrange(1, 4): self.AddPlayerAndSit(i) self.game.botPlayer(i) self.game.beginTurn(1) self.failIf(self.game.isRunning()) self.failUnlessEqual(150, self.game.getRakedAmount()) self.failUnlessEqual(3000, self.game.getPotAmount()) self.failUnlessEqual({1: 50, 2: 50, 3: 50}, self.game.getRakeContributions()) # --------------------------------------------------------- def testRakeContributionsUncalled(self): """Test Poker Game : rake contributions uncalled""" self.game.setVariant('holdem') # Create players self.game.setMaxPlayers(3) for i in xrange(1, 4): player = self.AddPlayerAndSit(i) self.game.botPlayer(i) player.money = 100 player.money = 3000 self.game.beginTurn(1) self.failIf(self.game.isRunning()) self.failUnlessEqual(15, self.game.getRakedAmount()) self.failUnlessEqual(700, self.game.getPotAmount()) self.failUnlessEqual({1: 5, 2: 5, 3: 5}, self.game.getRakeContributions()) # --------------------------------------------------------- def testDisconnected(self): """Test Poker Game : Diconnected""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player are initially connected self.failIf(player1.remove_next_turn) self.failIf(player2.remove_next_turn) self.failUnlessEqual(self.game.disconnectedCount(), 0) self.failUnlessEqual(self.game.connectedCount(), 2) self.failUnlessEqual(self.game.serialsDisconnected(), []) self.failUnlessEqual(self.game.serialsConnected(), [1, 2]) self.failUnlessEqual(self.game.playersDisconnected(), []) self.failUnlessEqual(self.game.playersConnected(), [player1, player2]) # Remove the player 1 self.failIf(self.game.removePlayer(1)) self.failUnless(player1.remove_next_turn) # The player 1 is now disconnected self.failUnlessEqual(self.game.disconnectedCount(), 1) self.failUnlessEqual(self.game.connectedCount(), 1) self.failUnlessEqual(self.game.serialsDisconnected(), [1]) self.failUnlessEqual(self.game.serialsConnected(), [2]) self.failUnlessEqual(self.game.playersDisconnected(), [player1]) self.failUnlessEqual(self.game.playersConnected(), [player2]) # --------------------------------------------------------- def testReturnBlindAnte(self): """Test Poker Game : Return blind ante""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 1 blind self.game.setPlayerBlind(1, 'big') self.game.blind(1) self.failUnlessEqual(player1.bet, 1000) self.failUnlessEqual(self.game.getPlayerMoney(1), 600) # The player 2 sit out so the game is canceled self.game.sitOut(2) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(self.game.getPlayerMoney(1), 1600) # The game is finished, there is no winners self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_END) self.failUnlessEqual(len(self.game.winners), 0) # No winner, the end information are not valid self.failIf(self.game.isGameEndInformationValid()) # --------------------------------------------------------- def testCanceled(self): """Test Poker Game : Canceled""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 1 blind self.game.autoBlindAnte(1) self.failUnlessEqual(player1.bet, 500) self.failUnlessEqual(self.game.getPlayerMoney(1), 1100) # There is more than one player sit, cancel is not available self.failIfEqual(self.game.sitCount(), 1) self.game.canceled(1, 500) self.failUnlessEqual(self.game.getPlayerMoney(1), 1100) # The player 2 sit out self.failUnless(self.game.sitOut(2)) self.failUnlessEqual(self.game.sitCount(), 1) # Cancel is not available in the current state self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_END) self.game.canceled(1, 500) self.failUnlessEqual(self.game.getPlayerMoney(1), 1100) # Change the game round to blind and ante self.game.resetRound() self.failUnless(self.game.isBlindAnteRound()) # The pot value does not correspond to the player bet self.game.pot = 100 self.game.canceled(1, 500) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(self.game.getPlayerMoney(1), 1100) # Change the game round to blind and ante self.game.resetRound() self.failUnless(self.game.isBlindAnteRound()) # The game is explicitely canceled self.game.pot = 500 self.game.canceled(1, 500) self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(self.game.getPlayerMoney(1), 1600) # The game is finished, there is no winners self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_END) self.failUnlessEqual(len(self.game.winners), 0) # No winner, the end information are not valid self.failIf(self.game.isGameEndInformationValid()) # --------------------------------------------------------- def testNoAutoPlayer(self): """Test Poker Game : No auto player""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # The player 1 is an automatic player player1.auto = True # The player 1 is not an automatic player self.failUnless(self.game.noAutoPlayer(1)) self.failIf(player1.auto) # Invalid player self.failIf(self.game.noAutoPlayer(3)) # --------------------------------------------------------- def testAutoPlayer(self): """Test Poker Game : Auto player""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # The player 1 is set an automatic player self.game.autoPlayer(1) self.failUnless(player1.auto) # The player 1 sit out because he is not a bot self.game.interactivePlayer(1) self.game.autoPlayer(1) # The blind is automatically payed because the player 2 is a bot self.game.botPlayer(2) self.game.autoPlayer(2) self.failUnlessEqual(player2.blind, True) # Client game self.game.is_directing = False # AutoPlayer has no effect self.game.botPlayer(3) self.game.autoPlayer(3) self.failIfEqual(player3.blind, True) # --------------------------------------------------------- def testPlayersPlaying(self): """Test Poker Game : Players playing""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # The game is not running so there is no playing players self.failUnlessEqual(self.game.playingCount(), 0) self.failUnlessEqual(self.game.serialsPlaying(), []) self.failUnlessEqual(self.game.playersPlaying(), []) self.failUnlessEqual(self.game.notPlayingCount(), 2) self.failUnlessEqual(self.game.serialsNotPlaying(), [1, 2]) self.failUnlessEqual(self.game.playersNotPlaying(), [player1, player2]) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # All the players are now playing self.failUnlessEqual(self.game.playingCount(), 2) self.failUnlessEqual(self.game.serialsPlaying(), [1, 2]) self.failUnlessEqual(self.game.playersPlaying(), [player1, player2]) self.failUnlessEqual(self.game.notPlayingCount(), 0) self.failUnlessEqual(self.game.serialsNotPlaying(), []) self.failUnlessEqual(self.game.playersNotPlaying(), []) # --------------------------------------------------------- def testMuckStateSitOut(self): """Test Poker Game : Muck state sit out""" player1 = self.AddPlayerAndSit(1, 2) self.game.state = pokergame.GAME_STATE_MUCK self.game.player_list = [ 1 ] self.failIf(self.game.sitOutNextTurn(1)) self.failUnlessEqual(True, self.game.getPlayer(1).sit_out_next_turn) # --------------------------------------------------------- def testMuckStateWonFold(self): """Test Poker Game : Muck state won fold""" self.game.setVariant('holdem') # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() # Buy in amount self.failUnlessEqual(self.game.getPlayerMoney(1), 1600) self.failUnlessEqual(self.game.getPlayerMoney(2), 1600) # The players raise self.failUnless(self.game.callNraise(1, 100)) self.failUnless(self.game.callNraise(2, 200)) self.failUnlessEqual(player1.bet, 100) self.failUnlessEqual(player2.bet, 200) # The player 1 fold self.failUnless(self.game.fold(1)) # The winner is the player 2 self.failUnlessEqual(self.game.winners, [2]) self.failUnlessEqual(self.game.playersWinner(), [player2]) self.failUnless(self.game.isWinnerBecauseFold()) # Money amounts after self.failUnlessEqual(self.game.getPlayerMoney(1), 1500) rake = self.game.getRakedAmount() self.failUnlessEqual(10, rake) self.failUnlessEqual(self.game.getPlayerMoney(2), 1700 - rake) # --------------------------------------------------------- def testMuckStateWonAllIn(self): """Test Poker Game : Muck state won all in""" self.game.setVariant('holdem') # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() # Buy in amount self.failUnlessEqual(self.game.getPlayerMoney(1), 1600) self.failUnlessEqual(self.game.getPlayerMoney(2), 1600) # The players raise self.failUnless(self.game.callNraise(1, 100)) self.failUnless(self.game.callNraise(2, 1600)) self.failUnless(player1.bet, 100) self.failUnless(player2.bet, 1600) # The player 2 is all in self.failUnlessEqual(self.game.getPlayerMoney(2), 0) self.failUnless(player2.isAllIn()) # The player 1 is also all in self.failUnless(self.game.callNraise(1, self.game.getPlayerMoney(1))) self.failUnless(player1.isAllIn()) # All the players are now all in # All the cards must be dealt # Each player has 2 cards, and there are 5 cards in the board hand1 = pokercards.PokerCards(['8s', 'As']) hand2 = pokercards.PokerCards(['3h', '6d']) board = pokercards.PokerCards(['4s', 'Qs', '6s', '6h', 'Ah']) self.failUnlessEqual(player1.hand, hand1) self.failUnlessEqual(player2.hand, hand2) self.failUnlessEqual(self.game.board, board) # The player 1 wins with a flush self.failUnlessEqual(self.game.winners, [1]) self.failUnlessEqual(self.game.playersWinner(), [player1]) # Money amounts after self.failUnlessEqual(self.game.getPotAmount(), 3200) self.failUnlessEqual(self.game.getRakedAmount(), 160) self.failUnlessEqual(self.game.getPlayerMoney(1), 3040) self.failUnlessEqual(self.game.getPlayerMoney(2), 0) # --------------------------------------------------------- def testMuckStateWonRegular(self): """Test Poker Game : Muck state won regular""" self.game.setVariant('holdem') # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Deal cards self.game.dealCards() # Buy in amount self.failUnlessEqual(self.game.getPlayerMoney(1), 1600) self.failUnlessEqual(self.game.getPlayerMoney(2), 1600) # Round 1 self.failUnless(self.game.callNraise(1, 100)) self.failUnless(self.game.callNraise(2, 200)) self.failUnless(self.game.call(1)) # Round 2 self.failUnless(self.game.callNraise(2, 100)) self.failUnless(self.game.call(1)) # Round 3 self.failUnless(self.game.callNraise(2, 100)) self.failUnless(self.game.callNraise(1, 300)) self.failUnless(self.game.call(2)) # Round 4 self.failUnless(self.game.isLastRound()) self.failUnless(self.game.check(2)) self.failUnless(self.game.check(1)) # The turn is finished # Each player has 2 cards, and there is 5 cards in the board hand1 = pokercards.PokerCards(['8s', 'As']) hand2 = pokercards.PokerCards(['3h', '6d']) board = pokercards.PokerCards(['4s', 'Qs', '6s', '6h', 'Ah']) self.failUnlessEqual(player1.hand, hand1) self.failUnlessEqual(player2.hand, hand2) self.failUnlessEqual(self.game.board, board) # The player 1 wins with a flush self.failUnlessEqual(self.game.winners, [1]) self.failUnlessEqual(self.game.playersWinner(), [player1]) # Money amounts after self.failUnlessEqual(self.game.getPotAmount(), 1200) self.failUnlessEqual(self.game.getRakedAmount(), 60) self.failUnlessEqual(self.game.getPlayerMoney(1), 2140) # 2200 - 60 self.failUnlessEqual(self.game.getPlayerMoney(2), 1000) # The money has been already distributed self.failUnless(self.game.moneyDistributed()) # The distribution has no effect self.game.distributeMoney() # Money amounts after self.failUnlessEqual(self.game.getPlayerMoney(1), 2140) self.failUnlessEqual(self.game.getPlayerMoney(2), 1000) # --------------------------------------------------------- def testHighLowWinners(self): """Test Poker Game : high low winners""" # Modify wins properties if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/wins', None, { 'ways' : '2'}): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) winner_properties = { 'id' : '2', 'type' : 'hand', 'order' : 'low8' } if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/wins', 'winner', winner_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) self.game.setVariant(PokerGameTestCase.TestVariantTemporaryFile) self.game.variant = 'holdem8' self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # High low game self.failUnless(self.game.isHighLow()) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Auto pay blind for serial in self.game.serialsAll(): self.game.autoBlindAnte(serial) # Deal all the cards while not self.game.isLastRound(): self.game.nextRound() self.game.dealCards() # Check players money and bet self.failUnlessEqual(player1.bet, 0) self.failUnlessEqual(player2.bet, 500) self.failUnlessEqual(player3.bet, 1000) self.failUnlessEqual(player1.money, 1600) self.failUnlessEqual(player2.money, 1100) self.failUnlessEqual(player3.money, 600) self.game.initRound() self.failUnless(self.game.callNraise(2,501)) self.failUnless(self.game.call(3)) self.failUnless(self.game.call(1)) # 2 winners self.failUnlessEqual(self.game.winners, [2, 3]) # Check money distribution self.failUnlessEqual(self.game.getRakedAmount(), 150) self.failUnlessEqual(player1.money, 599) # # Each player gives his share to the rake, i.e. 150/2 # self.failUnlessEqual(player2.money, 2026) # 2101 - (150/2) self.failUnlessEqual(player3.money, 2025) # 2100 - (150/2) # --------------------------------------------------------- def testRemovePlayer(self): """Test Poker Game : Remove player""" # The number max of player is 2 so there are 2 seats left self.failUnlessEqual(self.game.seatsLeftCount(), 2) self.failUnlessEqual(self.game.seats_left, [2, 7]) # Add a new player on the seat 7 player1 = self.AddPlayerAndSit(1, 7) self.failUnlessEqual(player1.seat, 7) # 1 seat is still left self.failUnlessEqual(self.game.seatsLeftCount(), 1) self.failUnlessEqual(self.game.seats_left, [2]) # Remove the player self.failUnless(self.game.removePlayer(1)) # The Player has been delete self.failUnlessEqual(self.game.getPlayer(1), None) # The player seat is now left self.failUnlessEqual(self.game.seatsLeftCount(), 2) self.failUnlessEqual(self.game.seats_left, [7, 2]) # Add two players on the same seat player1 = self.AddPlayerAndSit(1) player2 = self.AddPlayerAndSit(2) player2.seat = player1.seat self.failUnlessEqual(self.game.seatsLeftCount(), 0) # Remove the player self.failUnless(self.game.removePlayer(1)) self.failUnlessEqual(self.game.seatsLeftCount(), 1) # Remove the second player self.failUnless(self.game.removePlayer(2)) # The number of seat left is still the same self.failUnlessEqual(self.game.seatsLeftCount(), 1) # --------------------------------------------------------- def testCardsDealtThisRoundCount(self): """Test Poker Game : Card dealt this round""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # The game is not running self.failUnlessEqual(self.game.cardsDealtThisRoundCount(), -1) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(self.game.cardsDealtThisRoundCount(), 0) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # First round 2 cards down round_info = self.game.roundInfo() self.failUnlessEqual(round_info["cards"], ['down', 'down']) self.failUnlessEqual(self.game.cardsDealtThisRoundCount(), 2) self.failUnlessEqual(self.game.downCardsDealtThisRoundCount(), 2) self.failUnlessEqual(self.game.upCardsDealtThisRoundCount(), 0) # Set a card to up round_info["cards"] = ['down', 'up'] self.failUnlessEqual(self.game.downCardsDealtThisRoundCount(), 1) self.failUnlessEqual(self.game.upCardsDealtThisRoundCount(), 1) # --------------------------------------------------------- def testUpdateStats(self): """Test Poker Game : Update stats""" self.game.setMaxPlayers(3) # Initial pots pots = { 'contributions': { 'total': {} }, 'pots': [[0, 0]], 'last_round': -1, 'building': 0, } # Initial stats stats = { 'flops': [], 'flops_count': 20, 'percent_flop': 0, 'pots': [], 'pots_count': 20, 'average_pot': 0, 'hands_per_hour': 0, 'time': -1, 'hands_count': 0, 'frequency': 180 # seconds } # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Check stats for attribute, value in stats.items(): self.failUnlessEqual(self.game.stats[attribute], value) # Update stats flop self.game.updateStatsFlop(True) # Check stats self.failUnlessEqual(self.game.stats['flops'], [0]) self.failUnlessEqual(self.game.stats['percent_flop'], 0) # Init stats self.game.stats = stats.copy() # Update stats self.game.updateStatsFlop(False) # Check stats self.failUnlessEqual(self.game.stats['flops'], [100]) self.failUnlessEqual(self.game.stats['percent_flop'], 100) # Update stats end turn self.failUnlessEqual(self.game.stats['time'], -1) self.game.updateStatsEndTurn() self.failIfEqual(self.game.stats['time'], -1) self.failUnlessEqual(self.game.stats['hands_count'], 0) # Set the frequency to 1 hour self.game.stats['frequency'] = 3600 # Modification fo the time self.game.setTime(4000) # Modification of the pots self.game.side_pots['pots'] = [[500, 300]] # Modification of the hand count self.game.hands_count = 1 # Update stats end turn self.game.updateStatsEndTurn() # Check stats self.failUnlessEqual(self.game.stats['average_pot'], 300) self.failUnlessEqual(self.game.stats['hands_per_hour'], 1) self.failUnlessEqual(self.game.stats['hands_count'], 1) # --------------------------------------------------------- def testSidePots(self): """Test Poker Game : Side pots""" # Initial pots pots = { 'contributions': { 'total': {} }, 'pots': [[0, 0]], 'last_round': -1, 'building': 0, } # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # The side pots is initally empty self.failUnlessEqual(self.game.getPots(), {}) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(self.game.playersInPotCount(self.game.getPots()), 0) self.failIf(self.game.isSingleUncalledBet(self.game.getPots())) # The blind contribution has been added to the pots current_round = self.game.current_round pots['contributions'][current_round] = {} self.failUnlessEqual(self.game.getPots(), pots) # The player 1 pay the blind self.game.autoBlindAnte(1) self.failUnlessEqual(player1.bet, 500) self.failUnlessEqual(self.game.playersInPotCount(self.game.getPots()), 1) self.failUnless(self.game.isSingleUncalledBet(self.game.getPots())) # The pots has been updated pots['building'] += 500 pots['contributions']['total'][1] = 500 pots['contributions'][current_round][len(pots['pots']) -1] = {} pots['contributions'][current_round][len(pots['pots']) -1][1] = 500 self.failUnlessEqual(self.game.getPots(), pots) # The player 2 pay also the blind self.game.autoBlindAnte(2) self.failUnlessEqual(player2.bet, 1000) self.failUnlessEqual(self.game.playersInPotCount(self.game.getPots()), 2) self.failIf(self.game.isSingleUncalledBet(self.game.getPots())) # First round self.failUnless(self.game.isFirstRound()) # The pots has been updated pots['building'] += 1000 pots['contributions']['total'][2] = 1000 # The blind turn will be finished so its contribution infos will be copy in the first round infos and deleted pots['contributions'][current_round][len(pots['pots']) -1][2] = 1000 pots['contributions'][current_round + 1] = pots['contributions'][-1] del pots['contributions'][current_round] pots['last_round'] = 0 current_round += 1 # Check pots self.failUnlessEqual(self.game.getPots(), pots) # The player 1 raises and is allin self.failUnless(self.game.callNraise(1, 700)) self.failUnlessEqual(player1.bet, 1200) # The pots has been updated pots['building'] += 700 pots['contributions']['total'][1] += 700 pots['contributions'][current_round][len(pots['pots']) -1][1] += 700 self.failUnlessEqual(self.game.getPots(), pots) self.failUnlessEqual(self.game.getLatestPotContributions(), {0: {1: 1200, 2: 1000}}) # The player 2 call self.failUnless(self.game.call(2)) # Second round self.failUnless(self.game.isSecondRound()) self.failUnlessEqual(self.game.playersInPotCount(self.game.getPots()), 0) # The round is finished, the post has been updated pots['building'] = 0 pots['pots'][0] = [1200 + 1200, 1200 + 1200] pots['contributions']['total'][2] += 200 pots['contributions'][current_round][len(pots['pots']) -1][2] += 200 current_round += 1 pots['last_round'] = 1 pots['contributions'][current_round] = {} # Check pots self.failUnlessEqual(self.game.getPots(), pots) self.failUnlessEqual(self.game.getSidePotTotal(), 2400) # The player 2 raise 100 self.failUnless(self.game.callNraise(2, 100)) self.failUnlessEqual(self.game.getLatestPotContributions(), {0: {2: 100}}) # The player 1 call self.failUnless(self.game.call(1)) # Round 3 self.failUnlessEqual(self.game.current_round, 2) self.failUnlessEqual(self.game.playersInPotCount(self.game.getPots()), 0) # The pots has been updated pots['last_round'] = 2 pots['pots'][0] = [1200 + 1200 + 100 + 100, 1200 + 1200 + 100 + 100] pots['contributions']['total'][1] += 100 pots['contributions']['total'][2] += 100 pots['contributions'][current_round][len(pots['pots']) -1] = {} pots['contributions'][current_round][len(pots['pots']) -1][1] = 100 pots['contributions'][current_round][len(pots['pots']) -1][2] = 100 current_round += 1 pots['contributions'][current_round] = {} # Check pots self.failUnlessEqual(self.game.getPots(), pots) self.failUnlessEqual(self.game.getSidePotTotal(), 2600) self.failUnlessEqual(self.game.playersInPotCount(self.game.getPots()), 0) # --------------------------------------------------------- def testEndTurn(self): """Test Poker Game : End turn""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Pay the blind self.game.autoBlindAnte(1) self.game.autoBlindAnte(2) # Check the players money and bet self.failUnlessEqual(player1.bet, 500) self.failUnlessEqual(player2.bet, 1000) self.failUnlessEqual(self.game.getPlayerMoney(1), 1100) self.failUnlessEqual(self.game.getPlayerMoney(2), 600) # Set a rebuy amount for each player self.game.rebuy(1, 400) self.game.rebuy(2, 600) self.failUnlessEqual(player1.rebuy, 400) self.failUnlessEqual(player2.rebuy, 600) # The rebuy is credited to the player self.game.endTurn() self.failUnlessEqual(player1.rebuy, 0) self.failUnlessEqual(player2.rebuy, 0) self.failUnlessEqual(self.game.getPlayerMoney(1), 1500) self.failUnlessEqual(self.game.getPlayerMoney(2), 1200) # The hand count is incremented self.failUnlessEqual(self.game.hands_count, 1) # The player 1 is broke player1.money = 0 self.failUnless(self.game.isBroke(1)) # Remove the player 2 self.game.removePlayer(2) self.failUnless(player2.remove_next_turn) # Make the player remove needed self.game.endTurn() # The player 1 sit out self.failIfEqual(self.game.getPlayer(1), None) self.failUnless(self.game.getSitOut(1)) # The player 2 has been removed self.failUnlessEqual(len(self.game.seats_left), 1) self.failUnlessEqual(self.game.allCount(), 1) self.failUnlessEqual(self.game.getPlayer(2), None) # --------------------------------------------------------- def testBeginTurn(self): """Test Poker Game : Begin turn""" hand_serial = 1 # Create player 1 player1 = self.AddPlayerAndSit(1, 2) # There is not enough player to start self.failIf(self.game.buildPlayerList(True)) self.game.beginTurn(hand_serial) self.failUnlessEqual(self.game.player_list, []) self.failUnlessEqual(self.game.current_round, -2) # Create player 2 player2 = self.AddPlayerAndSit(2, 7) # Warning the muckable list is not empty self.game.setMuckableSerials([1]) # Begin turn self.game.beginTurn(hand_serial) # The muckable serials have been reset self.game.setMuckableSerials([]) # Init player infos player_infos = { 'bet' : 0, 'dead' : 0, 'fold' : False, 'hand' : pokercards.PokerCards(), 'side_pot_index' : 0, 'all_in' : False, 'ante' : False } # Init side pots infos side_pots_infos ={ 'contributions': { 'total': {} }, 'pots': [[0, 0]], 'last_round': -1, 'building': 0, } # Current round initialisation side_pots_infos['contributions'][self.game.current_round] = {} # Init game infos game_infos = { 'hand_serial' : hand_serial, 'pot' : 0, 'board' : pokercards.PokerCards(), 'winners' : [], 'muckable_serials' : [], 'win_condition' : pokergame.WON_NULL, 'serial2best' : {}, 'showdown_stack' : [], 'side_pots' : side_pots_infos } # Check game initialisation for attribute, value in game_infos.items(): self.failUnlessEqual(getattr(self.game, attribute), value) # Check players initialisation for player in (player1, player2): for attribute, value in player_infos.items(): self.failUnlessEqual(getattr(player, attribute), value) # Check history, first event of type game self.failIfEqual(len(self.game.historyGet()), 0) self.failUnlessEqual(self.game.historyGet()[0][0], 'game') # Check player list self.failUnlessEqual(self.game.player_list, [1, 2]) # Blind and ante turn self.failUnless(self.game.isBlindAnteRound()) # Call again begin turn has no effect self.game.beginTurn(3) self.failIfEqual(self.game.hand_serial, 3) # --------------------------------------------------------- def testInitRound(self): """Test Poker Game : Init round""" round_infos = { 0 : { 'name' : 'pre-flop', 'position' : 'under-the-gun' }, 1 : { 'name' : 'flop', 'position' : 'next-to-dealer' }, 2 : { 'name' : 'turn', 'position' : 'high' }, 3 : { 'name' : 'river', 'position' : 'invalid' } } # Change the round turn properties round_turn_properties = { 'type' : 'high' } if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/round[@name="turn"]/position', None, round_turn_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Change the round river properties round_river_properties = { 'type' : 'invalid' } if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/round[@name="river"]/position', None, round_river_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the variant structure self.game.setVariant(PokerGameTestCase.TestVariantTemporaryFile) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Check the round infos round_info = self.game.roundInfo() self.failUnlessEqual(round_info['name'], round_infos[self.game.current_round]['name']) self.failUnlessEqual(round_info['position'], round_infos[self.game.current_round]['position']) # Check game init self.failUnlessEqual(self.game.last_bet, 0) self.failUnless(self.game.first_betting_pass) self.failUnlessEqual(self.game.getSerialInPosition(), 1) self.failUnlessEqual(self.game.getPlayerLastToTalk(), player2) # Check players init for player in (player1, player2): self.failIf(player.talked_once) # Second round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isSecondRound()) # Check the round infos round_info = self.game.roundInfo() self.failUnlessEqual(round_info['name'], round_infos[self.game.current_round]['name']) self.failUnlessEqual(round_info['position'], round_infos[self.game.current_round]['position']) self.failUnlessEqual(self.game.getSerialInPosition(), 2) self.failUnlessEqual(self.game.getPlayerLastToTalk(), player1) # Round 3 self.game.nextRound() self.game.initRound() self.failUnless(self.game.current_round, 2) # Check the round infos round_info = self.game.roundInfo() self.failUnlessEqual(round_info['name'], round_infos[self.game.current_round]['name']) self.failUnlessEqual(round_info['position'], round_infos[self.game.current_round]['position']) self.failUnlessEqual(self.game.getSerialInPosition(), 1) self.failUnlessEqual(self.game.getPlayerLastToTalk(), player2) # Round 4 self.game.nextRound() self.failUnlessRaises(UserWarning,self.game.initRound) # --------------------------------------------------------- def testInitRoundClientGame(self): """Test Poker Game : Init round client game""" # Create a client game self.CreateGameClient() self.InitGame() self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) round_infos = { 0 : { 'name' : 'pre-flop', 'position' : 'under-the-gun' }, 1 : { 'name' : 'flop', 'position' : 'low' }, 2 : { 'name' : 'turn', 'position' : 'under-the-gun' } } # Change the round flop properties round_flop_properties = { 'type' : 'low' } if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/round[@name="flop"]/position', None, round_flop_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Change the round turn properties round_flop_properties = { 'type' : 'under-the-gun' } if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/round[@name="turn"]/position', None, round_flop_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the variant structure self.game.setVariant(PokerGameTestCase.TestVariantTemporaryFile) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(self.game.player_list, [1, 2, 3]) # Player 2 is waiting big blind player2.wait_for = 'big' # First round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isFirstRound()) # Check the round infos round_info = self.game.roundInfo() self.failUnlessEqual(round_info['name'], round_infos[self.game.current_round]['name']) self.failUnlessEqual(round_info['position'], round_infos[self.game.current_round]['position']) self.failUnlessEqual(self.game.player_list, [1, 3]) # Check game init self.failUnlessEqual(self.game.last_bet, 0) self.failUnless(self.game.first_betting_pass) self.failUnlessEqual(self.game.getSerialInPosition(), 3) self.failUnlessEqual(self.game.getPlayerLastToTalk(), player1) # Check players init for player in (player1, player2): self.failIf(player.talked_once) # Second round self.game.nextRound() self.game.initRound() self.failUnless(self.game.isSecondRound()) # Check the round infos round_info = self.game.roundInfo() self.failUnlessEqual(round_info['name'], round_infos[self.game.current_round]['name']) self.failUnlessEqual(round_info['position'], round_infos[self.game.current_round]['position']) self.failUnlessEqual(self.game.getSerialInPosition(), 1) self.failUnlessEqual(self.game.getPlayerLastToTalk(), player3) # The player 1 and 2 are fold player1.fold = True player2.fold = True self.failIf(player1.isInGame()) self.failIf(player2.isInGame()) # Next round self.game.nextRound() # Not enough player in game to init the round self.failUnless(self.game.inGameCount, 1) self.failUnlessRaises(UserWarning, self.game.initRound) # --------------------------------------------------------- def testInitRoundBlindAllIn(self): """Test Poker Game : Init round blinds are all-in""" # Create a client game self.CreateGameClient() self.InitGame() self.game.setMaxPlayers(4) # Create players player1 = self.AddPlayerAndSit(1, 1) player2 = self.AddPlayerAndSit(2, 3) player3 = self.AddPlayerAndSit(3, 6) player4 = self.AddPlayerAndSit(4, 8) # Change the round flop properties round_flop_properties = { 'type' : 'low' } if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant/round[@name="flop"]/position', None, round_flop_properties): self.fail('Error during modification of configuration file ' + self.ConfigTempFile) # Reload the variant structure self.game.setVariant(PokerGameTestCase.TestVariantTemporaryFile) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) self.failUnlessEqual(self.game.player_list, [1, 2, 3, 4]) # Player 2 & 4 are all_in player2.all_in = True player4.all_in = True self.failUnless("small", player2.blind) self.failUnless("big", player3.blind) # First round self.game.nextRound() self.game.initRound() # # idx # players: 0 | 1 dealer - first to talk # 1 | 2 small blind all in # 2 | 3 big blind - last to talk # 3 | 4 all in # self.assertEqual(0, self.game.position) self.assertEqual(2, self.game.last_to_talk) # --------------------------------------------------------- def testMuck(self): """Test Poker Game : Muck""" # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Init the muckable serials self.game.setMuckableSerials([10,20]) self.failUnlessEqual(self.game.muckable_serials, [10,20]) # Init the muckable serials self.game.setMuckableSerials((1,2)) self.failUnlessEqual(ListType, type(self.game.muckable_serials)); self.failUnlessEqual(self.game.muckable_serials, [1,2]) # Muck not available self.game.muck(1, True) self.failUnlessEqual(self.game.muckable_serials, [1,2]) # Muck state self.game.changeState(pokergame.GAME_STATE_MUCK) self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_MUCK) # Player 1 muck self.game.muck(1, False) self.failUnlessEqual(self.game.muckable_serials, [2]) self.failUnless(player1.hand.areVisible()) # The muck serial list is not empty # The state is still MUCK STATE self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_MUCK) # Unknown player, muck has no effect self.game.muck(3, True) self.failUnlessEqual(self.game.muckable_serials, [2]) # Client game self.game.is_directing = False # Muck state has no effect self.game.muckState(pokergame.WON_NULL) # Muck has no effect self.game.muck(2, False) self.failUnlessEqual(self.game.muckable_serials, [2]) self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_MUCK) self.game.is_directing = True # Player 2 muck self.game.muck(2, False) self.failUnlessEqual(self.game.muckable_serials, []) self.failUnless(player2.hand.areVisible()) # The game is finished self.failUnlessEqual(self.game.state, pokergame.GAME_STATE_END) # --------------------------------------------------------- def testGetMaxBoardSize(self): """Test Poker Game : Get max board size""" # The max board size is initially set to 5 self.failUnlessEqual(self.game.getMaxBoardSize(), 5) # Change the variant type if not self.ModifyXMLFile(self.VariantTempFile, '/poker/variant', None, {'type' : 'NotCommunity'}): self.fail('Error during modification of variant file ' + self.VariantTempFile) self.game.setVariant(PokerGameTestCase.TestVariantTemporaryFile) # Not a community variant, max board size set 0 self.failUnlessEqual(self.game.getMaxBoardSize(), 0) # --------------------------------------------------------- def testGetParamList(self): """Test Poker Game : Get param list""" self.failUnlessEqual(len(self.game.getParamList('/bet/variants/round')), 4) self.failUnlessEqual(len(self.game.getParamList('/poker/variant/community/position')), 5) # --------------------------------------------------------- def testGetParam(self): """Test Poker Game : Get param""" self.failUnlessEqual(self.game.getParam('/bet/@buy-in'), '50') self.failUnlessEqual(self.game.getParam('/poker/variant/@type'), 'community') # --------------------------------------------------------- def testGetParamProperties(self): """Test Poker Game : Get param properties""" bet_properties = { 'buy-in' : '50', 'max-buy-in' : '10000', 'best-buy-in' : '1600', 'unit' : '300' } properties = self.game.getParamProperties('/bet')[0] for attribute, value in bet_properties.items(): self.failUnlessEqual(properties[attribute], value) variant_properties = { 'type' : 'community', 'name' : 'VariantName', 'id' : 'VariantTest' } properties = self.game.getParamProperties('/poker/variant')[0] for attribute, value in variant_properties.items(): self.failUnlessEqual(properties[attribute], value) # --------------------------------------------------------- def testIsGameEndInformationValid(self): """Test Poker Game : Is game end information are valid""" # The game state is not GAME_STATE_END self.failIfEqual(self.game.state,pokergame.GAME_STATE_END) self.failIf(self.game.isGameEndInformationValid()) # Change the game state self.game.changeState(pokergame.GAME_STATE_END) self.failUnlessEqual(self.game.state,pokergame.GAME_STATE_END) # there is no winner self.failUnlessEqual(len(self.game.winners),0) self.failIf(self.game.isGameEndInformationValid()) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 7) # Set the winners self.game.winners = [1] # The end information are valid self.failUnless(self.game.isGameEndInformationValid()) # Remove the winner from the player list del self.game.serial2player[1] # The end information are now invalid self.failIf(self.game.isGameEndInformationValid()) # --------------------------------------------------------- def testDispatchMuck(self): """Test Poker Game : Dispatch Muck""" self.game.setVariant('holdem') self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Deal all the cards while not self.game.isLastRound(): self.game.nextRound() self.game.dealCards() # Init winners self.game.setWinners([1]) # Init winners per side self.game.side2winners = { 'hi': [], 'low': [] } # Winner because fold self.game.win_condition = pokergame.WON_FOLD self.failUnlessEqual(self.game.dispatchMuck(), ((), (1,))) self.game.win_condition = pokergame.WON_REGULAR # Dealer is the player 2 self.failUnlessEqual(self.game.dealer, 0) # The player 2 and 3 muck, the winner show his cards self.failUnlessEqual(self.game.dispatchMuck(), ([1], [2,3])) # Init winners per side self.game.side2winners = { 'hi': [2], 'low': [] } # The player 2 show also his cards self.failUnlessEqual(self.game.dispatchMuck(), ([2, 3, 1], [])) # Init winners per side self.game.side2winners = { 'hi': [], 'low': [3] } # All the player show their cards self.failUnlessEqual(self.game.dispatchMuck(), ([2,1], [3])) # Client game self.game.is_directing = False self.failUnlessEqual(self.game.dispatchMuck(), None) # --------------------------------------------------------- def testAutoMuckNever(self): """Test Poker Game : Auto muck never""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Auto pay blind for serial in self.game.serialsAll(): self.game.autoBlindAnte(serial) # Set auto muck state self.game.autoMuck(1, pokergame.AUTO_MUCK_NEVER) self.game.autoMuck(2, pokergame.AUTO_MUCK_NEVER) self.game.autoMuck(3, pokergame.AUTO_MUCK_NEVER) # Players 1 and 2 fold self.failUnless(self.game.fold(1)) self.failUnless(self.game.fold(2)) # Player 3 is the winner and muckable self.failUnlessEqual(self.game.winners, [3]) self.failUnlessEqual(self.game.muckable_serials, [3]) # --------------------------------------------------------- def testAutoMuckAlways(self): """Test Poker Game : Auto muck always""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Auto pay blind for serial in self.game.serialsAll(): self.game.autoBlindAnte(serial) # Set auto muck state self.game.autoMuck(1, pokergame.AUTO_MUCK_ALWAYS) self.game.autoMuck(2, pokergame.AUTO_MUCK_ALWAYS) self.game.autoMuck(3, pokergame.AUTO_MUCK_ALWAYS) # Players 1 and 2 fold self.failUnless(self.game.fold(1)) self.failUnless(self.game.fold(2)) # No muckable players self.failUnlessEqual(self.game.winners, [3]) self.failUnlessEqual(self.game.muckable_serials, []) # --------------------------------------------------------- def testAutoMuckWin(self): """Test Poker Game : Auto muck win""" self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Auto pay blind for serial in self.game.serialsAll(): self.game.autoBlindAnte(serial) # Set auto muck state self.game.autoMuck(1, pokergame.AUTO_MUCK_WIN) self.game.autoMuck(2, pokergame.AUTO_MUCK_WIN) self.game.autoMuck(3, pokergame.AUTO_MUCK_WIN) # Players 1 and 2 fold self.failUnless(self.game.fold(1)) self.failUnless(self.game.fold(2)) # Player 3 is the winner but not muckable self.failUnless(self.game.isWinnerBecauseFold()) self.failUnlessEqual(self.game.winners, [3]) self.failUnlessEqual(self.game.muckable_serials, []) # --------------------------------------------------------- def testAutoMuckLose(self): """Test Poker Game : Auto muck lose""" self.game.variant = 'holdem' self.game.setMaxPlayers(3) # Create players player1 = self.AddPlayerAndSit(1, 2) player2 = self.AddPlayerAndSit(2, 5) player3 = self.AddPlayerAndSit(3, 7) # Blind and ante turn self.game.beginTurn(1) self.failUnless(self.game.isBlindAnteRound()) # Auto pay blind for serial in self.game.serialsAll(): self.game.autoBlindAnte(serial) # Set auto muck state self.game.autoMuck(1, pokergame.AUTO_MUCK_LOSE) self.game.autoMuck(2, pokergame.AUTO_MUCK_LOSE) self.game.autoMuck(3, pokergame.AUTO_MUCK_LOSE) # Deal all the cards while not self.game.isLastRound(): self.game.nextRound() self.game.dealCards() self.game.initRound() self.failUnless(self.game.callNraise(2,100)) self.failUnless(self.game.call(3)) self.failUnless(self.game.call(1)) # Player 3 is the winner but not muckable self.failIf(self.game.isWinnerBecauseFold()) self.failUnlessEqual(self.game.winners, [3]) self.failUnlessEqual(self.game.muckable_serials, []) # --------------------------------------------------------- def testUpdateBlinds(self): """Test Poker Game : Update blinds""" self.game.setMaxPlayers(4) # Create 1 player player1 = self.AddPlayerAndSit(1, 1) # Not enough player sit # The wait_for attribute is reset if not equal to first round player1.wait_for = 'first_round' self.game.updateBlinds() self.failUnlessEqual(player1.wait_for, 'first_round') player1.wait_for = 'big' self.game.updateBlinds() self.failUnlessEqual(player1.wait_for, False) # Create players player2 = self.AddPlayerAndSit(2, 3) player3 = self.AddPlayerAndSit(3, 6) player4 = self.AddPlayerAndSit(4, 8) # Init players infos self.game.playersBeginTurn() # Update blinds blinds = { 1 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : 'small', 'missed_blind' : None, 'wait_for' : False}, 3 : { 'blind' : 'big', 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False} } self.game.updateBlinds() # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # Move the dealer self.game.moveDealerLeft() # Update blinds blinds = { 1 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 3 : { 'blind' : 'small', 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : 'big', 'missed_blind' : None, 'wait_for' : False} } self.game.updateBlinds() # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # Move the dealer self.game.moveDealerLeft() # Update blinds blinds = { 1 : { 'blind' : 'big', 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 3 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : 'small', 'missed_blind' : None, 'wait_for' : False} } self.game.updateBlinds() # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # Forbid missed blinds player1.missed_blind = 'small' player1.wait_for = 'late' player2.missed_blind = 'small' player3.missed_blind = 'small' self.game.updateBlinds() blinds = { 1 : { 'blind' : 'big', 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 3 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : 'small', 'missed_blind' : None, 'wait_for' : False} } # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # --------------------------------------------------------- def testUpdateSmallBlinds(self): """Test Poker Game : Update small blinds""" self.game.setMaxPlayers(4) # Create players player1 = self.AddPlayerAndSit(1, 1) player2 = self.AddPlayerAndSit(2, 3) player3 = self.AddPlayerAndSit(3, 6) player4 = self.AddPlayerAndSit(4, 8) # Update blinds blinds = { 1 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : 'small', 'missed_blind' : None, 'wait_for' : False}, 3 : { 'blind' : 'big', 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False} } self.game.updateBlinds() # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # Init players infos self.game.playersBeginTurn() # Player 2 has already payed the blind => # Nothing is done player2.blind = True self.game.updateBlinds() blinds = { 1 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : True, 'missed_blind' : None, 'wait_for' : False}, 3 : { 'blind' : 'big', 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False} } # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # Init players infos self.game.playersBeginTurn() # Player 2 has missed a blind player2.missed_blind = 'small' self.game.updateBlinds() blinds = { 1 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : None, 'missed_blind' : 'small', 'wait_for' : 'late'}, 3 : { 'blind' : 'small', 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : 'big', 'missed_blind' : None, 'wait_for' : False} } # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # --------------------------------------------------------- def testUpdateBigBlinds(self): """Test Poker Game : Update big blinds""" self.game.setMaxPlayers(4) # Create players player1 = self.AddPlayerAndSit(1, 1) player2 = self.AddPlayerAndSit(2, 3) player3 = self.AddPlayerAndSit(3, 6) player4 = self.AddPlayerAndSit(4, 8) # Update blinds blinds = { 1 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : 'small', 'missed_blind' : None, 'wait_for' : False}, 3 : { 'blind' : 'big', 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False} } self.game.updateBlinds() # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # Init players infos self.game.playersBeginTurn() # Player 2 has already payed the blind => # Nothing is done player3.blind = True player3.wait_for = 'small' self.game.updateBlinds() blinds = { 1 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False}, 2 : { 'blind' : 'small', 'missed_blind' : None, 'wait_for' : False}, 3 : { 'blind' : True, 'missed_blind' : None, 'wait_for' : False}, 4 : { 'blind' : None, 'missed_blind' : None, 'wait_for' : False} } # Check blinds for player in blinds.keys(): for attribute, value in blinds[player].items(): self.failUnlessEqual(getattr(self.game.getPlayer(player), attribute), value) # --------------------------------------------------------- def testUpdateErrorSmallAndBigBlinds(self): """Test Poker Game : Update error small and big blinds""" self.game.setMaxPlayers(pokergame.ABSOLUTE_MAX_PLAYERS) # Create players for num in range(pokergame.ABSOLUTE_MAX_PLAYERS): player = self.AddPlayerAndSit(num + 1) player.wait_for = 'big' self.game.getPlayer(1).wait_for = 'first_round' # Error small blind can not be assigned self.game.updateBlinds() # Check player 1 blinds blinds1 = {'blind' : 'late', 'missed_blind' : None, 'wait_for' : 'first_round'} # Check blinds for attribute, value in blinds1.items(): self.failUnlessEqual(getattr(self.game.getPlayer(1), attribute), value) blinds = {'blind' : 'late', 'missed_blind' : None, 'wait_for' : 'big'} # Check players blinds for num in range(1, pokergame.ABSOLUTE_MAX_PLAYERS): for attribute, value in blinds.items(): self.failUnlessEqual(getattr(self.game.getPlayer(num + 1), attribute), value) def testAllinWithDead(self): """ Test Poker Game : Allin with dead blind and lost to the winner although the winner has less money """ game = pokergame.PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) game.verbose = int(os.environ.get('VERBOSE_T', 3)) game.setVariant("holdem") game.setBettingStructure("100-200-no-limit") player = {} money = {} money[66] = 30000 money[76] = 10000 money[77] = 20000 for serial in (66, 76, 77): self.assert_(game.addPlayer(serial)) player[serial] = game.serial2player[serial] player[serial].money = 2000000 player[serial].buy_in_payed = True self.assert_(game.sit(serial)) #player[serial].auto_blind_ante = True player[serial].money = money[serial] game.autoMuck(serial, pokergame.AUTO_MUCK_ALWAYS) game.dealer_seat = 0 game.beginTurn(1) player[66].blind = 'big_and_dead' player[76].blind = 'small' player[77].blind = 'big' # # 77 : 4c 8c # 76 : 9s 4h # 66 : 3h Jh # game.deck = ['7c', 'Qs', '6c', 'Qc', '2h', '8c', '4h', 'Jh', '4c', '9s', '3h' ] game.setPosition(0) game.blind(66, 20000, 10000) game.blind(76, 10000, 0) game.blind(77, 20000, 0) self.assertEqual("end", game.state) rake = game.getRakedAmount() self.failUnlessEqual(3000, rake) self.assertEqual(40000 - rake, game.showdown_stack[0]['serial2delta'][77]) def testDeadWithUncalled(self): """ Test Poker Game : dead blind + a player has uncalled bet and is not the winner. """ game = pokergame.PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) game.verbose = int(os.environ.get('VERBOSE_T', 3)) game.setVariant("holdem") game.setBettingStructure("100-200-no-limit") player = {} money = {} money[66] = 2000000 money[76] = 1000000 money[77] = 1000000 for serial in (66, 76, 77): self.assert_(game.addPlayer(serial)) player[serial] = game.serial2player[serial] player[serial].money = 200000 player[serial].buy_in_payed = True self.assert_(game.sit(serial)) #player[serial].auto_blind_ante = True game.autoMuck(serial, pokergame.AUTO_MUCK_ALWAYS) player[serial].money = money[serial] game.dealer_seat = 0 game.beginTurn(1) player[66].blind = 'big_and_dead' player[76].blind = 'small' player[77].blind = 'big' # # 77 : 4c 8c # 76 : 9s 4h # 66 : 3h Jh # game.deck = ['7c', 'Qs', '6c', 'Qc', '2h', '4h', 'Jh', '8c', '9s', '3h', '4c' ] game.setPosition(0) game.blind(66, 20000, 10000) game.blind(76, 10000, 0) game.blind(77, 20000, 0) self.assertEqual(game.state, "pre-flop") game.callNraise(66, 2000000) game.call(76) game.fold(77) def testLastInGameDoesNotAct(self): """ Test Poker Game : player folds (although he could check) while a player is allin and another player is behind him. The turn ends now, the last player is not asked for his action. """ game = pokergame.PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) game.verbose = int(os.environ.get('VERBOSE_T', 3)) game.setVariant("holdem") game.setBettingStructure("100-200-no-limit") player = {} money = {} money[66] = 200000 money[76] = 3000000 money[77] = 100000 for serial in (66, 76, 77): self.assert_(game.addPlayer(serial)) player[serial] = game.serial2player[serial] player[serial].money = 200000 player[serial].buy_in_payed = True self.assert_(game.sit(serial)) #player[serial].auto_blind_ante = True game.autoMuck(serial, pokergame.AUTO_MUCK_ALWAYS) game.autoBlindAnte(serial) player[serial].money = money[serial] game.dealer_seat = 0 # # 77 : 4c 8c # 76 : 9s 4h # 66 : 3h Jh # game.deck = ['7c', 'Qs', '6c', 'Qc', '2h', '4h', 'Jh', '8c', '9s', '3h', '4c' ] game.board = pokercards.PokerCards(['9c', '3d', '2d', 'Qd', 'Ah']) # player list: [66, 76, 77] # dealer : 66 game.beginTurn(1) game.call(66) game.call(76) game.check(77) self.assertEqual(game.state, "flop") game.callNraise(76, 150000) game.call(77) game.call(66) self.assertEqual(game.state, "turn") game.fold(76) self.assertEqual(game.state, "end") def testAllInAndFoldInNewRound(self): """ Test Poker Game : player folds to a raise when heads up in a betting round. Another player was allin in the previous round. The winner has an uncalled amount AND wins the pot in which the allin player was not. """ game = pokergame.PokerGameServer("poker.%s.xml", [ "../conf", "@top_srcdir@/conf" ]) game.verbose = int(os.environ.get('VERBOSE_T', 3)) game.setVariant("holdem") game.setBettingStructure("100-200-no-limit") player = {} money = {} money[66] = 200000 money[76] = 3000000 money[77] = 100000 for serial in (66, 76, 77): self.assert_(game.addPlayer(serial)) player[serial] = game.serial2player[serial] player[serial].money = 200000 player[serial].buy_in_payed = True self.assert_(game.sit(serial)) #player[serial].auto_blind_ante = True game.autoMuck(serial, pokergame.AUTO_MUCK_ALWAYS) game.autoBlindAnte(serial) player[serial].money = money[serial] game.dealer_seat = 0 # # 77 : 4c 8c # 76 : 9s Jd # 66 : 3h Jh # game.deck = ['7c', 'Qs', '6c', 'Qc', '2h', 'Jd', 'Jh', '8c', '9s', '3h', '4c' ] game.board = pokercards.PokerCards(['9c', '3d', '2d', 'Qd', 'Ah']) # player list: [66, 76, 77] # dealer : 66 game.beginTurn(1) game.call(66) game.call(76) game.check(77) self.assertEqual(game.state, "flop") game.callNraise(76, 150000) game.call(77) game.call(66) self.assertEqual(game.state, "turn") game.callNraise(76, 150000) game.fold(66) self.assertEqual(game.state, "end") def testUpdateHistoryEnd(self): game = self.game game.turn_history = [("one",), ("two",), ("end",), ("three",)] game.updateHistoryEnd(winners = "winners", showdown_stack = "showdown_stack") self.assertEqual(("end", "winners", "showdown_stack"), game.turn_history[2]) def testEmtpyShowdownStack(self): turn_history = [("end", [], []),] pokergame.history2messages(None, turn_history) # --------------------------------------------------------- def AddPlayerAndSit(self, serial, seat = -1): self.failUnless(self.game.addPlayer(serial, seat)) self.failUnless(self.game.payBuyIn(serial,self.game.bestBuyIn())) player = self.GetPlayer(serial) self.failUnless(player.isBuyInPayed()) self.failUnless(self.game.sit(serial)) self.failUnless(self.game.isSit(serial)) return player # --------------------------------------------------------- def ModifyXMLFile(self, path, parent, child, attributes = {}): try: doc = libxml2.parseFile(path) except libxml2.parserError: return False header = doc.xpathNewContext() node_parent = doc.getRootElement() if parent: nodes = header.xpathEval(parent) if nodes: node_parent = nodes[0] else: return False node = node_parent if child: node = node_parent.newChild(ns = None, name = child, content = None) for attribute_name, attribute_value in attributes.items(): if not node.hasProp(attribute_name): node.newProp(attribute_name,attribute_value) else: for property in node.properties: if property.name == attribute_name: property.setContent(attribute_value) doc.saveFile(path) doc.freeDoc() header.xpathFreeContext() return True # --------------------------------------------------------- def CopyFile(self, src_path, dst_path): if src_path and not os.path.isfile(src_path): return False shutil.copyfile(src_path,dst_path) if os.path.isfile(dst_path): return True return False # --------------------------------------------------------- def DeleteFile(self, path): if os.path.isfile(path): os.unlink(path) # --------------------------------------------------------- def GetPlayer(self, serial): player = self.game.getPlayer(serial) self.failIfEqual(player, None) return player # --------------------------------------------------------- def CreateGameClient(self): if not self.CopyFile(self.ConfigTmplFile, self.ConfigTempFile): self.fail('Error during creation of configuration file ' + self.ConfigTempFile) self.game = pokergame.PokerGameClient(PokerGameTestCase.TestUrl, ['.', PokerGameTestCase.TestConfDirectory, '~/conf', tempfile.gettempdir()]) # --------------------------------------------------------- def CreateGameServer(self): if not self.CopyFile(self.ConfigTmplFile, self.ConfigTempFile): self.fail('Error during creation of configuration file ' + self.ConfigTempFile) self.game = pokergame.PokerGameServer(PokerGameTestCase.TestUrl, ['.', PokerGameTestCase.TestConfDirectory, '~/conf', tempfile.gettempdir()]) # --------------------------------------------------------- def InitGame(self): self.game.verbose = int(os.environ.get('VERBOSE_T', 3)) self.game.setTime(0) if not self.CopyFile(self.VariantTmplFile, self.VariantTempFile): self.fail('Error during creation of variant file ' + self.VariantTempFile) self.game.setVariant(PokerGameTestCase.TestVariantTemporaryFile) # Reload the betting structure self.game.setBettingStructure(PokerGameTestCase.TestConfigTemporaryFile) self.game.setMaxPlayers(2) self.game.id = 4 predefined_decks = string.split("8d 2h 2c 8c 4c Kc Ad 9d Ts Jd 5h Tc 4d 9h 8h 7h 9c 2s 3c Kd 5s Td 5d Th 3s Kh Js Qh 7d 2d 3d 9s Qd Ac Jh Jc Qc 6c 7s Ks 5c 4h 7c 4s Qs 6s 6h Ah 6d As 3h 8s") shuffler = PokerPredefinedDecks([map(lambda card: self.game.eval.string2card(card), predefined_decks)]) self.game.deck = predefined_decks self.game.shuffler = shuffler # --------------------------------------------------------- def GetTestSuite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PokerGameTestCase)) # Comment out above and use line below this when you wish to run just # one test by itself (changing prefix as needed). # suite.addTest(unittest.makeSuite(PokerGameTestCase, prefix = "test2")) return suite # --------------------------------------------------------- def GetTestedModule(): return pokergame # --------------------------------------------------------- def Run(verbose): # unittest.TestLoader.testMethodPrefix = "testMuckStateSitOut" return unittest.TextTestRunner(verbosity=verbose).run(GetTestSuite()) # --------------------------------------------------------- if __name__ == '__main__': if Run(int(os.environ.get('VERBOSE_T', 2))).wasSuccessful(): sys.exit(0) else: sys.exit(1) # Interpreted by emacs # Local Variables: # compile-command: "( cd .. ; ./config.status tests/test-game.py ) ; ( cd ../tests ; make COVERAGE_FILES='../pokerengine/pokergame.py' TESTS='coverage-reset test-game.py coverage-report' check )" # End: poker-engine-1.3.6/INSTALL0000644000175000017500000003633211540702065012065 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. poker-engine-1.3.6/AUTHORS0000644000175000017500000000020111123715766012077 00000000000000Loic Dachary (2004->2008-) Bradley M. Kuhn (2008-) Henry Precheur (2004) poker-engine-1.3.6/poker-engine.pc.in0000644000175000017500000000047511352711000014335 00000000000000# pkg-config source file prefix=@prefix@ exec_prefix=@exec_prefix@ pkgsysconfdir=@POKER_ENGINE_PKGSYSCONFDIR@ pkgdatadir=@POKER_ENGINE_PKGDATADIR@ pkglibdir=@POKER_ENGINE_PKGLIBDIR@ Name: poker-engine Description: python library implementing poker rules Version: @PACKAGE_VERSION@ Requires: pypoker-eval Conflicts: