Skip to content

Commit

Permalink
changed open collection handler from askdirectory to askopenfile
Browse files Browse the repository at this point in the history
  • Loading branch information
westphallm1 committed Apr 27, 2018
1 parent b88882b commit ee5ee97
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions specdal/gui/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
from tkinter.colorchooser import askcolor
import numpy as np
import pandas as pd
import matplotlib
Expand Down Expand Up @@ -557,7 +556,15 @@ def set_collection(self, collection):
self.update_list()

def read_dir(self):
directory = os.path.split(filedialog.askopenfilename())[0]
try:
directory = os.path.split(filedialog.askopenfilename(
filetypes=(
("Supported types","*.asd *.sed *.sig *.pico"),
("All files","*"),
)
))[0]
except:
return
if not directory:
return
c = Collection(name="collection", directory=directory)
Expand Down

0 comments on commit ee5ee97

Please sign in to comment.