Flask-AutoIndex-0.6.2/0000775000175600017560000000000013343772240014104 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/Flask_AutoIndex.egg-info/0000775000175600017560000000000013343772240020616 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/Flask_AutoIndex.egg-info/PKG-INFO0000664000175600017560000000245413343772240021720 0ustar subsub00000000000000Metadata-Version: 1.1 Name: Flask-AutoIndex Version: 0.6.2 Summary: The mod_autoindex for Flask Home-page: http://pythonhosted.org/Flask-AutoIndex Author: Heungsub Lee Author-email: sub@subl.ee License: BSD Description-Content-Type: UNKNOWN Description: 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 `_ Platform: any Classifier: Development Status :: 4 - Beta Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content Classifier: Topic :: Software Development :: Libraries :: Python Modules Flask-AutoIndex-0.6.2/Flask_AutoIndex.egg-info/entry_points.txt0000664000175600017560000000006513343772240024115 0ustar subsub00000000000000[console_scripts] fai = flask_autoindex.run:app.run Flask-AutoIndex-0.6.2/Flask_AutoIndex.egg-info/dependency_links.txt0000664000175600017560000000000113343772240024664 0ustar subsub00000000000000 Flask-AutoIndex-0.6.2/Flask_AutoIndex.egg-info/top_level.txt0000664000175600017560000000002013343772240023340 0ustar subsub00000000000000flask_autoindex Flask-AutoIndex-0.6.2/Flask_AutoIndex.egg-info/requires.txt0000664000175600017560000000005213343772240023213 0ustar subsub00000000000000Flask>=0.8 Flask-Silk>=0.2 future>=0.13.0 Flask-AutoIndex-0.6.2/Flask_AutoIndex.egg-info/SOURCES.txt0000664000175600017560000000565613343772240022516 0ustar subsub00000000000000LICENSE MANIFEST.in README setup.cfg setup.py Flask_AutoIndex.egg-info/PKG-INFO Flask_AutoIndex.egg-info/SOURCES.txt Flask_AutoIndex.egg-info/dependency_links.txt Flask_AutoIndex.egg-info/entry_points.txt Flask_AutoIndex.egg-info/not-zip-safe Flask_AutoIndex.egg-info/requires.txt Flask_AutoIndex.egg-info/top_level.txt docs/conf.py docs/index.rst docs/_static/example.png docs/_static/flask-autoindex.png flask_autoindex/__init__.py flask_autoindex/entry.py flask_autoindex/icons.py flask_autoindex/run.py flask_autoindex/static/asc.gif flask_autoindex/static/autoindex.css flask_autoindex/static/desc.gif flask_autoindex/templates/__autoindex__/autoindex.html flask_autoindex/templates/__autoindex__/macros.html tests/__init__.py tests/blueprinttest/__init__.py tests/static/helloworld.txt tests/static/test.7z tests/static/test.ai tests/static/test.alz tests/static/test.app tests/static/test.applescript tests/static/test.asp tests/static/test.avi tests/static/test.bak tests/static/test.bat tests/static/test.bin tests/static/test.bmp tests/static/test.bup tests/static/test.c tests/static/test.cab tests/static/test.cer tests/static/test.cfg tests/static/test.cgi tests/static/test.com tests/static/test.conf tests/static/test.cpl tests/static/test.cpp tests/static/test.css tests/static/test.csv tests/static/test.cur tests/static/test.db tests/static/test.dll tests/static/test.dmg tests/static/test.doc tests/static/test.docx tests/static/test.eps tests/static/test.exe tests/static/test.fla tests/static/test.flv tests/static/test.gif tests/static/test.h tests/static/test.htm tests/static/test.html tests/static/test.hwp tests/static/test.ico tests/static/test.ics tests/static/test.ini tests/static/test.iso tests/static/test.jar tests/static/test.java tests/static/test.jpeg tests/static/test.jpg tests/static/test.js tests/static/test.json tests/static/test.jsp tests/static/test.less tests/static/test.log tests/static/test.markdown tests/static/test.md tests/static/test.mid tests/static/test.mov tests/static/test.mp3 tests/static/test.mp4 tests/static/test.mpa tests/static/test.mpeg tests/static/test.mpg tests/static/test.pdf tests/static/test.php tests/static/test.pkg tests/static/test.png tests/static/test.ppt tests/static/test.pptx tests/static/test.psd tests/static/test.py tests/static/test.rar tests/static/test.rb tests/static/test.rss tests/static/test.rtf tests/static/test.sh tests/static/test.smi tests/static/test.sql tests/static/test.svg tests/static/test.swf tests/static/test.sys tests/static/test.tar tests/static/test.tar.gz tests/static/test.tgz tests/static/test.tif tests/static/test.tmp tests/static/test.toast tests/static/test.torrent tests/static/test.ttf tests/static/test.txt tests/static/test.vb tests/static/test.vcd tests/static/test.vcf tests/static/test.wav tests/static/test.wmv tests/static/test.xhtml tests/static/test.xls tests/static/test.xlsx tests/static/test.xml tests/static/test.xsl tests/static/test.yml tests/static/test.zipFlask-AutoIndex-0.6.2/Flask_AutoIndex.egg-info/not-zip-safe0000664000175600017560000000000113317674102023043 0ustar subsub00000000000000 Flask-AutoIndex-0.6.2/PKG-INFO0000664000175600017560000000245413343772240015206 0ustar subsub00000000000000Metadata-Version: 1.1 Name: Flask-AutoIndex Version: 0.6.2 Summary: The mod_autoindex for Flask Home-page: http://pythonhosted.org/Flask-AutoIndex Author: Heungsub Lee Author-email: sub@subl.ee License: BSD Description-Content-Type: UNKNOWN Description: 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 `_ Platform: any Classifier: Development Status :: 4 - Beta Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content Classifier: Topic :: Software Development :: Libraries :: Python Modules Flask-AutoIndex-0.6.2/LICENSE0000664000175600017560000000266413317673730015126 0ustar subsub00000000000000Copyright (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-0.6.2/setup.py0000664000175600017560000000337413343772207015630 0ustar subsub00000000000000""" 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.2', 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-0.6.2/docs/0000775000175600017560000000000013343772240015034 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/docs/conf.py0000664000175600017560000001612313317673730016343 0ustar subsub00000000000000# -*- 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-0.6.2/docs/index.rst0000664000175600017560000001402613317673730016705 0ustar subsub00000000000000Flask-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-0.6.2/docs/_static/0000775000175600017560000000000013343772240016462 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/docs/_static/flask-autoindex.png0000664000175600017560000003233513317673730022301 0ustar subsub00000000000000PNG  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 9FL4uZlJFxWG~iB?8o "#D;':6K ;SCu蛅負No뮟ٹ6m#HW?>!(yy^`:u3 X:g),{ පeUW[T,ϚޠW9>EaI}M:@,hWtu»Ա{V`UܭE:XUy!m=蜥t e>[ʒ=xɱCZtm*)qA :;Ukƿz7chAH+M\=%|6&$0}*/{R ^9k叶~.ߔmy˙j RuRy FmuyCOQ2Gb=|E6T;#({1দ(괥pׁ߉5݃ LF`K^>,`mXU̓6P^"LQHJ!_%E;d`6qxX>8]xN]8n>;*@;jK Rj. Jcb3\jW ={40bG#9lT6EgՠE&0,Yr=z5k_Byv>;V}*lnC#)ՎG?dS_AՔ ڍ|p+ C`akpi'#M XU,^YjR1'~7%+3G3dJr[ͬ2][$؉f| ?{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^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`_. :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.6.2' __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) # Disallow to access to an upper path. # This issue was reported by @r4dian. # https://github.com/sublee/flask-autoindex/issues/18 relpath = os.path.relpath(abspath, rootdir.abspath) if relpath.startswith(os.path.pardir): return abort(403) 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-0.6.2/flask_autoindex/static/0000775000175600017560000000000013343772240020553 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/flask_autoindex/static/asc.gif0000664000175600017560000000006513317673730022016 0ustar subsub00000000000000GIF89a !,   ≴Y[;Flask-AutoIndex-0.6.2/flask_autoindex/static/desc.gif0000664000175600017560000000006513317673730022166 0ustar subsub00000000000000GIF89a !,  ~^ZT;Flask-AutoIndex-0.6.2/flask_autoindex/static/autoindex.css0000664000175600017560000000506713317673730023302 0ustar subsub00000000000000* { 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-0.6.2/flask_autoindex/entry.py0000664000175600017560000002517613317673730021017 0ustar subsub00000000000000from 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).replace(os.path.sep, '/'), 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, '..').replace(os.path.sep, '/') super(_ParentDirectory, self).__init__(path, child_directory.rootdir) class GuessError(RuntimeError): pass class MarkupError(RuntimeError): pass Flask-AutoIndex-0.6.2/flask_autoindex/templates/0000775000175600017560000000000013343772240021262 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/flask_autoindex/templates/__autoindex__/0000775000175600017560000000000013343772240024056 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/flask_autoindex/templates/__autoindex__/autoindex.html0000664000175600017560000000201013317673730026742 0ustar subsub00000000000000{% 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-0.6.2/flask_autoindex/templates/__autoindex__/macros.html0000664000175600017560000000343213317673730026237 0ustar subsub00000000000000{% 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-0.6.2/tests/0000775000175600017560000000000013343772240015246 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/__init__.py0000664000175600017560000002404313343711115017354 0ustar subsub00000000000000from __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') def test_parent_of_root(self): with self.app.test_request_context(): assert self.get('.').status_code == 200 assert self.get('..').status_code == 403 assert self.get('../..').status_code == 403 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-0.6.2/tests/static/0000775000175600017560000000000013343772240016535 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.rb0000664000175600017560000000000013317673730020034 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.mp40000664000175600017560000000000013317673730020131 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.csv0000664000175600017560000000000013317673730020224 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.zip0000664000175600017560000000000013317673730020233 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.png0000664000175600017560000000000013317673730020215 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.7z0000664000175600017560000000000013317673730017771 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.txt0000664000175600017560000000000013317673730020250 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.rar0000664000175600017560000000000013317673730020215 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.sys0000664000175600017560000000000013317673730020247 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.cfg0000664000175600017560000000000013317673730020170 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.iso0000664000175600017560000000000013317673730020223 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.mpg0000664000175600017560000000000013317673730020214 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.mid0000664000175600017560000000000013317673730020202 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.php0000664000175600017560000000000013317673730020220 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.js0000664000175600017560000000000013317673730020045 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.ics0000664000175600017560000000000013317673730020207 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.tgz0000664000175600017560000000000013317673730020235 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.svg0000664000175600017560000000000013317673730020230 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.mpa0000664000175600017560000000000013317673730020206 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.tar.gz0000664000175600017560000000000013317673730020636 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.toast0000664000175600017560000000000013317673730020563 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.doc0000664000175600017560000000000013317673730020176 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.xsl0000664000175600017560000000000013317673730020237 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.ini0000664000175600017560000000000013317673730020210 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.jar0000664000175600017560000000000013317673730020205 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.alz0000664000175600017560000000000013317673730020217 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.ico0000664000175600017560000000000013317673730020203 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.mpeg0000664000175600017560000000000013317673730020361 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.ai0000664000175600017560000000000013317673730020022 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.xml0000664000175600017560000000000013317673730020231 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.pkg0000664000175600017560000000000013317673730020212 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.bak0000664000175600017560000000000013317673730020166 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.py0000664000175600017560000000000013317673730020061 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.pptx0000664000175600017560000000000013317673730020424 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.mov0000664000175600017560000000000013317673730020232 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.applescript0000664000175600017560000000000013317673730021757 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.wav0000664000175600017560000000000013317673730020226 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.bin0000664000175600017560000000000013317673730020201 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/helloworld.txt0000664000175600017560000000001613317673730021453 0ustar subsub00000000000000Hello, world! Flask-AutoIndex-0.6.2/tests/static/test.bup0000664000175600017560000000000013317673730020217 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.tmp0000664000175600017560000000000013317673730020231 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.hwp0000664000175600017560000000000013317673730020227 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.log0000664000175600017560000000000013317673730020212 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.exe0000664000175600017560000000000013317673730020212 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.less0000664000175600017560000000000013317673730020377 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.sql0000664000175600017560000000000013317673730020230 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.c0000664000175600017560000000000013317673730017653 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.dmg0000664000175600017560000000000013317673730020200 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.xhtml0000664000175600017560000000000013317673730020565 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.vcf0000664000175600017560000000000013317673730020207 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.conf0000664000175600017560000000000013317673730020356 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.tar0000664000175600017560000000000013317673730020217 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.db0000664000175600017560000000000013317673730020016 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.cgi0000664000175600017560000000000013317673730020173 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.swf0000664000175600017560000000000013317673730020230 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.pdf0000664000175600017560000000000013317673730020202 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.cab0000664000175600017560000000000013317673730020156 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.dll0000664000175600017560000000000013317673730020204 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.bmp0000664000175600017560000000000013317673730020207 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.mp30000664000175600017560000000000013317673730020130 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.bat0000664000175600017560000000000013317673730020177 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.vb0000664000175600017560000000000013317673730020040 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.md0000664000175600017560000000000013317673730020031 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.cpl0000664000175600017560000000000013317673730020207 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.avi0000664000175600017560000000000013317673730020210 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.ppt0000664000175600017560000000000013317673730020234 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.cur0000664000175600017560000000000013317673730020222 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.cpp0000664000175600017560000000000013317673730020213 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.cer0000664000175600017560000000000013317673730020202 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.wmv0000664000175600017560000000000013317673730020242 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.vcd0000664000175600017560000000000013317673730020205 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.ttf0000664000175600017560000000000013317673730020226 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.com0000664000175600017560000000000013317673730020207 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.jsp0000664000175600017560000000000013317673730020225 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.jpg0000664000175600017560000000000013317673730020211 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.yml0000664000175600017560000000000013317673730020232 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.asp0000664000175600017560000000000013317673730020214 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.h0000664000175600017560000000000013317673730017660 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.java0000664000175600017560000000000013317673730020352 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.markdown0000664000175600017560000000000013317673730021253 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.sh0000664000175600017560000000000013317673730020043 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.htm0000664000175600017560000000000013317673730020221 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.torrent0000664000175600017560000000000013317673730021126 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.xlsx0000664000175600017560000000000013317673730020427 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.rtf0000664000175600017560000000000013317673730020224 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.css0000664000175600017560000000000013317673730020221 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.flv0000664000175600017560000000000013317673730020220 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.psd0000664000175600017560000000000013317673730020217 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.html0000664000175600017560000000000013317673730020375 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.xls0000664000175600017560000000000013317673730020237 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.docx0000664000175600017560000000000013317673730020366 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.app0000664000175600017560000000000013317673730020211 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.fla0000664000175600017560000000000013317673730020173 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.tif0000664000175600017560000000000013317673730020213 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.rss0000664000175600017560000000000013317673730020240 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.smi0000664000175600017560000000000013317673730020221 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.eps0000664000175600017560000000000013317673730020220 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.json0000664000175600017560000000000013317673730020402 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.jpeg0000664000175600017560000000000013317673730020356 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/static/test.gif0000664000175600017560000000000013317673730020176 0ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/blueprinttest/0000775000175600017560000000000013343772240020152 5ustar subsub00000000000000Flask-AutoIndex-0.6.2/tests/blueprinttest/__init__.py0000664000175600017560000000007513317673730022272 0ustar subsub00000000000000from flask import Blueprint bp = Blueprint('test', __name__)