def parse_stream_names(spec): info = TrackInfo() if spec: tracks = parse_int_string(spec[0]) names = [''] * len(tracks) if len(spec) > 1: tokens = csv_split(spec[1]) names[0:len(tokens)] = tokens for t, n in zip(tracks, names): info.add_track(t, n) return info
def parse_episode_numbers(number_spec): tokens = csv_split(number_spec) tokens = [int(t) for t in tokens] # Throw away any extra specified items in the list beyond the number of # expected dvd titles if len(tokens) > len(dvd_titles): tokens = tokens[0:len(dvd_titles)] elif len(tokens) > 0: num = tokens[-1] + 1 for i in range(len(tokens), len(dvd_titles)): numbers[i] = num num += 1 else: return numbers[0:len(tokens)] = tokens
def parse_episode_names(number_spec): tokens = csv_split(number_spec) if len(tokens) > len(dvd_titles): tokens = tokens[0:len(dvd_titles)] names[0:len(tokens)] = tokens