Merge branch 'master' into siteneutral
This commit is contained in:
commit
3683a82e0f
|
@ -43,6 +43,7 @@ out_path (default '-' = sys.stdout)
|
||||||
follow : whether to tail -f the input
|
follow : whether to tail -f the input
|
||||||
autostart: whether to run the thread (or you can call start() yourself)
|
autostart: whether to run the thread (or you can call start() yourself)
|
||||||
debugging: if False, pass on partially supported game types. If true, have a go and error..."""
|
debugging: if False, pass on partially supported game types. If true, have a go and error..."""
|
||||||
|
print "DEBUG: XXXXXXXXXXXXXXX"
|
||||||
HandHistoryConverter.__init__(self, in_path, out_path, sitename="Everleaf", follow=follow)
|
HandHistoryConverter.__init__(self, in_path, out_path, sitename="Everleaf", follow=follow)
|
||||||
logging.info("Initialising Everleaf converter class")
|
logging.info("Initialising Everleaf converter class")
|
||||||
self.filetype = "text"
|
self.filetype = "text"
|
||||||
|
@ -130,12 +131,10 @@ or None if we fail to get the info """
|
||||||
info['bb'] = mg['BB']
|
info['bb'] = mg['BB']
|
||||||
if 'CURRENCY' in mg:
|
if 'CURRENCY' in mg:
|
||||||
info['currency'] = currencies[mg['CURRENCY']]
|
info['currency'] = currencies[mg['CURRENCY']]
|
||||||
|
if info['currency'] == 'T$':
|
||||||
|
info['type'] = 'tour'
|
||||||
# NB: SB, BB must be interpreted as blinds or bets depending on limit type.
|
# NB: SB, BB must be interpreted as blinds or bets depending on limit type.
|
||||||
|
|
||||||
if not self.debugging and info['base']=='stud':
|
|
||||||
logging.warning("Not processing Everleaf Stud hand")
|
|
||||||
#return None
|
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ import sys
|
||||||
import logging
|
import logging
|
||||||
from HandHistoryConverter import *
|
from HandHistoryConverter import *
|
||||||
|
|
||||||
# FullTilt HH Format converter
|
# Fulltilt HH Format converter
|
||||||
|
|
||||||
class FullTilt(HandHistoryConverter):
|
class Fulltilt(HandHistoryConverter):
|
||||||
|
|
||||||
# Static regexes
|
# Static regexes
|
||||||
re_GameInfo = re.compile('- (?P<CURRENCY>\$|)?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) (Ante \$(?P<ANTE>[.0-9]+) )?- (?P<LIMIT>(No Limit|Pot Limit|Limit))? (?P<GAME>(Hold\'em|Omaha Hi|Razz))')
|
re_GameInfo = re.compile('- (?P<CURRENCY>\$|)?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) (Ante \$(?P<ANTE>[.0-9]+) )?- (?P<LIMIT>(No Limit|Pot Limit|Limit))? (?P<GAME>(Hold\'em|Omaha Hi|Razz))')
|
||||||
|
@ -39,8 +39,8 @@ class FullTilt(HandHistoryConverter):
|
||||||
in_path (default '-' = sys.stdin)
|
in_path (default '-' = sys.stdin)
|
||||||
out_path (default '-' = sys.stdout)
|
out_path (default '-' = sys.stdout)
|
||||||
follow : whether to tail -f the input"""
|
follow : whether to tail -f the input"""
|
||||||
HandHistoryConverter.__init__(self, in_path, out_path, sitename="FullTilt", follow=follow)
|
HandHistoryConverter.__init__(self, in_path, out_path, sitename="Fulltilt", follow=follow)
|
||||||
logging.info("Initialising FullTilt converter class")
|
logging.info("Initialising Fulltilt converter class")
|
||||||
self.filetype = "text"
|
self.filetype = "text"
|
||||||
self.codepage = "cp1252"
|
self.codepage = "cp1252"
|
||||||
if autostart:
|
if autostart:
|
||||||
|
@ -314,4 +314,4 @@ if __name__ == "__main__":
|
||||||
LOG_FILENAME = './logging.out'
|
LOG_FILENAME = './logging.out'
|
||||||
logging.basicConfig(filename=LOG_FILENAME,level=options.verbosity)
|
logging.basicConfig(filename=LOG_FILENAME,level=options.verbosity)
|
||||||
|
|
||||||
e = FullTilt(in_path = options.ipath, out_path = options.opath, follow = options.follow)
|
e = Fulltilt(in_path = options.ipath, out_path = options.opath, follow = options.follow)
|
||||||
|
|
|
@ -29,6 +29,7 @@ from Exceptions import *
|
||||||
|
|
||||||
class Hand:
|
class Hand:
|
||||||
UPS = {'a':'A', 't':'T', 'j':'J', 'q':'Q', 'k':'K', 'S':'s', 'C':'c', 'H':'h', 'D':'d'}
|
UPS = {'a':'A', 't':'T', 'j':'J', 'q':'Q', 'k':'K', 'S':'s', 'C':'c', 'H':'h', 'D':'d'}
|
||||||
|
LCS = {'H':'h', 'D':'d', 'C':'c', 'S':'s'}
|
||||||
def __init__(self, sitename, gametype, handText):
|
def __init__(self, sitename, gametype, handText):
|
||||||
self.sitename = sitename
|
self.sitename = sitename
|
||||||
self.gametype = gametype
|
self.gametype = gametype
|
||||||
|
@ -316,32 +317,6 @@ Map the tuple self.gametype onto the pokerstars string describing it
|
||||||
|
|
||||||
return retstring
|
return retstring
|
||||||
|
|
||||||
def lookupLimitBetSize(self):
|
|
||||||
#Lookup table for limit games
|
|
||||||
betlist = {
|
|
||||||
"Everleaf" : { "0.10" : ("0.02", "0.05"),
|
|
||||||
"0.20" : ("0.05", "0.10"),
|
|
||||||
"0.50" : ("0.10", "0.25"),
|
|
||||||
"1" : ("0.25", "0.50"),
|
|
||||||
"2" : ("0.50", "1.00"),
|
|
||||||
"4" : ("1.00", "2.00"),
|
|
||||||
"6" : ("1.00", "3.00")
|
|
||||||
},
|
|
||||||
"FullTilt" : { "0.10" : ("0.02", "0.05"),
|
|
||||||
"0.20" : ("0.05", "0.10"),
|
|
||||||
"1" : ("0.25", "0.50"),
|
|
||||||
"2" : ("0.50", "1"),
|
|
||||||
"4" : ("1", "2")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try:
|
|
||||||
ret = betlist[self.sitename][self.bb]
|
|
||||||
except:
|
|
||||||
logging.warning("Don't know the small blind/big blind size for %s, big bet size %s." % (self.sitename, self.bb))
|
|
||||||
ret = (Decimal(self.sb)/2,Decimal(self.bb)/2)
|
|
||||||
|
|
||||||
return ret
|
|
||||||
|
|
||||||
|
|
||||||
def writeHand(self, fh=sys.__stdout__):
|
def writeHand(self, fh=sys.__stdout__):
|
||||||
print >>fh, "Override me"
|
print >>fh, "Override me"
|
||||||
|
@ -449,23 +424,6 @@ Card ranks will be uppercased
|
||||||
#Only print stacks of players who do something preflop
|
#Only print stacks of players who do something preflop
|
||||||
print >>fh, _("Seat %s: %s ($%s in chips) " %(player[0], player[1], player[2]))
|
print >>fh, _("Seat %s: %s ($%s in chips) " %(player[0], player[1], player[2]))
|
||||||
|
|
||||||
|
|
||||||
#May be more than 1 bb posting
|
|
||||||
if self.gametype['limitType'] == "fl":
|
|
||||||
(smallbet, bigbet) = self.lookupLimitBetSize()
|
|
||||||
else:
|
|
||||||
smallbet = self.sb
|
|
||||||
bigbet = self.bb
|
|
||||||
|
|
||||||
# for a in self.posted:
|
|
||||||
# if(a[1] == "small blind"):
|
|
||||||
# print >>fh, _("%s: posts small blind $%s" %(a[0], smallbet))
|
|
||||||
# if(a[1] == "big blind"):
|
|
||||||
# print >>fh, _("%s: posts big blind $%s" %(a[0], bigbet))
|
|
||||||
# if(a[1] == "both"):
|
|
||||||
# print >>fh, _("%s: posts small & big blinds $%.2f" %(a[0], (Decimal(smallbet) + Decimal(bigbet))))
|
|
||||||
# I think these can just be actions in 'blindsantes' round
|
|
||||||
|
|
||||||
if self.actions['BLINDSANTES']:
|
if self.actions['BLINDSANTES']:
|
||||||
for act in self.actions['BLINDSANTES']:
|
for act in self.actions['BLINDSANTES']:
|
||||||
self.printActionLine(act, fh)
|
self.printActionLine(act, fh)
|
||||||
|
|
|
@ -43,11 +43,13 @@ import Configuration
|
||||||
import Stats
|
import Stats
|
||||||
import Mucked
|
import Mucked
|
||||||
import Database
|
import Database
|
||||||
import HUD_main
|
import HUD_main
|
||||||
|
import Utils
|
||||||
|
|
||||||
def importName(module_name, name):
|
def importName(module_name, name, params):
|
||||||
"""Import a named object 'name' from module 'module_name'."""
|
"""Import a named object 'name' from module 'module_name'."""
|
||||||
# Recipe 16.3 in the Python Cookbook, 2nd ed. Thanks!!!!
|
# Recipe 16.3 in the Python Cookbook, 2nd ed. Thanks!!!!
|
||||||
|
# Modded by Carl G to support additional params
|
||||||
try:
|
try:
|
||||||
module = __import__(module_name, globals(), locals(), [name])
|
module = __import__(module_name, globals(), locals(), [name])
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -33,8 +33,6 @@ import fpdb_simple
|
||||||
import fpdb_db
|
import fpdb_db
|
||||||
import fpdb_parse_logic
|
import fpdb_parse_logic
|
||||||
import Configuration
|
import Configuration
|
||||||
import EverleafToFpdb
|
|
||||||
import FulltiltToFpdb
|
|
||||||
|
|
||||||
# database interface modules
|
# database interface modules
|
||||||
try:
|
try:
|
||||||
|
@ -228,7 +226,6 @@ class Importer:
|
||||||
conv = None
|
conv = None
|
||||||
# Load filter, process file, pass returned filename to import_fpdb_file
|
# Load filter, process file, pass returned filename to import_fpdb_file
|
||||||
|
|
||||||
# TODO: Shouldn't we be able to use some sort of lambda or something to just call a Python object by whatever name we specify? then we don't have to hardcode them,
|
|
||||||
print "converting %s" % file
|
print "converting %s" % file
|
||||||
hhbase = self.config.get_import_parameters().get("hhArchiveBase")
|
hhbase = self.config.get_import_parameters().get("hhArchiveBase")
|
||||||
hhbase = os.path.expanduser(hhbase)
|
hhbase = os.path.expanduser(hhbase)
|
||||||
|
@ -238,21 +235,22 @@ class Importer:
|
||||||
except:
|
except:
|
||||||
out_path = os.path.join(hhdir, "x"+strftime("%d-%m-%y")+os.path.basename(file))
|
out_path = os.path.join(hhdir, "x"+strftime("%d-%m-%y")+os.path.basename(file))
|
||||||
|
|
||||||
# someone can just create their own python module for it
|
filter_name = filter.replace("ToFpdb", "")
|
||||||
if filter in ("EverleafToFpdb","Everleaf"):
|
|
||||||
conv = EverleafToFpdb.Everleaf(in_path = file, out_path = out_path)
|
mod = __import__(filter)
|
||||||
elif filter == "FulltiltToFpdb":
|
obj = getattr(mod, filter_name, None)
|
||||||
conv = FulltiltToFpdb.FullTilt(in_path = file, out_path = out_path)
|
if callable(obj):
|
||||||
|
conv = obj(in_path = file, out_path = out_path)
|
||||||
|
if(conv.getStatus()):
|
||||||
|
(stored, duplicates, partial, errors, ttime) = self.import_fpdb_file(out_path, site)
|
||||||
|
else:
|
||||||
|
# conversion didn't work
|
||||||
|
# TODO: appropriate response?
|
||||||
|
return (0, 0, 0, 1, 0)
|
||||||
else:
|
else:
|
||||||
print "Unknown filter ", filter
|
print "Unknown filter filter_name:'%s' in filter:'%s'" %(filter_name, filter)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(conv.getStatus()):
|
|
||||||
(stored, duplicates, partial, errors, ttime) = self.import_fpdb_file(out_path, site)
|
|
||||||
else:
|
|
||||||
# conversion didn't work
|
|
||||||
# TODO: appropriate response?
|
|
||||||
return (0, 0, 0, 1, 0)
|
|
||||||
|
|
||||||
#This will barf if conv.getStatus != True
|
#This will barf if conv.getStatus != True
|
||||||
return (stored, duplicates, partial, errors, ttime)
|
return (stored, duplicates, partial, errors, ttime)
|
||||||
|
|
|
@ -31,7 +31,7 @@ Blinds 10/20 NL Hold'em - 2009/02/25 - 17:30:32
|
||||||
Table 2
|
Table 2
|
||||||
Seat 1 is the button
|
Seat 1 is the button
|
||||||
Total number of players: 10""",
|
Total number of players: 10""",
|
||||||
{'type':'ring', 'base':"hold", 'category':'holdem', 'limitType':'nl', 'sb':'10', 'bb':'20', 'currency':'T$'}),
|
{'type':'tour', 'base':"hold", 'category':'holdem', 'limitType':'nl', 'sb':'10', 'bb':'20', 'currency':'T$'}),
|
||||||
|
|
||||||
("""Everleaf Gaming Game #65087798
|
("""Everleaf Gaming Game #65087798
|
||||||
***** Hand history for game #65087798 *****
|
***** Hand history for game #65087798 *****
|
||||||
|
@ -43,7 +43,7 @@ Table Plymouth""",
|
||||||
***** Hand history for game #65295370 *****
|
***** Hand history for game #65295370 *****
|
||||||
Blinds $0.50/$1 PL Omaha - 2008/12/07 - 21:59:48
|
Blinds $0.50/$1 PL Omaha - 2008/12/07 - 21:59:48
|
||||||
Table Guanajuato""",
|
Table Guanajuato""",
|
||||||
{'type':'ring', 'base':'hold', 'category':'omahahi', 'limitType':'pl', 'sb':'0.50', 'bb':'1','currency':'USD'})
|
{'type':'ring', 'base':'hold', 'category':'omahahi', 'limitType':'pl', 'sb':'0.50', 'bb':'1','currency':'USD'}),
|
||||||
|
|
||||||
)
|
)
|
||||||
for (header, info) in pairs:
|
for (header, info) in pairs:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user