コード例 #1
0
ファイル: progress_dialog.py プロジェクト: astojmir/PFMFind
class ProgressDialog(Pmw.Dialog):
    def __init__(self, parent=None, **args):
        th = args.pop('toplevel_height', 200)
        tw = args.pop('toplevel_width', 400)
        ac = args.pop('activatecommand', None)
        self.no_bar = args.pop('nobar', False)
    
        Pmw.Dialog.__init__(self, parent, buttons=[],
                            activatecommand = ac)
        self.component('hull').overrideredirect(1)
        w = self.interior()
        w.pack_propagate(0)
        w.configure(bd=5, relief='raised', height=th, width=tw)
        self.text = args.pop('text', 'Progress bar')
        self.text_var = Tkinter.StringVar()
        self.text_var.set(self.text)
        Tkinter.Label(w, textvariable=self.text_var).pack(fill='y', expand=1)
        if not self.no_bar:
            self.pb = ProgressBar(w, **args)
            self.pb.pack(side='top', expand=1, anchor='n')
            self.counter = 0
            self.pb.updateProgress(self.counter)

    def incr(self):
        self.counter += 1
        self.pb.updateProgress(self.counter)

    def set(self, value, max=None):
        self.counter = value
        self.pb.updateProgress(self.counter, max)

    def message(self, text):
        self.text = text
        self.text_var.set(self.text)
コード例 #2
0
ファイル: automate.py プロジェクト: Wisienkas/gorobots_edu
                                                        "resultPath":
                                                        resultPath,
                                                        "savePath": savePath,
                                                        "numberOfHiddenUnits":
                                                        nhu,
                                                        "learningRate": lr,
                                                        "min": -0.2,
                                                        "max": 1.2,
                                                        "randomizePosition":
                                                        False,
                                                        "randomizeSTD": False,
                                                        "std": s,
                                                        "percentage_1": 33.33,
                                                        "percentage_2": 50.0,
                                                        "numberOfInputs": 1
                                                    })
                        p.start()
                        emgProcesses.append(p)

                    for p in emgProcesses:
                        p.join()

                    counter += 1
                    pb.updateProgress(counter)
                    selection2(resultPrefix, 10)

    printi("readErrors: " + str(readErrors))
    printi("Execution time: ~" + str(time.time() - t_0))

    printi("Done.")