#!/usr/bin/env python3.4 from flask import Flask from werkzeug.contrib.cache import SimpleCache import mediabrowser import os import logging from argparse import ArgumentParser logging.basicConfig(level=logging.INFO) if __name__ == "__main__": parser = ArgumentParser(description="Flask Mediabrowser") parser.add_argument("--root", metavar="DIR", required=True, help="Media collection root directory") args = parser.parse_args() cache = SimpleCache(threshold=5000, default_timeout=60*60*5) app = Flask("mediabrowser-demo") app.register_blueprint(mediabrowser.build(args.root, cache)) app.run(debug=True)