def __init__(self, tool_name=None, master=None):
    if (platform.system() == 'Windows'):
        self.ext = '.exe'
    else:
        self.ext = ''
    exe_name = 'whitebox_tools{}'.format(self.ext)
    self.exe_path = path.dirname(path.abspath(__file__))
    os.chdir(self.exe_path)
    for filename in glob.iglob('**/*', recursive=True):
        if filename.endswith(exe_name):
            self.exe_path = path.dirname(path.abspath(filename))
            break
    wbt.set_whitebox_dir(self.exe_path)
    ttk.Frame.__init__(self, master)
    self.script_dir = os.path.dirname(os.path.realpath(__file__))
    self.grid()
    self.tool_name = tool_name
    self.master.title('WhiteboxTools Runner')
    if (_platform == 'darwin'):
        os.system('/usr/bin/osascript -e \'tell app "Finder" to set frontmost of process "Python" to true\' ')
    self.create_widgets()
    self.working_dir = str(Path.home())
def __init__(self, tool_name=None, master=None):
    if (platform.system() == 'Windows'):
        self.ext = '.exe'
    else:
        self.ext = 
    exe_name = 'whitebox_tools{}'.format(self.ext)
    self.exe_path = path.dirname(path.abspath(__file__))
    os.chdir(self.exe_path)
    for filename in glob.iglob('**/*', recursive=True):
        if filename.endswith(exe_name):
            self.exe_path = path.dirname(path.abspath(filename))
            break
    wbt.set_whitebox_dir(self.exe_path)
    ttk.Frame.__init__(self, master)
    self.script_dir = os.path.dirname(os.path.realpath(__file__))
    self.grid()
    self.tool_name = tool_name
    self.master.title('WhiteboxTools Runner')
    if (_platform == 'darwin'):
        os.system('/usr/bin/osascript -e \'tell app "Finder" to set frontmost of process "Python" to true\' ')
    self.create_widgets()
    self.working_dir = str(Path.home())