Merge branch 'master' of git://git.assembla.com/fpdboz.git
Conflicts: pyfpdb/Hud.py
This commit is contained in:
		
						commit
						6eb489c3a5
					
				
							
								
								
									
										
											BIN
										
									
								
								pyfpdb/HandHistoryConverter.pyc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								pyfpdb/HandHistoryConverter.pyc
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -45,10 +45,10 @@ import Mucked
 | 
			
		|||
import Database
 | 
			
		||||
import HUD_main
 | 
			
		||||
 | 
			
		||||
def importName(module_name, name, *params):
 | 
			
		||||
def importName(module_name, name):
 | 
			
		||||
    """Import a named object 'name' from module 'module_name'."""
 | 
			
		||||
#    Recipe 16.3 in the Python Cookbook, 2nd ed.  Thanks!!!!
 | 
			
		||||
# Modded by Carl G to support additional params
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
        module = __import__(module_name, globals(), locals(), [name])
 | 
			
		||||
    except:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -69,7 +69,7 @@ from HandHistoryConverter import *
 | 
			
		|||
class PokerStars(HandHistoryConverter):
 | 
			
		||||
    
 | 
			
		||||
    # Static regexes
 | 
			
		||||
    re_GameInfo     = re.compile('PokerStars Game #(?P<HID>[0-9]+):\s+(HORSE)? \(?(?P<GAME>Hold\'em|Razz|7 Card Stud|Omaha Hi/Lo) (?P<LIMIT>No Limit|Limit|Pot Limit),? \(?(?P<CURRENCY>\$|)?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+)\) - (?P<DATETIME>.*$)', re.MULTILINE)
 | 
			
		||||
    re_GameInfo     = re.compile("PokerStars Game #(?P<HID>[0-9]+):\s+(HORSE)? \(?(?P<GAME>Hold\'em|Razz|7 Card Stud|Omaha Hi/Lo|Badugi) (?P<LIMIT>No Limit|Limit|Pot Limit),? \(?(?P<CURRENCY>\$|)?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+)\) - (?P<DATETIME>.*$)", re.MULTILINE)
 | 
			
		||||
    re_SplitHands   = re.compile('\n\n+')
 | 
			
		||||
    re_HandInfo     = re.compile("^Table \'(?P<TABLE>[- a-zA-Z]+)\'(?P<TABLEATTRIBUTES>.+?$)?", re.MULTILINE)
 | 
			
		||||
    re_Button       = re.compile('Seat #(?P<BUTTON>\d+) is the button', re.MULTILINE)
 | 
			
		||||
| 
						 | 
				
			
			@ -129,7 +129,8 @@ follow :  whether to tail -f the input"""
 | 
			
		|||
                 'Omaha Hi' : ('hold','omahahi'),
 | 
			
		||||
              'Omaha Hi/Lo' : ('hold','omahahilo'),
 | 
			
		||||
                     'Razz' : ('stud','razz'), 
 | 
			
		||||
              '7 Card Stud' : ('stud','studhi')
 | 
			
		||||
              '7 Card Stud' : ('stud','studhi'),
 | 
			
		||||
                   'Badugi' : ('draw','badugi')
 | 
			
		||||
               }
 | 
			
		||||
        currencies = { u'€':'EUR', '$':'USD', '':'T$' }
 | 
			
		||||
        if 'LIMIT' in mg:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -228,7 +228,6 @@ class Importer:
 | 
			
		|||
            conv = None
 | 
			
		||||
            # 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
 | 
			
		||||
            hhbase    = self.config.get_import_parameters().get("hhArchiveBase")
 | 
			
		||||
            hhbase    = os.path.expanduser(hhbase)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ def checkGameInfo(hhc, header, info):
 | 
			
		|||
    assert hhc.determineGameType(header) == info
 | 
			
		||||
 | 
			
		||||
def testGameInfo():
 | 
			
		||||
    hhc = FulltiltToFpdb.FullTilt(autostart=False)    
 | 
			
		||||
    hhc = FulltiltToFpdb.Fulltilt(autostart=False)
 | 
			
		||||
    pairs = (
 | 
			
		||||
    ("Full Tilt Poker Game #10777181585: Table Deerfly (deep 6) - $0.01/$0.02 - Pot Limit Omaha Hi - 2:24:44 ET - 2009/02/22",
 | 
			
		||||
            {'type':'ring', 'base':'hold', 'category':'omahahi', 'limitType':'pl', 'sb':'0.01', 'bb':'0.02', 'currency':'USD'}),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,7 +13,10 @@ def testGameInfo():
 | 
			
		|||
    {'type':'ring', 'base':"hold", 'category':'holdem', 'limitType':'nl', 'sb':'1', 'bb':'2', 'currency':'USD'}),
 | 
			
		||||
         
 | 
			
		||||
    (u"PokerStars Game #5999635897:  HORSE (Omaha Hi/Lo Limit, $2/$4) - 2006/08/21 - 13:59:19 (ET)",
 | 
			
		||||
    {'type':'ring', 'base':'hold', 'category':'omahahilo', 'limitType':'fl', 'sb':'2', 'bb':'4','currency':'USD'})
 | 
			
		||||
    {'type':'ring', 'base':'hold', 'category':'omahahilo', 'limitType':'fl', 'sb':'2', 'bb':'4','currency':'USD'}),
 | 
			
		||||
 | 
			
		||||
    (u"PokerStars Game #25923772706:  Badugi Limit ($0.25/$0.50) - 2009/03/13 16:40:58 ET",
 | 
			
		||||
    {'type':'ring', 'base':'draw', 'category':'badugi', 'limitType':'fl', 'sb':'0.25', 'bb':'0.50','currency':'USD'})
 | 
			
		||||
    )
 | 
			
		||||
    for (header, info) in pairs:
 | 
			
		||||
        yield checkGameInfo, hhc, header, info
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user