def Ad_scores(Game): #voir si on a pas eu un submit pour les choix sur les stats if request.method == 'POST': NUM_SCORE = request.form['NUMBER'] ORDER = request.form['ORDER'] else: NUM_SCORE = 5 ORDER = 'Score' cur = mysql.connection.cursor() #executer la requet, CAST sert à changer le type des variables de la colonne result = cur.execute( f"SELECT *, CAST(@r:=@r+1 AS SIGNED INTEGER) AS rnk FROM Scores, (SELECT @r:=0 ) AS r WHERE Jeux = '{Game}' ORDER BY {ORDER} DESC LIMIT " + str(NUM_SCORE)) Scores = cur.fetchall() plotHist([Scores[i]['Score'] for i in range(len(Scores))], Game) cur.close() if result == 0: error = '404 error' return render_template('home.html', error=error) else: return render_template( 'advanced_scores.html', Scores=Scores, len=len(Scores), max=max([Scores[i]['Score'] for i in range(len(Scores))]))
def _init_ctrls(self, parent): fnb.FlatNotebook.__init__(self, id=wxID_TABPLOTS, name=u'tabPlots', parent=parent, pos=wx.Point(0, 0), size=wx.Size(491, 288), agwStyle=fnb.FNB_NODRAG | fnb.FNB_HIDE_TABS) # style |= fnb.FNB_HIDE_TABS # self.book.SetAGWWindowStyleFlag(style) self.pltTS = plotTimeSeries.plotTimeSeries(id=wxID_PAGETIMESERIES, name='pltTS', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltTS, 'TimeSeries') self.pltProb = plotProbability.plotProb(id=wxID_PAGEPROB, name='pltProb', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltProb, 'Probablity') self.pltHist = plotHistogram.plotHist(id=wxID_PAGEHIST, name='pltHist', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltHist, 'Histogram') self.pltBox = plotBoxWhisker.PlotBox(id=wxID_PAGEBOX, name='pltBox', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltBox, 'Box/Whisker') self.pltSum = plotSummary.plotSummary(id=wxID_PAGESUMMARY, name=u'pltSum', parent=self, pos=wx.Point(784, 256), size=wx.Size(437, 477), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltSum, 'Summary') self._seriesPlotInfo = None self.editID = None self.legendVisible = False
def _init_ctrls(self, parent): fnb.FlatNotebook.__init__(self, id=wxID_TABPLOTS, name=u'tabPlots', parent=parent, pos=wx.Point(0, 0), size=wx.Size(491, 288), agwStyle=fnb.FNB_NODRAG | fnb.FNB_HIDE_TABS) # style |= fnb.FNB_HIDE_TABS # self.book.SetAGWWindowStyleFlag(style) self.pltTS = plotTimeSeries.plotTimeSeries(id=wxID_PAGETIMESERIES, name='pltTS', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltTS, 'TimeSeries') self.pltProb = plotProbability.plotProb(id=wxID_PAGEPROB, name='pltProb', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltProb, 'Probablity') self.pltHist = plotHistogram.plotHist(id=wxID_PAGEHIST, name='pltHist', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltHist, 'Histogram') self.pltBox = plotBoxWhisker.plotBox(id=wxID_PAGEBOX, name='pltBox', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltBox, 'Box/Whisker') self.pltSum = plotSummary.plotSummary( id = wxID_PAGESUMMARY, name=u'pltSum', parent=self, pos=wx.Point(784, 256), size=wx.Size(437, 477), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltSum, 'Summary') Publisher.subscribe(self.onDateChanged, ("onDateChanged")) Publisher.subscribe(self.OnPlotType, ("onPlotType")) Publisher.subscribe(self.OnShowLegend, ("OnShowLegend")) Publisher.subscribe(self.OnNumBins, ("OnNumBins")) Publisher.subscribe(self.OnRemovePlot, ("removePlot")) Publisher.subscribe(self.OnChangeSelection, ("changePlotSelection")) Publisher.subscribe(self.OnChangeSelectionDT, ("changePlotSelectionDT")) Publisher.subscribe(self.onUpdateValues, ("updateValues")) self.selectedSerieslist = [] self._seriesPlotInfo= None self.editID = None
def _init_ctrls(self, parent): fnb.FlatNotebook.__init__(self, id=wxID_TABPLOTS, name=u'tabPlots', parent=parent, pos=wx.Point(0, 0), size=wx.Size(491, 288), agwStyle=fnb.FNB_NODRAG | fnb.FNB_HIDE_TABS) # style |= fnb.FNB_HIDE_TABS # self.book.SetAGWWindowStyleFlag(style) self.pltTS = plotTimeSeries.plotTimeSeries(id=wxID_PAGETIMESERIES, name='pltTS', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltTS, 'TimeSeries') self.pltProb = plotProbability.plotProb(id=wxID_PAGEPROB, name='pltProb', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltProb, 'Probablity') self.pltHist = plotHistogram.plotHist(id=wxID_PAGEHIST, name='pltHist', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltHist, 'Histogram') self.pltBox = plotBoxWhisker.plotBox(id=wxID_PAGEBOX, name='pltBox', parent=self, pos=wx.Point(0, 0), size=wx.Size(605, 458), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltBox, 'Box/Whisker') self.pltSum = plotSummary.plotSummary(id=wxID_PAGESUMMARY, name=u'pltSum', parent=self, pos=wx.Point(784, 256), size=wx.Size(437, 477), style=wx.TAB_TRAVERSAL) self.AddPage(self.pltSum, 'Summary') Publisher.subscribe(self.onDateChanged, ("onDateChanged")) Publisher.subscribe(self.OnPlotType, ("onPlotType")) Publisher.subscribe(self.OnShowLegend, ("OnShowLegend")) Publisher.subscribe(self.OnNumBins, ("OnNumBins")) Publisher.subscribe(self.OnRemovePlot, ("removePlot")) Publisher.subscribe(self.OnChangeSelection, ("changePlotSelection")) Publisher.subscribe(self.OnChangeSelectionDT, ("changePlotSelectionDT")) Publisher.subscribe(self.onUpdateValues, ("updateValues")) self.selectedSerieslist = [] self._seriesPlotInfo = None self.editID = None