def __init__(self): self.logFile = Configures.DownloadLogFile if not os.path.exists(self.logFile): write_into_disk(self.logFile, wrap_datas([])) try: self.infosList = parse_json_file(self.logFile) except: self.infosList = []
def fill_list(self, listName): self.listName = listName self.set_current_row(-1) self.playlistFile = composite_playlist_path_use_name(listName) if not os.path.exists(self.playlistFile): print('列表"%s"不存在' % listName) self.clear_list() self.listName = '' self.playlistFile = '' return try: self.get_value_from_dict(parse_json_file(self.playlistFile)) except ValueError: self.clear_list() print('加载列表内容出错!')
def fill_list(self, listName): self.listName = listName self.set_current_row(-1) self.playlistFile = composite_playlist_path_use_name(listName) if not os.path.exists(self.playlistFile): print('列表"%s"不存在'%listName) self.clear_list() self.listName = '' self.playlistFile = '' return try: self.get_value_from_dict(parse_json_file(self.playlistFile)) except ValueError: self.clear_list() print('加载列表内容出错!')
def read_infos_from_file(self): if not os.path.exists(Configures.SonginfosManager): self.commit_records() else: self.songInfos = parse_json_file(Configures.SonginfosManager)
def get_list_names_from_file(self): if not os.path.exists(Configures.PlaylistsManager): write_into_disk(Configures.PlaylistsManager, wrap_datas()) return Configures.BasicPlaylists return tuple(parse_json_file(Configures.PlaylistsManager))