def afteropenfile(self, filename): if filename == "": # if user cancel select return self.main_window.setreplay(filename) mappath = get_right_map(filename) if mappath is not None: self.main_window.setmap(mappath)
def check_replay_map(self): if current_config[".osr path"] == "auto": return replay = get_latest_replay() if self.prevreplay == replay or replay is None: return self.prevreplay = replay self.setreplay(replay) mapset = get_right_map(replay) if mapset is None: return self.setmap(mapset)
def dropEvent(self, e): for url in e.mimeData().urls(): p = urlparse(url.url()) final_path = os.path.abspath(os.path.join(p.netloc, p.path)) if final_path.endswith(".osr"): self.setreplay(final_path) mapset = get_right_map(final_path) if mapset is not None: self.setmap(mapset) elif os.path.isdir(final_path): self.setmap(final_path) elif final_path.endswith(".osu"): if current_config[".osr path"] != "auto": final_path = os.path.dirname(final_path) self.setmap(final_path)