示例#1
0
def home_post():
    startdate = request.form['startdate']
    enddate = request.form['enddate']
    feeder_start = request.form['feeder_start']
    feeder_end = request.form['feeder_end']
    result = get_stats(startdate, enddate, feeder_start, feeder_end)
    # result = fake_result(startdate, enddate, feeder_start, feeder_end)
    return render_template('index.html', result=result)
示例#2
0
    def start_by_click(self, master):
        pb = ProgressBar()
        pb.start()
        self._run = True
        thread.start_new_thread(self.run_parse, ())

        while self._run:
            pb.update()
            sleep(1)

        self._run = True
        pb.reset()

        tot = self._cats._total
        self._finalxml = main.get_stats(self._cats)
        thread.start_new_thread(self.run_stats, ())

        while self._run:
            pb.update_exact(self._finalxml._total / tot)
            sleep(1)

        pb.stop()
        w = Tkinter.Label(master,
                          text="Total Categories: " +
                          self._finalxml.get_total())
        w.pack()
        w = Tkinter.Label(master,
                          text="Categories not in database: " +
                          self._finalxml.get_unique())
        w.pack()
        w = Tkinter.Label(master,
                          text="Avg not in database categories per Article: " +
                          self._finalxml.get_avg())
        w.pack()
        w = Tkinter.Label(master,
                          text="Unique Categories: " +
                          self._finalxml.get_one_time_unique())
        w.pack()

        scrollbar = Tkinter.Scrollbar(master)
        scrollbar.pack(side=Tkconstants.RIGHT, fill=Tkconstants.Y)

        text = Tkinter.Text(master,
                            wrap=Tkconstants.WORD,
                            yscrollcommand=scrollbar.set)
        text.pack(fill=Tkconstants.BOTH, expand=1, side=Tkinter.BOTTOM)

        scrollbar.config(command=text.yview)

        textsearch = Tkinter.Text(master,
                                  height=1,
                                  width=1,
                                  wrap=Tkconstants.WORD)
        textsearch.pack(fill=Tkconstants.BOTH, expand=1, side=Tkinter.BOTTOM)
        textsearch.bind("<Return>", lambda x: self.search(textsearch, text))
示例#3
0
def on_chat(nick, message):
    if message == '!stats':
        flooding = False
        if not flooding:
            main.get_stats(nick)

    if message == '!top10':
        flooding = False
        flooding = f.floodprotection_top10(nick)
        if not flooding:
            main.get_top10()

    if message == '!top10kd':
        flooding = False
        flooding = f.floodprotection_top10kd(nick)
        if not flooding:
            main.get_top10kd()
        
    if message == '!help':
        main.get_help()
示例#4
0
    def start_by_click(self, master):
        pb = ProgressBar()
        pb.start()
        self._run = True
        thread.start_new_thread(self.run_parse, ())

        while self._run:
            pb.update()
            sleep(1)

        self._run = True
        pb.reset()

        tot = self._cats._total
        self._finalxml = main.get_stats(self._cats)
        thread.start_new_thread(self.run_stats, ())

        while self._run:
            pb.update_exact(self._finalxml._total / tot)
            sleep(1)

        pb.stop()
        w = Tkinter.Label(master, text="Total Categories: " + self._finalxml.get_total())
        w.pack()
        w = Tkinter.Label(master, text="Categories not in database: " + self._finalxml.get_unique())
        w.pack()
        w = Tkinter.Label(master, text="Avg not in database categories per Article: " + self._finalxml.get_avg())
        w.pack()
        w = Tkinter.Label(master, text="Unique Categories: " + self._finalxml.get_one_time_unique())
        w.pack()

        scrollbar = Tkinter.Scrollbar(master)
        scrollbar.pack(side=Tkconstants.RIGHT, fill=Tkconstants.Y)

        text = Tkinter.Text(master, wrap=Tkconstants.WORD, yscrollcommand=scrollbar.set)
        text.pack(fill=Tkconstants.BOTH, expand=1, side=Tkinter.BOTTOM)

        scrollbar.config(command=text.yview)

        textsearch = Tkinter.Text(master, height=1, width=1, wrap=Tkconstants.WORD)
        textsearch.pack(fill=Tkconstants.BOTH, expand=1, side=Tkinter.BOTTOM)
        textsearch.bind("<Return>", lambda x: self.search(textsearch, text))
示例#5
0
def hello():
    club = str(request.args.get('club')) or ""
    stats = get_stats(club)
    json_stats = jsonpickle.encode(stats)
    return json_stats
    pass