p90 - release script renames HUD_config.xml.example so user doesnt have to

fixed a couple of stupid errors where i used the wrong siteID somehow
graph now lets you pick beteen PS and FTP
This commit is contained in:
steffen123 2008-09-21 23:38:22 +01:00
parent 7ed7db3791
commit 8c6cecb8f7
5 changed files with 40 additions and 11 deletions

View File

@ -24,7 +24,7 @@ cp -R docs fpdb-$1/
cp -R packaging fpdb-$1/
cp -R pyfpdb fpdb-$1/
rm fpdb-$1/pyfpdb/HUD_config.*
cp pyfpdb/HUD_config.xml.example fpdb-$1/pyfpdb/
cp pyfpdb/HUD_config.xml.example fpdb-$1/pyfpdb/HUD_config.xml
cp -R regression-test fpdb-$1/
cp -R utils fpdb-$1/

View File

@ -3,8 +3,9 @@ Please also see db-todo.txt
alpha4 (release 25Sep-2Oct)
======
graph: update dependencies.txt, select site from drop down
graph: update dependencies.txt, select site from drop down, doesnt remove old graph on refresh
print a "press any key" thing after we print the traceback. That way it is easy for them to see the error message.
reading small blind wrong for PS 25/50ct
check we're reading mucked cards from PS
newsletter&mailing list
update requirements to include new pgsql interface lib

View File

@ -41,15 +41,27 @@ class GuiGraphViewer (threading.Thread):
def showClicked(self, widget, data):
name=self.nameTBuffer.get_text(self.nameTBuffer.get_start_iter(), self.nameTBuffer.get_end_iter())
site=self.siteTBuffer.get_text(self.siteTBuffer.get_start_iter(), self.siteTBuffer.get_end_iter())
if site=="PS":
site=1
elif site=="FTP":
site=2
else:
print "invalid text in site selection in graph, defaulting to PS"
site=1
#print "site:", site
self.fig = Figure(figsize=(5,4), dpi=100)
self.ax = self.fig.add_subplot(111)
# x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
# y = [2.7, 2.8, 31.4, 38.1, 58.0, 76.2, 100.5, 130.0, 149.3, 180.0]
self.cursor.execute("""SELECT handId, winnings FROM HandsPlayers
self.cursor.execute("""SELECT handId, winnings FROM HandsPlayers
INNER JOIN Players ON HandsPlayers.playerId = Players.id
INNER JOIN Hands ON Hands.id = HandsPlayers.handId
WHERE Players.name = %s ORDER BY siteHandNo""", (name, ))
WHERE Players.name = %s AND Players.siteId = %s
ORDER BY siteHandNo""", (name, site))
winnings = self.db.cursor.fetchall()
@ -64,7 +76,7 @@ class GuiGraphViewer (threading.Thread):
self.cursor.execute("""SELECT SUM(amount) FROM HandsActions
INNER JOIN HandsPlayers ON HandsActions.handPlayerId = HandsPlayers.id
INNER JOIN Players ON HandsPlayers.playerId = Players.id
WHERE Players.name = %s AND HandsPlayers.handId = %s""", (name, winnings[i][0]))
WHERE Players.name = %s AND HandsPlayers.handId = %s AND Players.siteId = %s""", (name, winnings[i][0], site))
spent = self.db.cursor.fetchone()
profit[i]=(i, winnings[i][1]-spent[0])
@ -110,9 +122,19 @@ class GuiGraphViewer (threading.Thread):
self.settingsHBox.pack_start(self.nameTView)
self.nameTView.show()
self.siteLabel = gtk.Label("Site (PS or FTP):")
self.settingsHBox.pack_start(self.siteLabel)
self.siteLabel.show()
self.siteTBuffer=gtk.TextBuffer()
self.siteTBuffer.set_text("PS")
self.siteTView=gtk.TextView(self.siteTBuffer)
self.settingsHBox.pack_start(self.siteTView)
self.siteTView.show()
self.showButton=gtk.Button("Show/Refresh")
self.showButton.connect("clicked", self.showClicked, "show clicked")
self.settingsHBox.add(self.showButton)
self.settingsHBox.pack_start(self.showButton)
self.showButton.show()
#end of GuiGraphViewer.__init__

View File

@ -36,6 +36,7 @@ def mainParser(db, cursor, site, category, hand):
siteHandNo=fpdb_simple.parseSiteHandNo(hand[0])
handStartTime=fpdb_simple.parseHandStartTime(hand[0], site)
siteID=fpdb_simple.recogniseSiteID(cursor, site)
#print "parse logic, siteID:",siteID,"site:",site
isTourney=fpdb_simple.isTourney(hand[0])
gametypeID=fpdb_simple.recogniseGametypeID(cursor, hand[0], siteID, category, isTourney)

View File

@ -983,14 +983,15 @@ def recogniseGametypeID(cursor, topline, site_id, category, isTourney):#todo: th
pos1=pos2+2
if isTourney:
pos1-=1
if (site_id==1): #ftp
if (site_id==2): #ftp
pos2=topline.find(" ", pos1)
elif (site_id==2): #ps
elif (site_id==1): #ps
pos2=topline.find(")")
if pos2<=pos1:
pos2=topline.find(")", pos1)
#pos2-=1
if isTourney:
big_bet=int(topline[pos1:pos2])
@ -1121,9 +1122,13 @@ def recogniseSite(line):
#returns the ID of the given site
def recogniseSiteID(cursor, site):
if (site=="ftp"):
cursor.execute("SELECT id FROM Sites WHERE name = ('Full Tilt Poker')")
return 2
#cursor.execute("SELECT id FROM Sites WHERE name = ('Full Tilt Poker')")
elif (site=="ps"):
cursor.execute("SELECT id FROM Sites WHERE name = ('PokerStars')")
return 1
#cursor.execute("SELECT id FROM Sites WHERE name = ('PokerStars')")
else:
raise FpdbError("invalid site in recogniseSiteID: "+site)
return cursor.fetchall()[0][0]
#end def recogniseSiteID