Beispiel #1
0
    def go(cls):
        django.setup()
        # configure logging
        cls._configure_logging()

        # create pidfile, exit if creation fails
        handle_pidfile(os.path.join(COLLECTION_PHYS_ROOT, '.meta', 'gallery_runner.pid'))

        Rotator.perform_requested_rotations()
        TrashCleaner.remove_old_trash_files()
        Linker.create_links()

        indexer = Indexer()
        for (root, dirs, files) in collection_walk():
            renamed = Renamer(root, files).rename_jpgs_in_collection()
            Thumbnailer.synchronize_miniatures_with_collection(root, dirs, renamed)
            indexer.synchronize_db_with_collection(root, dirs, renamed)

        Thumbnailer.remove_obsolete()
        indexer.post_indexing_fixes()
        indexer.process_pending_removals()