flask-autoindex-20160725-02b454/0000755000175000017500000000000013153471104016063 5ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/0000755000175000017500000000000012771613504017234 5ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/blueprinttest/0000755000175000017500000000000012771613504022140 5ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/blueprinttest/__init__.py0000644000175000017500000000007513153471105024245 0ustar jonathanjonathanfrom flask import Blueprint bp = Blueprint('test', __name__) flask-autoindex-20160725-02b454/tests/static/0000755000175000017500000000000012771613504020523 5ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.txt0000644000175000017500000000000013153471116022225 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.wmv0000644000175000017500000000000013153471117022220 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.cpp0000644000175000017500000000000013153471107022170 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.less0000644000175000017500000000000013153471112022350 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.cfg0000644000175000017500000000000013153471106022144 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.hwp0000644000175000017500000000000013153471111022177 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.jpg0000644000175000017500000000000013153471112022162 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.js0000644000175000017500000000000013153471112022016 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.swf0000644000175000017500000000000013153471115022204 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.jpeg0000644000175000017500000000000013153471112022327 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.pkg0000644000175000017500000000000013153471114022165 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.exe0000644000175000017500000000000013153471110022161 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.mpa0000644000175000017500000000000013153471113022160 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.cgi0000644000175000017500000000000013153471107022150 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.vb0000644000175000017500000000000013153471116022015 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.avi0000644000175000017500000000000013153471106022164 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.applescript0000644000175000017500000000000013153471105023732 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.bat0000644000175000017500000000000013153471106022153 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.vcf0000644000175000017500000000000013153471116022164 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.cer0000644000175000017500000000000013153471106022156 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.pptx0000644000175000017500000000000013153471114022377 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.com0000644000175000017500000000000013153471107022164 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.mpeg0000644000175000017500000000000013153471113022333 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.smi0000644000175000017500000000000013153471115022175 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.xls0000644000175000017500000000000013153471117022215 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.rss0000644000175000017500000000000013153471114022213 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.iso0000644000175000017500000000000013153471111022173 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.bin0000644000175000017500000000000013153471106022155 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.ttf0000644000175000017500000000000013153471116022203 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.dmg0000644000175000017500000000000013153471110022147 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.docx0000644000175000017500000000000013153471110022335 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.markdown0000644000175000017500000000000013153471112023224 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.cur0000644000175000017500000000000013153471107022177 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.psd0000644000175000017500000000000013153471114022172 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.md0000644000175000017500000000000013153471112022002 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.mov0000644000175000017500000000000013153471113022204 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.gif0000644000175000017500000000000013153471110022145 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.rar0000644000175000017500000000000013153471114022170 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.tgz0000644000175000017500000000000013153471116022212 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.ini0000644000175000017500000000000013153471111022160 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.csv0000644000175000017500000000000013153471107022201 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.sql0000644000175000017500000000000013153471115022204 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.7z0000644000175000017500000000000013153471105021744 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.ico0000644000175000017500000000000013153471111022153 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.h0000644000175000017500000000000013153471111021630 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.app0000644000175000017500000000000013153471105022164 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.html0000644000175000017500000000000013153471111022345 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.pdf0000644000175000017500000000000013153471113022154 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.bak0000644000175000017500000000000013153471106022142 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.ai0000644000175000017500000000000013153471105021775 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.asp0000644000175000017500000000000013153471105022167 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.ics0000644000175000017500000000000013153471111022157 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.png0000644000175000017500000000000013153471114022170 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.alz0000644000175000017500000000000013153471105022172 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.doc0000644000175000017500000000000013153471110022145 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.py0000644000175000017500000000000013153471114022034 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.mid0000644000175000017500000000000013153471113022154 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.yml0000644000175000017500000000000013153471117022210 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.bmp0000644000175000017500000000000013153471106022163 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.log0000644000175000017500000000000013153471112022163 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.json0000644000175000017500000000000013153471112022353 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.db0000644000175000017500000000000013153471107021773 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.php0000644000175000017500000000000013153471113022172 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.java0000644000175000017500000000000013153471112022323 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.tar.gz0000644000175000017500000000000013153471115022612 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.xml0000644000175000017500000000000013153471117022207 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.bup0000644000175000017500000000000013153471106022173 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.mpg0000644000175000017500000000000013153471113022166 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.jsp0000644000175000017500000000000013153471112022176 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.htm0000644000175000017500000000000013153471111022171 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.conf0000644000175000017500000000000013153471107022333 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.dll0000644000175000017500000000000013153471110022153 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.flv0000644000175000017500000000000013153471110022167 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.css0000644000175000017500000000000013153471107022176 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.sh0000644000175000017500000000000013153471115022017 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/helloworld.txt0000644000175000017500000000001613153471105023426 0ustar jonathanjonathanHello, world! flask-autoindex-20160725-02b454/tests/static/test.eps0000644000175000017500000000000013153471110022167 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.xhtml0000644000175000017500000000000013153471117022543 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.c0000644000175000017500000000000013153471106021627 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.tmp0000644000175000017500000000000013153471116022206 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.vcd0000644000175000017500000000000013153471116022162 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.mp30000644000175000017500000000000013153471113022102 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.sys0000644000175000017500000000000013153471115022223 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.jar0000644000175000017500000000000013153471111022155 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.torrent0000644000175000017500000000000013153471116023103 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.wav0000644000175000017500000000000013153471117022204 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.xlsx0000644000175000017500000000000013153471117022405 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.rtf0000644000175000017500000000000013153471115022200 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.zip0000644000175000017500000000000013153471117022211 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.ppt0000644000175000017500000000000013153471114022207 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.rb0000644000175000017500000000000013153471114022007 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.toast0000644000175000017500000000000013153471116022540 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.tar0000644000175000017500000000000013153471115022173 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.mp40000644000175000017500000000000013153471113022103 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.xsl0000644000175000017500000000000013153471117022215 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.cpl0000644000175000017500000000000013153471107022164 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.tif0000644000175000017500000000000013153471116022170 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.cab0000644000175000017500000000000013153471106022132 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.fla0000644000175000017500000000000013153471110022142 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/static/test.svg0000644000175000017500000000000013153471115022204 0ustar jonathanjonathanflask-autoindex-20160725-02b454/tests/__init__.py0000644000175000017500000002346013153471104021343 0ustar jonathanjonathanfrom __future__ import absolute_import from future.builtins import bytes import mimetypes import os import sys import unittest from flask import * from flask_autoindex import * __file__ = __file__.replace('.pyc', '.py') browse_root = os.path.abspath(os.path.dirname(__file__)) if sys.version_info < (3,): b = lambda s: s else: b = lambda s: bytes(s, 'ascii') class RootDirectoryTestCase(unittest.TestCase): def setUp(self): self.rootdir = RootDirectory(browse_root) def test_root_dir(self): assert isinstance(self.rootdir, RootDirectory) assert self.rootdir.path == '.' assert os.path.samefile(self.rootdir.abspath, browse_root) assert os.path.isdir(self.rootdir.abspath) def test_init(self): assert isinstance(Directory(browse_root), RootDirectory) assert isinstance(Directory('.', self.rootdir), RootDirectory) assert isinstance(Entry(browse_root), RootDirectory) assert isinstance(Entry('.', self.rootdir), RootDirectory) def test_same_object(self): assert self.rootdir is RootDirectory(browse_root) assert self.rootdir is Directory(browse_root) assert self.rootdir is Directory('.', self.rootdir) assert self.rootdir is Entry(browse_root) assert self.rootdir is Entry('.', self.rootdir) assert RootDirectory(browse_root) is Directory(browse_root) assert RootDirectory(browse_root) is Entry('.', self.rootdir) assert Entry(browse_root) is Directory('.', self.rootdir) def test_get_child_file(self): file = self.rootdir.get_child('__init__.py') assert isinstance(file, File) assert file.ext == 'py' assert file.path == '__init__.py' assert file.rootdir is self.rootdir def test_get_child_dir(self): dir = self.rootdir.get_child('static') assert isinstance(dir, Directory) assert dir.path == 'static' assert dir.rootdir is self.rootdir def test_contain(self): assert 'static' in self.rootdir assert '__init__.py' in self.rootdir assert Entry('static', self.rootdir) in self.rootdir assert Entry('__init__.py', self.rootdir) in self.rootdir assert '^_^' not in self.rootdir class DirectoryTestCase(unittest.TestCase): def setUp(self): self.rootdir = RootDirectory(browse_root) self.static = Directory('static', self.rootdir) def test_dir(self): assert isinstance(self.static, Directory) assert self.static.path == 'static' assert os.path.samefile(self.static.abspath, os.path.join(browse_root, 'static')) assert os.path.isdir(self.static.abspath) def test_init(self): assert isinstance(Directory('static', self.rootdir), Directory) assert isinstance(Entry('static', self.rootdir), Directory) def test_same_object(self): assert self.static is Directory('static', self.rootdir) assert self.static is Entry('static', self.rootdir) assert Directory('static', self.rootdir) is \ Entry('static', self.rootdir) assert self.static.parent is self.rootdir def test_get_child_file(self): file = self.static.get_child('test.txt') assert isinstance(file, File) assert file.ext == 'txt' assert file.path == 'static/test.txt' assert file.rootdir is self.rootdir def test_contain(self): assert 'test.py' in self.static assert Entry('static/test.py', self.rootdir) in self.static assert '^_^' not in self.static class FileTestCase(unittest.TestCase): def setUp(self): self.rootdir = RootDirectory(browse_root) self.itself = File('__init__.py', self.rootdir) def test_file(self): assert isinstance(self.itself, File) assert self.itself.path == '__init__.py' assert os.path.samefile(self.itself.abspath, os.path.join(browse_root, '__init__.py')) assert os.path.isfile(self.itself.abspath) def test_init(self): assert isinstance(File('__init__.py', self.rootdir), File) assert isinstance(Entry('__init__.py', self.rootdir), File) assert isinstance(File('static/test.txt', self.rootdir), File) assert isinstance(Entry('static/test.txt', self.rootdir), File) def test_same_object(self): assert self.itself is File('__init__.py', self.rootdir) assert self.itself is Entry('__init__.py', self.rootdir) assert File('__init__.py', self.rootdir) is \ Entry('__init__.py', self.rootdir) def test_properties(self): with open(__file__) as f: source = ''.join(f.readlines()) assert self.itself.data.strip() == source.strip() assert self.itself.size == len(source) assert self.itself.ext == 'py' assert self.itself.mimetype == mimetypes.guess_type(__file__) class ApplicationTestCase(unittest.TestCase): def setUp(self): self.app = Flask(__name__) self.app2 = Flask(__name__) self.idx = AutoIndex(self.app, browse_root, add_url_rules=True) self.idx2 = AutoIndex(self.app2, browse_root, silk_options={'silk_path': '/myicons'}) @self.app2.route('/') @self.app2.route('/') def autoindex_test(path='.'): return self.idx2.render_autoindex(path, browse_root) def get(self, path): return self.app.test_client().get(path) def get2(self, path): self.app2.config['TESTING'] = True return self.app2.test_client().get(path) def test_css(self): for get in [self.get, self.get2]: rv = get('/__autoindex__/autoindex.css') assert 200 == rv.status_code def test_icon(self): rv = self.get('/__icons__/page_white.png') rv2 = self.get2('/myicons/page_white.png') assert 294 == len(rv.data) assert rv.data == rv2.data def test_autoindex(self): assert b('__init__.py') in self.get('/').data assert b('__init__.py') in self.get2('/').data def test_own_static_file(self): rv = self.get('/static/helloworld.txt') assert b('Hello, world!') == rv.data.strip() def test_own_page(self): for get in [self.get, self.get2]: rv = get('/test') assert not b('foo bar foo bar') == rv.data.strip() @self.app.route('/test') def sublee(): return 'foo bar foo bar', 200 @self.app2.route('/test') def sublee(): return 'foo bar foo bar', 200 for get in [self.get, self.get2]: rv = get('/test') assert b('foo bar foo bar') == rv.data.strip() def test_builtin_icon_rule(self): testset = {'7z': 'page_white_zip.png', 'avi': 'film.png', 'cer': 'key.png', 'html': 'page_white_code.png', 'iso': 'cd.png', 'rss': 'feed.png'} with self.app.test_request_context(): for ext, icon in list(testset.items()): file = self.idx.rootdir.get_child('static/test.' + ext) assert file.guess_icon().endswith(icon) def test_custom_icon_rule(self): with self.app.test_request_context(): file = self.idx.rootdir.get_child('__init__.py') original_icon_url = file.guess_icon() self.idx.add_icon_rule('table.png', ext='py') customized_icon_url = file.guess_icon() assert original_icon_url.endswith('page_white_python.png') assert customized_icon_url.endswith('table.png') class SubdomainTestCase(unittest.TestCase): def setUp(self): from .blueprinttest import bp app = Flask(__name__) app.config['SERVER_NAME'] = 'example.org' AutoIndex(bp, browse_root) app.register_blueprint(bp, subdomain='test') self.app = app def get(self, path): return self.app.test_client().get(path, 'http://test.example.org/') def test_css(self): rv = self.get('/static/autoindex.css') assert 200 == rv.status_code, 'could not found preloaded css file.' def test_icon(self): rv = self.get('/__icons__/page_white.png') assert 294 == len(rv.data), 'could not found preloaded icon file.' def test_browse(self): rv = self.get('/') assert 'Index of /' in rv.data assert '__init__.py' in rv.data def test_own_static_file(self): rv = self.get('/static/helloworld.txt') assert 'Hello, world!' == rv.data.strip() class WithoutSubdomainTestCase(unittest.TestCase): def setUp(self): from .blueprinttest import bp app = Flask(__name__) AutoIndex(bp, browse_root) app.register_blueprint(bp) self.app = app def get(self, path): return self.app.test_client().get(path) def test_css(self): rv = self.get('/static/autoindex.css') assert 200 == rv.status_code, 'could not found preloaded css file.' def test_icon(self): rv = self.get('/__icons__/page_white.png') assert 294 == len(rv.data), 'could not found preloaded icon file.' def test_browse(self): rv = self.get('/') assert 'Index of /' in rv.data assert '__init__.py' in rv.data def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(RootDirectoryTestCase)) suite.addTest(unittest.makeSuite(DirectoryTestCase)) suite.addTest(unittest.makeSuite(FileTestCase)) suite.addTest(unittest.makeSuite(ApplicationTestCase)) # These cases will be passed on Flask next generation. # suite.addTest(unittest.makeSuite(SubdomainTestCase)) # suite.addTest(unittest.makeSuite(WithoutSubdomainTestCase)) return suite if __name__ == '__main__': unittest.main(defaultTest='suite') flask-autoindex-20160725-02b454/flask_autoindex/0000755000175000017500000000000012771613504021252 5ustar jonathanjonathanflask-autoindex-20160725-02b454/flask_autoindex/__init__.py0000644000175000017500000002452013153471103023356 0ustar jonathanjonathan# -*- coding: utf-8 -*- """ flask_autoindex ~~~~~~~~~~~~~~~ The mod_autoindex for `Flask `_. :copyright: (c) 2010-2013 by Heungsub Lee. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from future.builtins import str from future.builtins import object import os import re from flask import * from flask_silk import Silk from jinja2 import FileSystemLoader, TemplateNotFound from werkzeug import cached_property from .entry import * from . import icons __version__ = '0.5' __autoindex__ = '__autoindex__' class AutoIndex(object): """This class makes the Flask application to serve automatically generated index page. The wrapped application will route ``/`` and ``/`` when ``add_url_rules`` is ``True``. Here's a simple example:: app = Flask(__name__) AutoIndex(app, '/home/someone/public_html', add_url_rules=True) :param base: a Flask application. :param browse_root: a path which is served by root address. By default, this is the working directory, but you can set it to fix your app to always use one location if you like. :param add_url_rules: if it is ``True``, the wrapped application routes ``/`` and ``/`` to autoindex. default is ``True``. :param template_context: would be passed to the Jinja2 template when rendering an AutoIndex page. :param silk_options: keyword options for :class:`flask_silk.Silk`. """ shared = None def _register_shared_autoindex(self, state=None, app=None): """Registers a magic module named __autoindex__.""" app = app or state.app if __autoindex__ not in app.blueprints: static_folder = os.path.join(__path__[0], 'static') template_folder = os.path.join(__path__[0], 'templates') shared = Blueprint(__autoindex__, __name__, template_folder=template_folder) @shared.route('/__autoindex__/') def static(filename): return send_from_directory(static_folder, filename) app.register_blueprint(shared) def __new__(cls, base, *args, **kwargs): if isinstance(base, Flask): return object.__new__(AutoIndexApplication) elif isinstance(base, Blueprint): return object.__new__(AutoIndexBlueprint) else: raise TypeError("'base' should be Flask or Blueprint.") def __init__(self, base, browse_root=None, add_url_rules=True, template_context=None, silk_options=None, show_hidden=False): """Initializes an autoindex instance.""" self.base = base if browse_root: browse_root = str(browse_root) else: browse_root = os.path.curdir self.rootdir = RootDirectory(browse_root, autoindex=self) self.template_context = template_context if silk_options is None: silk_options = {} silk_options['silk_path'] = silk_options.get('silk_path', '/__icons__') self.silk = Silk(self.base, **silk_options) self.show_hidden = show_hidden self.icon_map = [] self.converter_map = [] if add_url_rules: @self.base.route('/') @self.base.route('/') def autoindex(path='.'): return self.render_autoindex(path) def render_autoindex(self, path, browse_root=None, template=None, template_context=None, endpoint='.autoindex', show_hidden=None, sort_by='name', mimetype=None): """Renders an autoindex with the given path. :param path: the relative path. :param browse_root: if it is specified, it used to a path which is served by root address. :param template: the template name. :param template_context: would be passed to the Jinja2 template when rendering an AutoIndex page. :param endpoint: an endpoint which is a function. :param show_hidden: whether to show hidden files (starting with '.') :param sort_by: the property to sort the entrys by. :param mimetype: set static mime type for files (no auto detection). """ if browse_root: rootdir = RootDirectory(browse_root, autoindex=self) else: rootdir = self.rootdir path = re.sub(r'\/*$', '', path) abspath = os.path.join(rootdir.abspath, path) if os.path.isdir(abspath): sort_by = request.args.get('sort_by', sort_by) order = {'asc': 1, 'desc': -1}[request.args.get('order', 'asc')] curdir = Directory(path, rootdir) if show_hidden == None: show_hidden = self.show_hidden entries = curdir.explore(sort_by=sort_by, order=order, show_hidden=show_hidden) if callable(endpoint): endpoint = endpoint.__name__ context = {} if template_context is not None: context.update(template_context) if self.template_context is not None: context.update(self.template_context) context.update( curdir=curdir, entries=entries, sort_by=sort_by, order=order, endpoint=endpoint) if template: return render_template(template, **context) try: template = '{0}autoindex.html'.format(self.template_prefix) return render_template(template, **context) except TemplateNotFound as e: template = '{0}/autoindex.html'.format(__autoindex__) return render_template(template, **context) elif os.path.isfile(abspath): if mimetype: return send_file(abspath, mimetype=mimetype) else: return send_file(abspath) else: return abort(404) def add_icon_rule(self, icon, rule=None, ext=None, mimetype=None, name=None, filename=None, dirname=None, cls=None): """Adds a new icon rule. There are many shortcuts for rule. You can use one or more shortcuts in a rule. `rule` A function which returns ``True`` or ``False``. It has one argument which is an instance of :class:`Entry`. Example usage:: def has_long_name(ent): return len(ent.name) > 10 idx.add_icon_rule('brick.png', rule=has_log_name) Now the application represents files or directorys such as ``very-very-long-name.js`` with ``brick.png`` icon. `ext` A file extension or file extensions to match with a file:: idx.add_icon_rule('ruby.png', ext='ruby') idx.add_icon_rule('bug.png', ext=['bug', 'insect']) `mimetype` A mimetype or mimetypes to match with a file:: idx.add_icon_rule('application.png', mimetype='application/*') idx.add_icon_rule('world.png', mimetype=['image/icon', 'x/*']) `name` A name or names to match with a file or directory:: idx.add_icon_rule('error.png', name='error') idx.add_icon_rule('database.png', name=['mysql', 'sqlite']) `filename` Same as `name`, but it matches only a file. `dirname` Same as `name`, but it matches only a directory. If ``icon`` is callable, it is used to ``rule`` function and the result is used to the url for an icon. This way is useful for getting an icon url dynamically. Here's a nice example:: def get_favicon(ent): favicon = 'favicon.ico' if type(ent) is Directory and favicon in ent: return '/' + os.path.join(ent.path, favicon) return False idx.add_icon_rule(get_favicon) Now a directory which has a ``favicon.ico`` guesses the ``favicon.ico`` instead of silk's ``folder.png``. """ if name: filename = name directoryname = name call = lambda m, *args: m.__func__(self, *args) if ext: call(File.add_icon_rule_by_ext, icon, ext) if mimetype: call(File.add_icon_rule_by_mimetype, icon, mimetype) if filename: call(File.add_icon_rule_by_name, icon, filename) if dirname: call(Directory.add_icon_rule_by_name, icon, dirname) if cls: call(Entry.add_icon_rule_by_class, icon, cls) if callable(rule) or callable(icon): call(Entry.add_icon_rule, icon, rule) @property def template_prefix(self): raise NotImplementedError() class AutoIndexApplication(AutoIndex): """An AutoIndex which supports flask applications.""" template_prefix = '' def __init__(self, app, browse_root=None, **silk_options): super(AutoIndexApplication, self).__init__(app, browse_root, **silk_options) self.app = app self._register_shared_autoindex(app=self.app) class AutoIndexBlueprint(AutoIndex): """An AutoIndex which supports flask blueprints. .. versionadded:: 0.3.1 """ def __init__(self, blueprint, browse_root=None, **silk_options): super(AutoIndexBlueprint, self).__init__(blueprint, browse_root, **silk_options) self.blueprint = self.base self.blueprint.record_once(self._register_shared_autoindex) @cached_property def template_prefix(self): return self.blueprint.name + '/' class AutoIndexModule(AutoIndexBlueprint): """Deprecated module support. .. versionchanged:: 0.3.1 ``AutoIndexModule`` was deprecated. Use ``AutoIndexBlueprint`` instead. """ def __init__(self, *args, **kwargs): import warnings warnings.warn('AutoIndexModule is deprecated; ' \ 'use AutoIndexBlueprint instead.', DeprecationWarning) super(AutoIndexModule, self).__init__(*args, **kwargs) @property def mod(self): return self.blueprint flask-autoindex-20160725-02b454/flask_autoindex/icons.py0000644000175000017500000000514713153471103022736 0ustar jonathanjonathan# -*- coding: utf-8 -*- from __future__ import absolute_import from .entry import File, Default by_extension = [ ('page_white_python.png', 'py'), ('python.png', 'pyc'), ('page_white_text_width.png', ['md', 'markdown', 'rst', 'rtf']), ('page_white_code.png', ['html', 'htm', 'cgi']), ('page_white_visualstudio.png', ['asp', 'vb']), ('page_white_ruby.png', 'rb'), ('page_code.png', 'xhtml'), ('page_white_code_red.png', ['xml', 'xsl', 'xslt', 'yml']), ('script.png', ['js', 'json', 'applescript', 'htc']), ('layout.png', ['css', 'less']), ('page_white_php.png', 'php'), ('page_white_c.png', 'c'), ('page_white_cplusplus.png', 'cpp'), ('page_white_h.png', 'h'), ('database.png', ['db', 'sqlite', 'sqlite3']), ('page_white_database.png', 'sql'), ('page_white_gear.png', ['conf', 'cfg', 'ini', 'reg', 'sys']), ('page_white_zip.png', ['zip', 'tar', 'gz', 'tgz', '7z', 'alz', 'rar', \ 'bin', 'cab']), ('cup.png', 'jar'), ('page_white_cup.png', ['java', 'jsp']), ('application_osx_terminal.png', 'sh'), ('page_white_acrobat.png', 'pdf'), ('package.png', ['pkg', 'dmg']), ('shape_group.png', ['ai', 'svg', 'eps']), ('application_osx.png', 'app'), ('cursor.png', 'cur'), ('feed.png', 'rss'), ('cd.png', ['iso', 'vcd', 'toast']), ('page_white_powerpoint.png', ['ppt', 'pptx']), ('page_white_excel.png', ['xls', 'xlsx', 'csv']), ('page_white_word.png', ['doc', 'docx']), ('page_white_flash.png', 'swf'), ('page_white_actionscript.png', ['fla', 'as']), ('comment.png', 'smi'), ('disk.png', ['bak', 'bup']), ('application_xp_terminal.png', ['bat', 'com']), ('application.png', 'exe'), ('key.png', 'cer'), ('cog.png', ['dll', 'so']), ('pictures.png', 'ics'), ('error.png', 'log'), ('music.png', 'mpa'), ('font.png', ['ttf', 'eot']), ('vcard.png', 'vcf'), ('page_white.png', Default) ] by_filename = [ ('page_white_gear.png', ['Makefile', 'Rakefile']) ] by_mimetype = [ ('page_white_text.png', 'text/*'), ('picture.png', 'image/*'), ('music.png', 'audio/*'), ('film.png', 'video/*') ] def to_list(val): if not isinstance(val, list): return [val] else: return val for icon, exts in by_extension: for ext in to_list(exts): File.add_icon_rule_by_ext(icon, ext) for icon, filenames in by_filename: for name in to_list(filenames): File.add_icon_rule_by_name(icon, name) for icon, mimetypes in by_mimetype: for mimetype in to_list(mimetypes): File.add_icon_rule_by_mimetype(icon, mimetype) flask-autoindex-20160725-02b454/flask_autoindex/entry.py0000644000175000017500000002511213153471103022756 0ustar jonathanjonathanfrom past.builtins import cmp from future import standard_library standard_library.install_hooks() # -*- coding: utf-8 -*- from datetime import datetime from fnmatch import fnmatch from mimetypes import guess_type import functools import os import re from future.utils import with_metaclass from future.moves.urllib.parse import urljoin from flask import url_for, send_file from werkzeug import cached_property Default = None is_same_path = lambda x, y: os.stat(x) == os.stat(y) def _make_mimetype_matcher(mimetype): return lambda ent: fnmatch(guess_type(ent.name)[0] or '', mimetype) def _make_args_for_entry(args, kwargs): if not args: raise TypeError('path is required, but not given') rootdir = autoindex = None args = list(args) try: path = kwargs.get('path', args.pop(0)) rootdir = kwargs.get('rootdir', args.pop(0)) autoindex = kwargs.get('autoindex', args.pop(0)) except IndexError: pass return (path, rootdir, autoindex) class _EntryMeta(type): """The meta class for :class:`Entry`.""" def __call__(cls, *args, **kwargs): """If an instance already initialized, just returns.""" ent = cls.__new__(cls, *args, **kwargs) try: ent.path except AttributeError: ent.__init__(*args, **kwargs) return ent class Entry(with_metaclass(_EntryMeta, object)): """This class wraps file or directory. It is an abstract class, but it returns a derived instance. You can make an instance such as:: directory = Entry('/home/someone/public_html') assert isinstance(foler, Directory) file = Entry('/home/someone/public_html/favicon.ico') assert isinstance(file, File) """ HIDDEN = re.compile('^\.') def __new__(cls, *args, **kwargs): """Returns a file or directory instance.""" path, rootdir, autoindex = _make_args_for_entry(args, kwargs) if rootdir: abspath = os.path.join(rootdir.abspath, path) else: abspath = os.path.abspath(path) if os.path.isdir(abspath): return Directory.__new__(Directory, path, rootdir, autoindex) elif os.path.isfile(abspath): return File.__new__(File, path, rootdir, autoindex) else: raise IOError('{0} does not exists.'.format(abspath)) def __init__(self, path, rootdir=None, autoindex=None): """Initializes an entry instance.""" self.rootdir = rootdir self.autoindex = autoindex try: rootpath = self.rootdir.abspath if not autoindex and self.rootdir: self.autoindex = self.rootdir.autoindex except AttributeError: rootpath = '' self.path = path self.abspath = os.path.join(rootpath, self.path) self.name = os.path.basename(self.abspath) self.hidden = bool(self.HIDDEN.match(self.name)) if self.rootdir: self.rootdir._register_descendant(self) def is_root(self): """Returns ``True`` if it is a root directory.""" return isinstance(self, RootDirectory) @property def parent(self): if self.is_root(): return None elif is_same_path(os.path.dirname(self.abspath), self.rootdir.abspath): return self.rootdir return Entry(os.path.dirname(self.path), self.rootdir) @property def modified(self): """Returns modified time of this.""" return datetime.fromtimestamp(os.path.getmtime(self.abspath)) @classmethod def add_icon_rule(cls, icon, rule=None): """Adds a new icon rule globally.""" cls.icon_map.append((icon, rule)) @classmethod def add_icon_rule_by_name(cls, icon, name): """Adds a new icon rule by the name globally.""" cls.add_icon_rule(icon, lambda ent: ent.name == name) @classmethod def add_icon_rule_by_class(cls, icon, _class): """Adds a new icon rule by the class globally.""" cls.add_icon_rule(icon, lambda ent: isinstance(ent, _class)) def guess_icon(self): """Guesses an icon from itself.""" def get_icon_url(): try: if self.autoindex: icon_map = self.autoindex.icon_map + self.icon_map else: icon_map = self.icon_map for icon, rule in icon_map: if not rule and callable(icon): matched = icon = icon(self) else: matched = rule(self) if matched: return icon except AttributeError: pass try: return self.default_icon except AttributeError: raise GuessError('There is no matched icon.') try: return urljoin(url_for('.silkicon', filename=''), get_icon_url()) except (AttributeError, RuntimeError): return 'ERROR' return get_icon_url() class File(Entry): """This class wraps a file.""" EXTENSION = re.compile('\.([^.]+)$') default_icon = 'page_white.png' icon_map = [] def __new__(cls, path, rootdir=None, autoindex=None): try: return rootdir._descendants[(path, autoindex)] except (AttributeError, KeyError): pass return object.__new__(cls) def __init__(self, path, rootdir=None, autoindex=None): super(File, self).__init__(path, rootdir, autoindex) try: self.ext = re.search(self.EXTENSION, self.name).group(1) except AttributeError: self.ext = None @cached_property def data(self): """Data of this file.""" with open(self.abspath) as f: return ''.join(f.readlines()) @cached_property def mimetype(self): """A mimetype of this file.""" return guess_type(self.abspath) @cached_property def size(self): """A size of this file.""" return os.path.getsize(self.abspath) @classmethod def add_icon_rule_by_ext(cls, icon, ext): """Adds a new icon rule by the file extension globally.""" cls.add_icon_rule(icon, lambda ent: ent.ext == ext) @classmethod def add_icon_rule_by_mimetype(cls, icon, mimetype): """Adds a new icon rule by the mimetype globally.""" cls.add_icon_rule(icon, _make_mimetype_matcher(mimetype)) class Directory(Entry): """This class wraps a directory.""" default_icon = 'folder.png' icon_map = [] def __new__(cls, *args, **kwargs): """If the path is same with root path, it returns a :class:`RootDirectory` object. """ path, rootdir, autoindex = _make_args_for_entry(args, kwargs) if not rootdir: return RootDirectory(path, autoindex) try: return rootdir._descendants[(path, autoindex)] except KeyError: pass rootpath = rootdir.abspath if is_same_path(os.path.join(rootpath, path), rootpath): if not rootdir: rootdir = RootDirectory(rootpath, autoindex) return rootdir return object.__new__(cls) def explore(self, sort_by='name', order=1, show_hidden=False): """It is a generator. Each item is a child entry.""" def compare(ent1, ent2): def asc(): if sort_by != 'modified' and type(ent1) is not type(ent2): return 1 if type(ent1) is File else -1 else: try: return cmp(getattr(ent1, sort_by), getattr(ent2, sort_by)) except AttributeError: return cmp(getattr(ent1, 'name'), getattr(ent2, 'name')) return asc() * order if not self.is_root(): yield _ParentDirectory(self) rootdir = self.rootdir else: rootdir = self dirlist = os.listdir(self.abspath) entries = [] for name in dirlist: try: entries.append(Entry(os.path.join(self.path, name), rootdir)) except IOError: continue # ignore stuff like broken links entries = sorted(entries, key=functools.cmp_to_key(compare)) for ent in entries: if show_hidden or not ent.hidden: yield ent def get_child(self, childname): """Returns a child file or directory.""" if childname in self: if self.path != '.': path = os.path.join(self.path, childname) else: path = childname return Entry(path, self.rootdir) else: raise IOError('{0} does not exist'.format(childname)) def __contains__(self, path_or_entry): """Checks this directory has a file or directory. public_html = Directory('public_html') 'favicon.ico' in public_html File('favicon.ico', public_html) in public_html """ if isinstance(path_or_entry, Entry): path = os.path.relpath(path_or_entry.path, self.path) if os.path.pardir in path: return False else: path = path_or_entry return os.path.exists(os.path.join(self.abspath, path)) class RootDirectory(Directory): """This class wraps a root directory.""" default_icon = 'server.png' icon_map = [] _rootdirs = {} def __new__(cls, path, autoindex=None): try: return RootDirectory._rootdirs[(path, autoindex)] except KeyError: return object.__new__(cls) def __init__(self, path, autoindex=None): super(RootDirectory, self).__init__('.', autoindex=autoindex) self.abspath = os.path.abspath(path) self.rootdir = self self._descendants = {} RootDirectory._register_rootdir(self) @classmethod def _register_rootdir(cls, rootdir): cls._rootdirs[(rootdir.abspath, rootdir.autoindex)] = rootdir def _register_descendant(self, entry): self._descendants[(entry.path, entry.autoindex)] = entry class _ParentDirectory(Directory): """This class wraps a parent directory.""" default_icon = 'arrow_turn_up.png' icon_map = [] def __new__(cls, *args, **kwargs): return object.__new__(cls) def __init__(self, child_directory): path = os.path.join(child_directory.path, '..') super(_ParentDirectory, self).__init__(path, child_directory.rootdir) class GuessError(RuntimeError): pass class MarkupError(RuntimeError): pass flask-autoindex-20160725-02b454/flask_autoindex/templates/0000755000175000017500000000000012771613504023250 5ustar jonathanjonathanflask-autoindex-20160725-02b454/flask_autoindex/templates/__autoindex__/0000755000175000017500000000000012771613504026044 5ustar jonathanjonathanflask-autoindex-20160725-02b454/flask_autoindex/templates/__autoindex__/autoindex.html0000644000175000017500000000201013153471104030714 0ustar jonathanjonathan{% from "__autoindex__/macros.html" import entry, thead, breadcrumb with context %} Index of {{ curdir.path }} {% block meta %} {% endblock %} {% block header %}{% endblock %} {% block table %} {{ thead() }} {% if not curdir.is_root() %} {% endif %} {% for ent in entries %} {{ entry(ent) }} {% endfor %}
{% endblock %} {% block footer %} {% set env = request.environ %}
{{ env.SERVER_SOFTWARE }} Server at {{ env.HTTP_HOST }} Port {{ env.SERVER_PORT }}
{% endblock %} flask-autoindex-20160725-02b454/flask_autoindex/templates/__autoindex__/macros.html0000644000175000017500000000343213153471104030211 0ustar jonathanjonathan{% macro entry(ent) %} {% set icon = ent.guess_icon() %} {% if icon %} {% endif %} {%- if ent.name == ".." -%} Parent folder {%- else -%} {{ ent.name }} {%- endif -%} {% if ent.size %} {{ ent.size|filesizeformat }} {% else %} - {% endif %} {% endmacro %} {% macro th(key, label, colspan=1) %} {%- if sort_by == key and order > 0 -%} {{ label }} {%- else -%} {{ label }} {%- endif -%} {%- if sort_by == key -%} {%- if order > 0 -%} ASC {%- elif order < 0 -%} DESC {%- endif -%} {%- endif -%} {% endmacro %} {% macro thead() %} {{ th("name", "Name", 2) }} {{ th("modified", "Last modified") }} {{ th("size", "Size") }} {% endmacro %} {% macro breadcrumb(ent) %} {% set parent = ent.parent %} {% if parent %} {{ breadcrumb(parent) }} » {% endif %} {% set icon = ent.guess_icon() %} {% if icon %} {% endif %} {% if not ent.is_root() %} {{ ent.name }} {% endif %} {% endmacro %} flask-autoindex-20160725-02b454/flask_autoindex/run.py0000644000175000017500000000023613153471104022422 0ustar jonathanjonathanimport os.path from flask import Flask from flask_autoindex import AutoIndex app = Flask(__name__) AutoIndex(app) if __name__ == '__main__': app.run() flask-autoindex-20160725-02b454/flask_autoindex/static/0000755000175000017500000000000012771613504022541 5ustar jonathanjonathanflask-autoindex-20160725-02b454/flask_autoindex/static/autoindex.css0000644000175000017500000000506713153471104025254 0ustar jonathanjonathan* { margin: 0; padding: 0; border: none; } body, table { font-family: Helvetica, Arial, sans-serif; font-size: 14px; } a:link, a:visited { text-decoration: none; } a:link { color: #36c; } a:visited { color: #333; } a:hover { text-decoration: underline; } #readme { padding: 10px 26px; border-bottom: 1px solid #eee; font-size: 12px; color: #333; background: #fafafa; } #readme pre { line-height: 1.2; } #readme p, #readme ul, #readme ol, #readme h1, #readme h2, #readme h3, #readme h4, #readme h5, #readme h6 { display: block; margin-bottom: 1em; } #readme h1, #readme h2, #readme h3, #readme h4, #readme h5, #readme h6 { padding: 0; color: #456; text-align: left; font-family: sans-serif; font-weight: bolder; } #readme pre code { display: block; padding: 9px; margin: 0 -10px 1em; border: 1px solid #cde; color: #567; background: #fff; } #readme li { margin-left: 2em; } #readme blockquote { padding: 9px; margin: 0 -10px 1em; border-left: 1px solid #cde; } #readme blockquote :last-child { margin-bottom: 0; } #readme h1 { font-size: 1.5em; } #readme h2 { font-size: 1.4em; } #readme h3 { font-size: 1.3em; } #readme h4 { font-size: 1.2em; } #readme h5 { font-size: 1.1em; } #readme h6 { font-size: 1em; } .breadcrumb { padding: 0; } .breadcrumb a { margin: 0; color: #666; font-size: 12px; } .breadcrumb .sep { color: #bbb; } .breadcrumb img { vertical-align: middle; } .breadcrumb h1 { font-size: 12px; font-weight: normal; padding: 5px; background: #f4f4f4; border-top: 1px solid #ccc; } table { border-collapse: collapse; width: 100%; background: #fff; } thead { border-bottom: 1px solid #ccc; } th { font-size: 11px; height: 30px; background: #ddd; background: -webkit-gradient( linear, left bottom, left top, color-stop(0, #ddd), color-stop(1, #eee) ); background: -moz-linear-gradient( center bottom, #ddd 0%, #eee 100% ); } th a:link, th a:visited { margin: 0 10px; color: #333; } th img { position: absolute; margin-left: -6px; } tbody { border: solid #ccc; border-width: 1px 0; } hr { margin: 0; border: none; } td { padding: 5px; font-size: 11px; color: #333; border-left: 1px dashed #eee; } td a { margin-right: 40px; font-size: 14px; } td.modified { text-align: center; } td.size { text-align: right; } .icon, .name { border: none; } .icon { width: 16px; padding-right: 0; } .modified { width: 120px; } .size { width: 60px; } address { padding: 5px; font-size: 11px; color: #333; text-align: right; } flask-autoindex-20160725-02b454/flask_autoindex/static/asc.gif0000644000175000017500000000006513153471104023770 0ustar jonathanjonathanGIF89a !,   ≴Y[;flask-autoindex-20160725-02b454/flask_autoindex/static/desc.gif0000644000175000017500000000006513153471104024140 0ustar jonathanjonathanGIF89a !,  ~^ZT;flask-autoindex-20160725-02b454/setup.cfg0000644000175000017500000000011013153471104017674 0ustar jonathanjonathan[build_sphinx] source-dir = docs/ build-dir = docs/_build all_files = 1 flask-autoindex-20160725-02b454/setup.py0000644000175000017500000000337213153471104017602 0ustar jonathanjonathan""" Flask-AutoIndex --------------- Flask-AutoIndex generates an index page for your `Flask`_ application automatically. The result just like `mod_autoindex`_, but the look is more awesome! Look at this: .. _Flask: http://flask.pocoo.org/ .. _mod_autoindex: http://httpd.apache.org/docs/current/mod/mod_autoindex.html Links ````` * `documentation `_ * `development version `_ """ import re from setuptools import setup def run_tests(): from tests import suite return suite() setup( name='Flask-AutoIndex', version='0.6', license='BSD', author='Heungsub Lee', author_email=re.sub('((sub).)(.*)', r'\2@\1.\3', 'sublee'), url='http://pythonhosted.org/Flask-AutoIndex', description='The mod_autoindex for Flask', long_description=__doc__, packages=['flask_autoindex'], include_package_data=True, package_data={'flask_autoindex': ['static/*', 'templates/__autoindex__/*']}, zip_safe=False, platforms='any', install_requires=['Flask>=0.8', 'Flask-Silk>=0.2', 'future>=0.13.0'], test_suite='__main__.run_tests', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ], entry_points={ 'console_scripts': [ 'fai = flask_autoindex.run:app.run', ], }, ) flask-autoindex-20160725-02b454/LICENSE0000644000175000017500000000266413153471102017076 0ustar jonathanjonathanCopyright (c) 2010-2013 by Heungsub Lee. Some rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. flask-autoindex-20160725-02b454/README0000644000175000017500000000007713153471102016745 0ustar jonathanjonathanFlask-AutoIndex A mod_autoindex for Flask. Under development. flask-autoindex-20160725-02b454/MANIFEST.in0000644000175000017500000000046113153471102017620 0ustar jonathanjonathaninclude LICENSE recursive-include tests * recursive-exclude tests *.pyc recursive-include flask_autoindex/static * recursive-include flask_autoindex/templates * include docs/*.rst docs/conf.py recursive-include docs/_static * recursive-include docs/_themes *.py *.css *.css_t *.conf *.html LICENSE README flask-autoindex-20160725-02b454/.gitmodules0000644000175000017500000000015413153471102020236 0ustar jonathanjonathan[submodule "docs/_themes"] path = docs/_themes url = https://github.com/mitsuhiko/flask-sphinx-themes.git flask-autoindex-20160725-02b454/.gitignore0000644000175000017500000000014313153471102020047 0ustar jonathanjonathan# Compiled sources *.pyc # Temporary files *.swp # Distribution *egg-info build dist docs/_build flask-autoindex-20160725-02b454/docs/0000755000175000017500000000000012771613504017022 5ustar jonathanjonathanflask-autoindex-20160725-02b454/docs/_static/0000755000175000017500000000000012771613504020450 5ustar jonathanjonathanflask-autoindex-20160725-02b454/docs/_static/flask-autoindex.png0000644000175000017500000003233513153471103024252 0ustar jonathanjonathanPNG  IHDRXdZAN#tEXtSoftwareAdobe ImageReadyqe< CiTXtXML:com.adobe.xmp flask-autoindex_resized iG'0IDATxq"օuÉ`U"0MD`8#V af6YnoX[-G[[[QEQEQ_,((EQEQ((EQEQE((XEQEQ,((EQEQE(("`QEQEQ,((EQEQ((EQEQE((XEQEQ,((EQEQ'KjSocɏ1sEQEQ"4%SO5f^7yZ< sEQEQOjqRgkMO!nATa,{&{4{8(N^S1c&Y =:').~bF_EQUrcRS=MKa*{u={xsZ`x1,(`=e?{wC@Wן`q|ŦO59Ɓt9sSK #sT5pSKu#E `1d0pU>ߕ~&q-W{*2Հ37SH;A:*4qt EUq3`C((;772``|[03n@Q)[t~\T|1^W5|Lah ZJ. oJ!/1(&2.eՏЂ6*m}`!eF؈zڰX!'% :vmC3F" n^ onтNR/mw/b܏A% [>""H*kQ˙c?[zZ>CB+V)sj!Ϥ_A`z.^zI;14Vcu@ajkz'!r~ < 1ݙ; h|8$ɺ4N`-jeSQNQtjo _Y^bA1S\=+;Rgt!Ҧe@I^WL'f+ fg')f5j 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y ! @BF51MT*:eztfvwfK=Db۝o|˥9FfV@Cl^'15oGFsdLUy7Yd+i2+/e~2i]|}JzRq v8cVz>$z^>X6e[V0T5I{5M;g}}Ν;WN/< sωgOV9kumܾU63*+|u~˵76>* 7V-R36wޫ,--a0Dk~eʵK= acZ}\-jO\J}gO8+`&vsyG Won2x =&bo @pGx@ Ļt1iL-\9 @w.t~c?XL#9(wf}H{ːGiwA؏4}yao>~^^="ӧN ~®Ovy'g= $ ~"Cm}֏O#aĻcL*6j#:Kaa*'"1̖^m+m>T[uG S"MT<8)l%:RCdjh25[֩/Us'3 SJ֡ ۔}&SHfhj!Uw*kӃJ4 QbXP"dGҿi' Y+k/ roMDxoZk8hdrkd>q-]$z|pͨv]^b/lD%+*"rT<T^&Iv69iBAt*M* E59!1*6"U @QBGuSJMh_Y/(zzŒK-H '<ɖGEMze*G ɲ7N~s9+nȜ+_>/:(ڬ|odnؒdz.ɧu*/d 1 \3Üw ] ܿ'<}9|3]~IUfAfiAbjtzڢTR<9LU7'Zd2feNx:W 9vB-ڱz=k?KذjX`!Pf-ZCwiA.mJ&3!f Aw{:6"M70dqO'v5wE, alDHݳ(DW#;Wvy44$_<)bQf33Nn"t,,M4\޺>u4vg)01¿"jY-! K$**;ߴY7W2?aǕ32urr`uzFdvIO2m'(L#6EⲕhNݲ!{Ԫas%C }t'\xN#&4CJv##bM ,u!%uENP@M=UQG=_%$cR&ϳ-4X쩨2/'lUk)?)+.٦py{>biQe1hK-Nnm,M˞"6T꫑@)/p.w7k/vCwyG~!w̪/a?~׎ 5Yx Owm#S3CnD`[ol^/+2wwm}^p c?D10NtwQ_oʥeūݣRw{{H[=! }\*?P[M=l[?{.LCBjF:w3u{@@w' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Flask-AutoIndex.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Flask-AutoIndex.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/Flask-AutoIndex" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Flask-AutoIndex" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." make -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." flask-autoindex-20160725-02b454/docs/index.rst0000644000175000017500000001402613153471103020656 0ustar jonathanjonathanFlask-AutoIndex ~~~~~~~~~~~~~~~ .. module:: flask_autoindex Flask-AutoIndex generates an index page for your `Flask`_ application automatically. The result just like `mod_autoindex`_, but the look is more awesome! Look at this: .. figure:: _static/example.png :alt: The screenshot of index page generated by Flask-AutoIndex This module contains pre-designed template and css file. It is default style, but you can make your own style. .. note:: Flask-AutoIndex uses `Flask-Silk`_ to serve icons. Per default, the icons from Mark James's `Silk`_ icon set are used. These icons are licensed under `Creative Commons Attribution 2.5 License `_ or `3.0 License `_. Before using the icons, read the license. .. _Flask: http://flask.pocoo.org/ .. _mod_autoindex: http://httpd.apache.org/docs/current/mod/mod_autoindex.html .. _Flask-Silk: http://packages.python.org/Flask-Silk .. _Silk: http://www.famfamfam.com/lab/icons/silk/ .. _CC-BY-2.5: http://creativecommons.org/licenses/by/2.5 .. _CC-BY-3.0: http://creativecommons.org/licenses/by/3.0 Installation ============ Install Flask-AutoIndex with ``easy_install`` or ``pip`` command:: $ easy_install Flask-AutoIndex :: $ pip install Flask-AutoIndex or check out development version:: $ git clone git://github.com/sublee/flask-autoindex.git How to Use ========== Flask-AutoIndex is easy and extensible. It supports flask application. We will make the application in flask application. There is a basic usage:: import os.path from flask import Flask from flask_autoindex import AutoIndex app = Flask(__name__) AutoIndex(app, browse_root=os.path.curdir) if __name__ == '__main__': app.run() After running the application, ``http://localhost/`` serves a generated index page which contains the file and directory list in current directory. Or, use a shipped console script. Just type ``fai`` in command line. (yes, ``fai`` is an acronym of Flask-AutoIndex):: $ fai * Running on http://127.0.0.1:5000/ Customizing =========== Routing a specified URL ``````````````````````` Just like a normal flask application or module. Follow the below example:: @app.route('/helloworld') def helloworld(): return 'Hello, world!', 200 ``http://localhost/helloworld`` will serve ``Hello, world!`` not ``/helloworld`` directory. Adding an icon rule ``````````````````` If you want to present ``*.feed`` files with ``rss.png`` icon and present a directory named ``picture`` with ``folder_picture.png`` icon, follow the below example:: idx.add_icon_rule('rss.png', ext='feed') idx.add_icon_rule('folder_picture.png', dirname='pictures') You can change the root directory's icon to your own icon:: idx.add_icon_rule('http://example.org/favicon.ico', cls=RootDirectory) Also you can add the more complex rule with a function:: import re def is_flaskext(ent): return isinstance(ent, Directory) and re.match('[Ff]lask-', ent.name) idx.add_icon_rule('http://example.org/flask-extenstion.png', is_flaskext) Here is a nice example for changing directory's icon to its ``favicon.ico`` file if it exists:: def get_favicon(ent): favicon = 'favicon.ico' if type(ent) is Directory and favicon in ent: return '/' + os.path.join(ent.path, favicon) return False idx.add_icon_rule(get_favicon) .. seealso:: :meth:`AutoIndex.add_icon_rule` Changing Silk's path ```````````````````` :class:`AutoIndex` has ``**silk_options`` keyword arguments for :class:`Silk`. If you want to use the another path for serving silk icons, use ``silk_path`` keyword argument:: idx = AutoIndex(app, silk_path='/myicons') Now you can get a silk icon from ``http://localhost/myicons/folder.png`` not ``http://localhost/__icons__/folder.png``. .. seealso:: The documentation for `Flask-Silk`_ Redesigning the template ```````````````````````` :meth:`AutoIndex.render_autoindex` finds the template from the application's template directory first. When you made the ``autoindex.html`` to the application's template directory, :meth:`AutoIndex.render_autoindex` renders your template:: - myapplication - templates - autoindex.html - __init__.py - views.py Your templates could extend the default Flask-AutoIndex's template, it named ``__autoindex__/autoindex.html``. Here is a basic example: .. sourcecode:: jinja {% extends '__autoindex__/autoindex.html' %} {% block meta %} {{ super() }} {% endblock %} {% block header %}

My Application

{% endblock %} {% block footer %}
{% endblock %} To get extra fields through to your template, pass them in the ``template_context`` keyword argument:: AutoIndex(app, template_context = dict(SITENAME = 'My cool site')) API === Configuration ````````````` .. autoclass:: AutoIndex :members: Models `````` .. autoclass:: Entry :members: .. autoclass:: File :members: .. autoclass:: Directory :members: .. autoclass:: RootDirectory :members: Template ```````` Blocks ------ `meta` The innerHTML of ````. `header` The top of ````. `table` The table for the entry list. `footer` The bottom of ````. Variables --------- `curdir` The current directory object. `entries` The child entry list of ``curdir``. `sort_by` The sorting key. `order` Ascending order(``1``) or Descending order(``-1``). `endpoint` The endpoint which renders a generated page. Licensing and Author ==================== This project is licensed under BSD_. See LICENSE_ for the details. I'm `Heungsub Lee`_. Any regarding questions or patches are welcomed. .. _BSD: http://en.wikipedia.org/wiki/BSD_licenses .. _LICENSE: https://github.com/sublee/flask-autoindex/blob/master/LICENSE .. _Heungsub Lee: http://subl.ee/ Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` flask-autoindex-20160725-02b454/docs/conf.py0000644000175000017500000001612313153471103020314 0ustar jonathanjonathan# -*- coding: utf-8 -*- # # Flask-AutoIndex documentation build configuration file, created by # sphinx-quickstart on Tue Aug 31 00:34:54 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('..')) sys.path.append(os.path.abspath('_themes')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'Flask-AutoIndex' copyright = u'2010-2013, Heungsub Lee' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.2.0' # The full version, including alpha/beta/rc tags. release = '0.2.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. #pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'flask_small' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. html_theme_options = { 'index_logo': 'flask-autoindex.png', 'github_fork': 'sublee/flask-autoindex' } # Add any paths that contain custom themes here, relative to this directory. html_theme_path = ['_themes'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = 'favicon.ico' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'Flask-AutoIndexdoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'Flask-AutoIndex.tex', u'Flask-AutoIndex Documentation', u'Heungsub Lee', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'flask-autoindex', u'Flask-AutoIndex Documentation', [u'Heungsub Lee'], 1) ] flask-autoindex-20160725-02b454/docs/_themes/0000755000175000017500000000000012771613504020446 5ustar jonathanjonathanflask-autoindex-20160725-02b454/docs/make.bat0000644000175000017500000001003413153471103020415 0ustar jonathanjonathan@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Flask-AutoIndex.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Flask-AutoIndex.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end