def select_file(self):
    try:
        result = self.value.get()
        if (self.parameter_type == 'Directory'):
            result = filedialog.askdirectory(initialdir=self.runner.working_dir, title='Select directory')
        elif ('ExistingFile' in self.parameter_type):
            ftypes = [('All files', '*.*')]
            if ('RasterAndVector' in self.file_type):
                ftypes = [('Shapefiles', '*.shp'), ('Raster files', ('*.dep', '*.tif', '*.tiff', '*.bil', '*.flt', '*.sdat', '*.rdc', '*.asc'))]
            elif ('Raster' in self.file_type):
                ftypes = [('Raster files', ('*.dep', '*.tif', '*.tiff', '*.bil', '*.flt', '*.sdat', '*.rdc', '*.asc'))]
            elif ('Lidar' in self.file_type):
                ftypes = [('LiDAR files', ('*.las', '*.zlidar', '*.laz', '*.zip'))]
            elif ('Vector' in self.file_type):
                ftypes = [('Shapefiles', '*.shp')]
            elif ('Text' in self.file_type):
                ftypes = [('Text files', '*.txt'), ('all files', '*.*')]
            elif ('Csv' in self.file_type):
                ftypes = [('CSC files', '*.csv'), ('all files', '*.*')]
            elif ('Html' in self.file_type):
                ftypes = [('HTML files', '*.html')]
            result = filedialog.askopenfilename(initialdir=self.runner.working_dir, title='Select file', filetypes=ftypes)
        elif ('NewFile' in self.parameter_type):
            result = filedialog.asksaveasfilename()
        self.value.set(result)
        self.runner.working_dir = os.path.dirname(result)
    except:
        t = 'file'
        if (self.parameter_type == 'Directory'):
            t = 'directory'
        messagebox.showinfo('Warning', 'Could not find {}'.format(t))
def select_file(self):
    try:
        result = self.value.get()
        if (self.parameter_type == 'Directory'):
            result = filedialog.askdirectory(initialdir=self.runner.working_dir, title='Select directory')
        elif ('ExistingFile' in self.parameter_type):
            ftypes = [('All files', '*.*')]
            if ('RasterAndVector' in self.file_type):
                ftypes = [('Shapefiles', '*.shp'), ('Raster files', ('*.dep', '*.tif', '*.tiff', '*.bil', '*.flt', '*.sdat', '*.rdc', '*.asc'))]
            elif ('Raster' in self.file_type):
                ftypes = [('Raster files', ('*.dep', '*.tif', '*.tiff', '*.bil', '*.flt', '*.sdat', '*.rdc', '*.asc'))]
            elif ('Lidar' in self.file_type):
                ftypes = [('LiDAR files', ('*.las', '*.zlidar', '*.laz', '*.zip'))]
            elif ('Vector' in self.file_type):
                ftypes = [('Shapefiles', '*.shp')]
            elif ('Text' in self.file_type):
                ftypes = [('Text files', '*.txt'), ('all files', '*.*')]
            elif ('Csv' in self.file_type):
                ftypes = [('CSC files', '*.csv'), ('all files', '*.*')]
            elif ('Html' in self.file_type):
                ftypes = [('HTML files', '*.html')]
            result = filedialog.askopenfilename(initialdir=self.runner.working_dir, title='Select file', filetypes=ftypes)
        elif ('NewFile' in self.parameter_type):
            result = filedialog.asksaveasfilename()
        self.value.set(result)
        self.runner.working_dir = os.path.dirname(result)
    except:
        t = 'file'
        if (self.parameter_type == 'Directory'):
            t = 'directory'
        messagebox.showinfo('Warning', 'Could not find {}'.format(t))