Module Expr Str ImportFrom alias alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore TupleLoad Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Dict Str body If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad BinOpAdd Str Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpAdd Str Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body If CompareIn NameLoad AttributeLoad NameLoad attr body Continue Assign NameStore Call NameLoad NameLoad Str Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign AttributeStore NameLoad attr ListLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr Str body Assign NameStore BinOpAdd Str NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr Str body AugAssignAdd NameStore Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Str If Call AttributeLoad NameLoad attr Str body For TupleStore NameStore NameStore NameStore AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Continue Assign NameStore SubscriptLoad NameLoad Slice Call NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Slice Num TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Break ExceptHandler type NameLoad name NameStore body Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Call NameLoad AttributeLoad NameLoad attr ListLoad TupleLoad Str Str Return ListLoad Str Call AttributeLoad Call NameLoad NameLoad attr Str Str Str Call AttributeLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad attr Str Str Str Str FunctionDef arguments args NameParam defaults body With Call NameLoad NameLoad Str NameStore body While Num body Assign NameStore Call AttributeLoad NameLoad attr Num If NameLoad body Expr Yield NameLoad orelse Break decorator_list Expr Call NameLoad Str ListLoad TupleLoad Str Str Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpAdd BinOpAdd Str Call AttributeLoad Str attr GeneratorExp BinOpMod Str Call NameLoad NameLoad comprehension NameStore NameLoad Str decorator_list NameLoad decorator_list
N/A N/A :mod:`sassutils.wsgi` --- WSGI middleware for development purpose
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 __future__ absolute_import with_statement N/A collections N/A logging N/A os N/A os.path pkg_resources resource_filename sass CompileError builder Manifest N/A __all__ N/A SassMiddleware SassMiddleware N/A object N/A N/A WSGI middleware for development purpose.  Everytime a CSS file has
    requested it finds a matched SASS/SCSS source file and then compiled
    it into CSS.

    It shows syntax errors in three ways:

    Heading comment
        The result CSS includes detailed error message in the heading
        CSS comment e.g.:

        .. code-block:: css

           /*
           Error: invalid property name
           */

    Red text in ``body:before``
        The result CSS draws detailed error message in ``:before``
        pseudo-class of ``body`` element e.g.::

        .. code-block:: css

           /*
           body:before {
             content: 'Error: invalid property name';
             color: maroon;
             background-color: white;
           }
           */

        In most cases you could be aware of syntax error by refreshing your
        working document because it will removes all other styles and leaves
        only a red text.

    :mod:`logging`
        It logs syntax errors if exist during compilation to
        ``sassutils.wsgi.SassMiddleware`` logger with level ``ERROR``.

        To enable this::

            from logging import Formatter, StreamHandler, getLogger
            logger = getLogger('sassutils.wsgi.SassMiddleware')
            handler = StreamHandler(level=logging.ERROR)
            formatter = Formatter(fmt='*' * 80 + '
%(message)s
' + '*' * 80)
            handler.setFormatter(formatter)
            logger.addHandler(handler)

        Or simply::

            import logging
            logging.basicConfig()

    :param app: the WSGI application to wrap
    :type app: :class:`collections.Callable`
    :param manifests: build settings.  the same format to
                      :file:`setup.py` script's ``sass_manifests``
                      option
    :type manifests: :class:`collections.Mapping`
    :param package_dir: optional mapping of package names to directories.
                        the same format to :file:`setup.py` script's
                        ``package_dir`` option
    :type package_dir: :class:`collections.Mapping`

    .. versionchanged:: 0.4.0
       It creates also source map files with filenames followed by
       :file:`.map` suffix.

    .. versionadded:: 0.8.0
       It logs syntax errors if exist during compilation to
       ``sassutils.wsgi.SassMiddleware`` logger with level ``ERROR``.

     __init__ N/A N/A self app manifests package_dir error_status N/A N/A 200 OK N/A N/A N/A N/A callable app N/A N/A N/A TypeError N/A app must be a WSGI-compliant callable object, not  N/A repr app N/A N/A self app app N/A N/A self manifests N/A N/A Manifest normalize_manifests manifests N/A N/A N/A isinstance package_dir N/A collections Mapping N/A N/A N/A TypeError N/A package_dir must be a mapping object, not  N/A repr package_dir N/A N/A self error_status error_status N/A N/A self package_dir N/A dict package_dir N/A package_name N/A self manifests N/A N/A N/A package_name N/A self package_dir N/A N/A N/A path N/A resource_filename package_name N/A N/A N/A self package_dir N/A package_name path N/A N/A self paths N/A N/A N/A package_name manifest N/A N/A N/A self manifests items N/A N/A wsgi_path N/A manifest wsgi_path N/A N/A N/A N/A wsgi_path startswith / N/A N/A wsgi_path N/A / wsgi_path N/A N/A N/A N/A wsgi_path endswith / N/A N/A wsgi_path / N/A package_dir N/A N/A self package_dir N/A package_name N/A N/A N/A N/A self paths append N/A wsgi_path package_dir manifest N/A __call__ N/A N/A self environ start_response N/A N/A N/A path N/A N/A environ get PATH_INFO / N/A N/A N/A path endswith .css N/A N/A N/A prefix package_dir manifest N/A self paths N/A N/A N/A N/A N/A path startswith prefix N/A N/A N/A css_filename N/A path N/A N/A len prefix N/A sass_filename N/A css_filename N/A -4 N/A N/A N/A result N/A N/A manifest build_one package_dir sass_filename source_map True N/A N/A N/A N/A IOError OSError N/A N/A N/A N/A CompileError N/A e N/A N/A logger N/A N/A logging getLogger N/A __name__ .SassMiddleware N/A N/A N/A logger error N/A str e N/A N/A start_response N/A self error_status N/A N/A Content-Type text/css; charset=utf-8 N/A N/A /*
 N/A N/A N/A str e encode utf-8 
*/

 body:before { content:  N/A N/A N/A N/A self quote_css_string N/A str e encode utf-8 ; color: maroon; background-color: white ; white-space: pre-wrap; display: block ; font-family: "Courier New", monospace; user-select: text; } read_file N/A N/A path N/A N/A N/A N/A open path rb in_ N/A N/A 1 N/A N/A chunk N/A N/A in_ read 4096 N/A chunk N/A N/A N/A chunk N/A N/A N/A N/A N/A start_response 200 OK N/A N/A Content-Type text/css N/A N/A read_file N/A N/A N/A os path join package_dir result N/A N/A N/A self app environ start_response N/A quote_css_string N/A N/A s N/A N/A N/A Quotes a string as CSS string literal. N/A N/A N/A ' N/A N/A join N/A N/A \%06x N/A ord c N/A c s ' N/A staticmethod N/A