def __init__(self, master):
        self.master = master
        self.emulator = None

        self.conf_dict = {}
        self.conf_name = tk.StringVar()
        self.conf_frame = None

        master.title("Wireless Network Reproduction")
        master.protocol("WM_DELETE_WINDOW", self.exit_func)

        # first check root privilege
        if os.getuid() != 0:
            self.master.withdraw()
            showerror('Privilege Error', 'You should run this program as root.')
            self.master.destroy()
            return

        # then find the current activate network interface
        self.iface = '<network device name>'
        self.decide_iface()
        self.default_rule = 'ip from any to any via %s' % self.iface

        self.inbound_list = []
        self.outbound_list = []
        self.filter_str = tk.StringVar(value=self.default_rule)
        self.proc_str = tk.StringVar(value=self.prompt_str)
        self.dev_str = tk.StringVar()
        self.dump_pos = tk.StringVar()
        self.divert_unknown = tk.IntVar(value=1)

        self.start_btn = None
        self.filter_entry = None
        self.proc_entry = None
        self.dev_entry = None
        self.mode = tk.IntVar(self.LOCAL_MODE)
        self.init_GUI()

        try:
            Emulator()
        except __HOLE__:
            def close_func():
                self.master.quit()
                self.master.destroy()
            self.master.withdraw()
            top = tk.Toplevel(self.master)
            top.title('Kernel Extension Error')
            tk.Message(top, text=self.kext_errmsg)\
                .pack(side=tk.TOP, fill=tk.BOTH, expand=True)
            tk.Button(top, text="Close", command=close_func).pack(side=tk.TOP)
            top.protocol("WM_DELETE_WINDOW", close_func)
        except Exception as e:
            self.master.withdraw()
            showerror('Emulator Loading Error', e.message)
            self.master.destroy()
dataset/ETHPy150Open FinalTheory/wireless-network-reproduction/macdivert/emulator.py/EmulatorGUI.__init__