Module Import alias Import alias TryExcept body Import alias handlers ExceptHandler type NameLoad body Import alias identifier ImportFrom alias ImportFrom alias Assign NameStore TupleLoad Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr ListComp SubscriptLoad NameLoad Index Str comprehension TupleStore NameStore NameStore NameLoad AttributeLoad AttributeLoad NameLoad attr attr For TupleStore NameStore NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Slice Call NameLoad NameLoad Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Expr Yield TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq Call NameLoad NameLoad Num body Return Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Num Return Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore Dict Str Str Str Str Str Str Str Str Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr CompareEq AttributeLoad NameLoad attr Str CompareIs AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Assign NameStore BoolOpOr AttributeLoad NameLoad attr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad BoolOpOr AttributeLoad NameLoad attr Str NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr BoolOpOr AttributeLoad NameLoad attr Str NameLoad decorator_list decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Str
N/A N/A os N/A re N/A N/A N/A json N/A N/A N/A ImportError N/A N/A simplejson json webassets.filter Filter webassets.utils common_path_prefix N/A __all__ N/A JST JSTemplateFilter N/A Filter N/A N/A Common base class for the JST and Handlebars filters, and
    possibly other Javascript templating systems in the future.
     concat N/A N/A self out hunks N/A kwargs N/A N/A N/A N/A self process_templates out hunks kwargs N/A process_templates N/A N/A self out hunks N/A kw N/A N/A N/A NotImplementedError N/A iter_templates_with_base N/A N/A self hunks N/A N/A N/A Helper that for list of ``hunks``, as given to
        ``concat()``, yields 2-tuples of (name, hunk), with name
        being the name of the source file relative to the common
        prefix of all source files.

        In other words, each template gets the shortest possible
        name to identify it.
         N/A base_path N/A N/A N/A self _find_base_path N/A N/A info N/A source_path N/A N/A _ info hunks N/A N/A os path sep N/A N/A hunk info hunks N/A N/A name N/A info N/A source_path N/A name N/A name N/A N/A len base_path N/A name N/A N/A N/A N/A os path splitext name N/A 0 N/A N/A N/A name hunk N/A _find_base_path N/A N/A self paths N/A N/A N/A Hmmm.  There should aways be some common base path. N/A N/A N/A len paths 1 N/A N/A N/A N/A N/A os path dirname N/A paths N/A 0 N/A N/A common_path_prefix paths N/A N/A JST N/A JSTemplateFilter N/A N/A This filter processes generic JavaScript templates. It will generate
    JavaScript code that runs all files through a template compiler, and makes
    the templates available as an object.

    It was inspired by `Jammit`_.

    For example, if you have a file named ``license.jst``:

    .. code-block:: html

        <div class="drivers-license">
          <h2>Name: <%= name %></h2>
          <em>Hometown: <%= birthplace %></em>
        </div>

    Then, after applying this filter, you could use the template in JavaScript:

    .. code-block:: javascript

        JST.license({name : "Moe", birthplace : "Brooklyn"});

    The name of each template is derived from the filename. If your JST files
    are spread over different directories, the path up to the common prefix
    will be included. For example::

        Bundle('templates/app1/license.jst', 'templates/app2/profile.jst',
               filters='jst')

    will make the templates available as ``app1/license`` and ``app2/profile``.

    .. note::
        The filter is "generic" in the sense that it does not actually compile
        the templates, but wraps them in a JavaScript function call, and can
        thus be used with any template language. webassets also has filters
        for specific JavaScript template languages like
        :class:`~.filter.dust.DustJS` or
        :class:`~.filter.handlebars.Handlebars`, and those filters precompile
        the templates on the server, which means a performance boost on the
        client-side.

    Unless configured otherwise, the filter will use the same micro-templating
    language that `Jammit`_ uses, which is turn is the same one that is
    available in `underscore.js`_. The JavaScript code necessary to compile
    such templates will implicitly be included in the filter output.

    *Supported configuration options:*

    JST_COMPILER (template_function)
        A string that is inserted into the generated JavaScript code in place
        of the function to be called that should do the compiling. Unless you
        specify a custom function here, the filter will include the JavaScript
        code of it's own micro-templating language, which is the one used by
        `underscore.js`_ and `Jammit`_.

        If you assign a custom function, it is your responsibility to ensure
        that it is available in your final JavaScript.

        If this option is set to ``False``, then the template strings will be
        output directly, which is to say, ``JST.foo`` will be a string holding
        the raw source of the ``foo`` template.

    JST_NAMESPACE (namespace)
        How the templates should be made available in JavaScript. Defaults to
        ``window.JST``, which gives you a global ``JST`` object.

    JST_BARE (bare)
        Whether everything generated by this filter should be wrapped inside
        an anonymous function. Default to ``False``.

        .. note::

            If you enable this option, the namespace must be a property
            of the ``window`` object, or you won't be able to access the
            templates.

    JST_DIR_SEPARATOR (separator)
        The separator character to use for templates within directories.
        Defaults to '/'

    .. _Jammit:
    .. _underscore.js: http://documentcloud.github.com/underscore/#template
     N/A name jst N/A options N/A template_function namespace bare separator JST_COMPILER JST_NAMESPACE JST_BARE JST_DIR_SEPARATOR N/A max_debug_level None setup N/A N/A self N/A N/A N/A N/A N/A N/A super JST self setup N/A N/A self include_jst_script N/A N/A N/A self template_function template N/A N/A self template_function None N/A process_templates N/A N/A self out hunks N/A kwargs N/A N/A namespace N/A N/A self namespace window.JST N/A N/A N/A self bare False N/A N/A N/A N/A out write (function(){
 N/A N/A N/A out write N/A %s = %s || {};
 N/A namespace namespace N/A N/A self include_jst_script N/A N/A N/A N/A out write N/A %s
 _jst_script N/A N/A name hunk N/A N/A self iter_templates_with_base hunks N/A N/A contents N/A N/A json dumps N/A N/A hunk data N/A N/A N/A out write N/A %s['%s'] =  N/A namespace N/A N/A self _get_jst_name name N/A N/A N/A self template_function False N/A N/A N/A N/A out write N/A %s;
 contents N/A N/A N/A N/A out write N/A %s(%s);
 N/A N/A N/A self template_function template contents N/A N/A N/A self bare False N/A N/A N/A N/A out write })(); N/A _get_jst_name N/A N/A self name N/A N/A N/A Return the name for the JST with any path separators normalised N/A N/A N/A _path_separator_re sub N/A N/A self separator / name N/A N/A N/A _path_separator_re N/A N/A re compile [/\\]+ N/A _jst_script var template = function(str){var fn = new Function('obj', 'var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push(\''+str.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/<%=([\s\S]+?)%>/g,function(match,code){return "',"+code.replace(/\\'/g, "'")+",'";}).replace(/<%([\s\S]+?)%>/g,function(match,code){return "');"+code.replace(/\\'/g, "'").replace(/[\r\n\t]/g,' ')+"__p.push('";}).replace(/\r/g,'\\r').replace(/\n/g,'\\n').replace(/\t/g,'\\t')+"');}return __p.join('');");return fn;};