def load(self, path, filename, *args):
load_failed_popup = Popup(
title='Error while opening file', content=Label(
text='Please select a valid file'), size_hint=(
0.8, 0.2))
if filename == []:
self.dismiss_open_popup()
load_failed_popup.open()
else:
name, extension = os.path.splitext(filename[0])
if extension == [u'.mi2log'][0]:
self.loading_num = 2
self.loading_popup = Popup(
title='',
content=Label(
text='Loading.',
font_size=self.width / 25),
size_hint=(
0.3,
0.2),
separator_height=0,
title_size=0)
self.loading_popup.open()
Clock.schedule_interval(self.loading, 1)
Clock.unschedule(self.check_scroll_limit)
self.grid.clear_widgets()
with open(os.path.join(path, filename[0])) as stream:
t = Thread(
target=self.openFile,
args=(
os.path.join(
path,
filename[0]),
self.selectedTypes))
t.start()
self.dismiss_open_popup()
else:
self.dismiss_open_popup()
load_failed_popup.open()
评论列表
文章目录