many not really separable changes for IMAP import and associated cleaning

- deactivated use of TourneySummary (short: TS) from HHC and subclasses
- menu entry for IMAP import
- converted ImapSummaries (short: IS) to use the config file
- IS now optionally supports non-SSL and can run on folders other than INBOX
- removed gametypes and getGameTypeAsString from TS method as identical one is in Hand
- some other stuff
This commit is contained in:
steffen123
2010-07-08 19:46:25 +02:00
parent aeaac92fb9
commit c6b6f8a788
9 changed files with 72 additions and 42 deletions
+13 -8
View File
@@ -23,16 +23,11 @@ from PokerStarsToFpdb import PokerStars
from TourneySummary import *
class PokerStarsSummary(TourneySummary):
sitename = "PokerStars"
siteId = 2
#limits = PokerStars.limits
#games = PokerStars.games
# = PokerStars.
re_TourNo = re.compile("\#[0-9]+,")
re_Entries = re.compile("[0-9]+")
re_Prizepool = re.compile("\$[0-9]+\.[0-9]+")
re_Player = re.compile("""(?P<RANK>[0-9]+):\s(?P<NAME>.*)\s\(.*\),(\s\$(?P<WINNINGS>[0-9]+\.[0-9]+)\s\()?""")
re_Player = re.compile(u"""(?P<RANK>[0-9]+):\s(?P<NAME>.*)\s\(.*\),(\s\$(?P<WINNINGS>[0-9]+\.[0-9]+)\s\()?""")
re_BuyInFee = re.compile("(?P<BUYIN>[0-9]+\.[0-9]+).*(?P<FEE>[0-9]+\.[0-9]+)")
# = re.compile("")
def parseSummary(self):
@@ -40,7 +35,17 @@ class PokerStarsSummary(TourneySummary):
self.tourNo = self.re_TourNo.findall(lines[0])[0][1:-1] #ignore game and limit type as thats not recorded
#ignore lines[1] as buyin/fee are already recorded by HHC
if lines[1].find("$")!=-1:
self.currency="USD"
elif lines[1].find(u"")!=-1:
self.currency="EUR"
else:
raise fpdbParseError("didn't recognise buyin currency")
result=self.re_BuyInFee.search(lines[1])
result=result.groupdict()
self.buyin=int(100*Decimal(result['BUYIN']))
self.fee=int(100*Decimal(result['FEE']))
self.entries = self.re_Entries.findall(lines[2])[0]