Metadata-Version: 1.0
Name: pyramid_assetgen
Version: 0.3
Summary: Integrate Assetgen with the Pyramid framework.
Home-page: http://github.com/thruflo/pyramid_assetgen
Author: James Arthur
Author-email: username: thruflo, domain: gmail.com
License: This is free and unencumbered software released into the public domain.
Description: Provides an ``add_assetgen_manifest`` `configuration directive`_ and
        ``AssetGenRequestMixin`` `custom request factory`_ mixin class that can be
        used to integrate `Assetgen`_ with a `Pyramid`_ application.
        
        Configure your `Pyramid`_ app (e.g.: in your main / WSGI app factory
        function)::
        
        from pyramid.request import Request
        class MyRequest(AssetGenRequestMixin, Request): pass
        config.set_request_factory(MyRequest)
        config.add_directive('add_assetgen_manifest', add_assetgen_manifest)
        
        (Note that the ``AssetGenRequestMixin`` argument must come before ``Request``
        in your request factory class definition).
        
        Expose the directory your assetgen'd static files are in as per normal using
        ``add_static_view`` and then register an assetgen manifest for the directory
        you've exposed by calling ``add_assetgen_manifest`` with the same path or
        pyramid asset specification you passed to ``add_static_view``, e.g., assuming
        you have a manifest file at ``'mypkg:static/assets.json``::
        
        config.add_static_view('static', 'mypkg:static')
        config.add_assetgen_manifest('mypkg:static')
        
        If your manifest file is somewhere else, use the ``manifest`` keyword argument
        to specify where it is, e.g.::
        
        config.add_assetgen_manifest('mypkg:static', manifest='/foo/bar.json')
        
        Once configured, you can use ``request.static_path(path, **kw)`` and
        ``request.static_url(path, **kw)`` as normal, e.g.::
        
        request.static_url('mypkg:static/base.js')
        
        Under the hood, ``static_url`` will now check the path to the static file
        you're serving and, if it's in a directory that you've exposed with an
        assetgen manifest, will look in the manifest file for a key that matches
        the path (relative to the directory) and, if found, will expand it.
        
        So, for example, if you have registered a manifest containing::
        
        {'foo.js': 'foo-fdsf465ds4f567ds4ds5674567f4s7.js'}
        
        Calling::
        
        request.static_url('mypkg:static/foo.js')
        
        Will return::
        
        '/static/foo-fdsf465ds4f567ds4ds5674567f4s7.js'
        
        _`assetgen`: http://pypi.python.org/pypi/assetgen
        _`configuration directive`: http://readthedocs.org/docs/pyramid/en/latest/narr/extconfig.html
        _`custom request factory`: http://readthedocs.org/docs/pyramid/en/latest/narr/hooks.html#changing-the-request-factory
        _`pyramid`: http://readthedocs.org/docs/pyramid
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: Public Domain
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Framework :: Pylons
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Software Development :: Libraries :: Python Modules
