def run(self):
latest_mtime = 0.0
while self.keep_running:
filename_to_open = None
possible_matches = glob.glob(self.source_panel.autoload_match_string)
if len(possible_matches) > 0:
for cur_match in possible_matches:
cur_match_mtime = os.path.getmtime(cur_match)
if cur_match_mtime > latest_mtime:
filename_to_open = cur_match
latest_mtime = cur_match_mtime
if filename_to_open is not None:
wx.CallAfter(pub.sendMessage, 'load-fits-file', msg=filename_to_open)
time.sleep(self.source_panel.autoload_pausetime)
if self.source_panel.autoload_mode != 'file-match':
self.keep_running = False
评论列表
文章目录