コード例 #1
0
def add_file_to_displayed_files(afile):
    configuration = Configuration()
    displayed_files = configuration.get('displayed_files')
    if afile not in displayed_files:
        displayed_files.append(afile)
    configuration.set('displayed_files', displayed_files)
    configuration.save()
コード例 #2
0
def get_displayed_files(config_file=None):
    configuration = Configuration(config_file)
    displayed_files = configuration.get('displayed_files')
    all_files = get_all_files()
    print('%s / %s' % (len(displayed_files), len(all_files)))
    if len(displayed_files) >= len(all_files):
        displayed_files = []
        configuration.set('displayed_files', displayed_files)
        configuration.save()
    return displayed_files