sqlcoder initial updates

This commit is contained in:
sqlcoder
2008-12-02 00:15:50 +00:00
parent 5884f2f66b
commit a824814c0a
15 changed files with 2578 additions and 2334 deletions
+11 -7
View File
@@ -87,16 +87,20 @@ class GuiGraphViewer (threading.Thread):
#end of def showClicked
def getRingProfitGraph(self, name, site):
self.cursor.execute(self.sql.query['getRingWinningsAllGamesPlayerIdSite'], (name, site))
#self.cursor.execute(self.sql.query['getRingWinningsAllGamesPlayerIdSite'], (name, site))
self.cursor.execute(self.sql.query['getRingProfitAllHandsPlayerIdSite'], (name, site))
# returns (HandId,Winnings,Costs,Profit)
winnings = self.db.cursor.fetchall()
profit=range(len(winnings))
for i in profit:
self.cursor.execute(self.sql.query['getRingProfitFromHandId'], (name, winnings[i][0], site))
spent = self.db.cursor.fetchone()
profit[i]=(i, winnings[i][1]-spent[0])
#profit=range(len(winnings))
#for i in profit:
# self.cursor.execute(self.sql.query['getRingProfitFromHandId'], (name, winnings[i][0], site))
# spent = self.db.cursor.fetchone()
# profit[i]=(i, winnings[i][1]-spent[0])
#y=map(lambda x:float(x[1]), profit)
y=map(lambda x:float(x[3]), winnings)
y=map(lambda x:float(x[1]), profit)
line = cumsum(y)
return line/100
#end of def getRingProfitGraph