{ "info": { "author": "James Arthur", "author_email": "username: thruflo, domain: gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Pylons", "Intended Audience :: Developers", "License :: Public Domain", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Pyramid Assetgen\n\n[pyramid_assetgen][] allows you to integrate [Assetgen][] with a [Pyramid][]\nproject.\n\n## tl;dr\n\nInclude the package, set a custom request factory (using `AssetGenRequestMixin`\nas the *first* class you inherit from):\n\n class MyRequest(AssetGenRequestMixin, Request): pass\n config.set_request_factory(MyRequest)\n config.include('pyramid_assetgen')\n\nUse the `add_assetgen_manifest` configuration directive to associate an Assetgen\nmanifest file with a static directory:\n\n config.add_static_view('static', 'mypkg:static')\n # defaults to look for an assets.json file in the same directory\n config.add_assetgen_manifest('mypkg:static')\n\nAnd then just use Pyramid's built-in `request.static_url(path, **kw)` as normal.\n\n## Rationale\n\n[Assetgen]() is a static file build tool. When using in production, you can\nenable its hashing mode to output files with a hash in the filename. This means\nthat when you change a file (for example, maybe updating your site's stylesheet)\nits name will change.\n\nOn the one hand this is excellent news, as it allows you to implement an optimal\nHTTP caching strategy (telling browser clients to cache your static files\nforever). On the other, it means you need to update your templates and / or view\ncode to serve the right url to resolves to the hashed filename. This is\nrelatively easy when you're using [Pyramid]() as you're already using a dynamic\nfunction to generate your static urls: `request.static_url`.\n\nThis package, [pyramid_assetgen]() extends the Pyramid machinery to automatically\nupdate your static urls so that they resolve to the correct hashed file names.\nYou can use it to integrate [Assetgen]() with your [Pyramid]() application without\nhaving to change any of your templates or view code or learn any new APIs.\n\n## Workflow\n\nIf you run a Pyramid application configured to look for a manifest file, then the\nfile needs to be there, otherwise the application will throw an exception (at\nconfiguration time). You should thus build your manifest file using something\nlike:\n\n assetgen etc/assetgen.yaml --force\n\nBefore you run your Pyramid app with something like:\n\n pserve etc/production.ini\n\nIf running in development mode using [paste.reloader], e.g.:\n\n pserve etc/development.ini --reload\n\nYou could add your manifest file to the list of files the reloader should watch\nusing, e.g.:\n\n from paste.reloader import add_file_callback\n def watch_manifest_files():\n return ['/var/www/static/assets.json',]\n add_file_callback(watch_manifest_files)\n\nHowever, you're unlikely to need this, as you shouldn't auto-reload in production\nand in development mode you shouldn't hash your assetgen files.\n\n## Configuration\n\nIf we presume `config` is a `pyramid.config.Configurator` instance, (perhaps\navailable in your main / WSGI app factory function), we can add the directive\neither using:\n\n from pyramid_assetgen import add_assetgen_manifest\n config.add_directive('add_assetgen_manifest', add_assetgen_manifest)\n\nOr more simply:\n\n config.include('pyramid_assetgen')\n\nIn addition, you'll need to extend the default request factory using, e.g.:\n\n from pyramid.request import Request\n from pyramid_assetgen import AssetGenRequestMixin\n \n class MyRequest(AssetGenRequestMixin, Request):\n pass\n \n config.set_request_factory(MyRequest)\n\n(Note that the `AssetGenRequestMixin` argument must come **before** `Request` in\nyour request factory class definition. Otherwise the `static_url` method will\nnot be overridden).\n\n## Usage\n\nWith that configuration, when you expose a static directory using \n`config.add_static_view`, you can now associate an Assetgen manifest with it:\n\n config.add_static_view('static', 'mypkg:static')\n config.add_assetgen_manifest('mypkg:static')\n\nThis will look for a manifest file in `mypkg:static/assets.json`. If the\nfile is somewhere else use:\n\n config.add_assetgen_manifest('mypkg:static', manifest='/foo/bar.json')\n\nYou can then use `request.static_path` and `request.static_url` as normal.\nSo, for example, if you have registered a manifest containing:\n\n {'foo.js': 'foo-fdsf465ds4f567ds4ds5674567f4s7.js'}\n\nCalling:\n\n request.static_path('mypkg:static/foo.js')\n\nWill return:\n\n '/static/foo-fdsf465ds4f567ds4ds5674567f4s7.js'\n\n## Tests\n\nI've run the tests under Python2.6 and Python3.2 using, e.g.:\n\n $ ../bin/nosetests --cover-package=src/pyramid_assetgen --cover-erase --with-coverage --with-doctest\n .......\n Name Stmts Miss Cover Missing\n -------------------------------------------------------------------\n src/pyramid_assetgen/__init__ 59 0 100% \n src/pyramid_assetgen/tests/__init__ 58 0 100% \n -------------------------------------------------------------------\n TOTAL 117 0 100% \n ----------------------------------------------------------------------\n Ran 7 tests in 0.552s\n \n OK\n\n[assetgen]: http://github.com/tav/assetgen\n[pyramid]: http://pypi.python.org/pypi/pyramid\n[pyramid_assetgen]: http://github.com/thruflo/pyramid_assetgen", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/thruflo/pyramid_assetgen", "keywords": null, "license": "This is free and unencumbered software released into the public domain.", "maintainer": null, "maintainer_email": null, "name": "pyramid_assetgen", "package_url": "https://pypi.org/project/pyramid_assetgen/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyramid_assetgen/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/thruflo/pyramid_assetgen" }, "release_url": "https://pypi.org/project/pyramid_assetgen/0.5.5/", "requires_dist": null, "requires_python": null, "summary": "Integrate Assetgen with the Pyramid framework.", "version": "0.5.5" }, "last_serial": 1071368, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3bee946f4e6d89a5117116b4d311447a", "sha256": "a4072dbe75308d0412452fe1e77f3ed81f795f66718650d4a569bd7924d30c69" }, "downloads": -1, "filename": "pyramid_assetgen-0.1.tar.gz", "has_sig": false, "md5_digest": "3bee946f4e6d89a5117116b4d311447a", "packagetype": "bdist_egg", "python_version": "any", "requires_python": null, "size": 7122, "upload_time": "2012-01-16T16:02:59", "url": "https://files.pythonhosted.org/packages/19/b3/c40fbbe9f3a78a8d3d5b3b642c21b167c357f0c945fc93750ba433ad8580/pyramid_assetgen-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "03f1a91d7d4223334450d457f0a0e0f4", "sha256": "f9028708a129fd064ed20a934d6824a02450638a2617fdd6464510fed0ea754d" }, "downloads": -1, "filename": "pyramid_assetgen-0.2.tar.gz", "has_sig": false, "md5_digest": "03f1a91d7d4223334450d457f0a0e0f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20914, "upload_time": "2012-01-18T19:00:37", "url": "https://files.pythonhosted.org/packages/45/01/1983d8cde29f13f236dbd6bd7e028e5c00e77026821e6ac29e0eac29949e/pyramid_assetgen-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "264362ab90c5d62bd745489cc629d00d", "sha256": "7a58be7e1e3eabfe6401594271198a0aa5728f0b1db3ebfda4e5333e3c56158c" }, "downloads": -1, "filename": "pyramid_assetgen-0.2.1.tar.gz", "has_sig": false, "md5_digest": "264362ab90c5d62bd745489cc629d00d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21181, "upload_time": "2012-01-18T19:12:42", "url": "https://files.pythonhosted.org/packages/d4/ab/895e395a50c874711db8d004701c9405df35135388813086a67bc64c1f99/pyramid_assetgen-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "4956a5a02241c33d5ced4342b4d9b6e4", "sha256": "05f12e2d4a0821fe459ee8500c92f97d300bfe229cef1c2e9cb5c97bbda99b08" }, "downloads": -1, "filename": "pyramid_assetgen-0.2.2.tar.gz", "has_sig": false, "md5_digest": "4956a5a02241c33d5ced4342b4d9b6e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8886, "upload_time": "2012-01-20T13:45:58", "url": "https://files.pythonhosted.org/packages/45/50/35d9df7f5c9222d47b6c4847e64e673e7b0688e8b5619b440db07a050b4f/pyramid_assetgen-0.2.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "8af7e703f940094e366efc28b17d2016", "sha256": "8aba253612354ba3e68176659a81906ea335d6ada6e256646ab0e5e8ee2a2c2a" }, "downloads": -1, "filename": "pyramid_assetgen-0.3.tar.gz", "has_sig": false, "md5_digest": "8af7e703f940094e366efc28b17d2016", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8443, "upload_time": "2012-01-20T22:15:35", "url": "https://files.pythonhosted.org/packages/31/36/4e9f1918bda4043d1011104f64fdcd43a7cc574574a9e99df45860dc38fe/pyramid_assetgen-0.3.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "372b8d3feae4b2b6d658f72f89de12ca", "sha256": "37b9c80d17e1c4ba9632b747fb8af4da9ecfa25d7970ed2b4edf598b93a181bf" }, "downloads": -1, "filename": "pyramid_assetgen-0.4.1.tar.gz", "has_sig": false, "md5_digest": "372b8d3feae4b2b6d658f72f89de12ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9181, "upload_time": "2013-05-07T10:21:34", "url": "https://files.pythonhosted.org/packages/3e/5f/95370e339f956c9b0069944d1cf75ca1242310a695bf4c85c913966fe8dd/pyramid_assetgen-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "f285476b2dcd2062a74fc874ae26be74", "sha256": "0bc2cbf08cebce5360a2bdb237e479040e58d5e1676ecdbfbfc58f332b181cf9" }, "downloads": -1, "filename": "pyramid_assetgen-0.4.2.tar.gz", "has_sig": false, "md5_digest": "f285476b2dcd2062a74fc874ae26be74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9215, "upload_time": "2013-05-07T10:26:48", "url": "https://files.pythonhosted.org/packages/7e/5f/95a68fee762cb48e8ac97640efd49d4ad5b951ba68f46d93173d2530611b/pyramid_assetgen-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "40d4b16bb6fed6f1b138fe0928189754", "sha256": "bf21636b9ec19127f30705a3ad5dff92dd15cf895d4ff619b222116a8e589e1f" }, "downloads": -1, "filename": "pyramid_assetgen-0.4.3.tar.gz", "has_sig": false, "md5_digest": "40d4b16bb6fed6f1b138fe0928189754", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9238, "upload_time": "2013-05-08T08:51:19", "url": "https://files.pythonhosted.org/packages/0a/ff/953916bc828b875d50b422a88c8ff050d8537705ecd50d130bfc34fd0341/pyramid_assetgen-0.4.3.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "ccb2ac1112a42b9c140e8229349251df", "sha256": "32eb7ae17667f881d68be6570afc2480aad75aed15077140d877b567f2a1ce16" }, "downloads": -1, "filename": "pyramid_assetgen-0.5.tar.gz", "has_sig": false, "md5_digest": "ccb2ac1112a42b9c140e8229349251df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9817, "upload_time": "2014-03-14T18:38:27", "url": "https://files.pythonhosted.org/packages/8f/09/c9b809b6f428d5b89fabaf3c393bbb787845c5eeaad51a775b046fe0b2f3/pyramid_assetgen-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "0bcab97fdf48b00568e976c0dd95d79d", "sha256": "2a73696d788afbe63f913491c4e619c25a1b57bdeaf857c29a502a4660095c1e" }, "downloads": -1, "filename": "pyramid_assetgen-0.5.1.tar.gz", "has_sig": false, "md5_digest": "0bcab97fdf48b00568e976c0dd95d79d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9868, "upload_time": "2014-03-14T18:45:20", "url": "https://files.pythonhosted.org/packages/b0/58/2ddbad18a471849788a4e3480b519f00b2063826453b2be90d242a0bf01c/pyramid_assetgen-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "e27d9db701f1ae2d73f82a336fe13f4c", "sha256": "052a942a24317ddd25e688bf059a1816972796be492e1bc5f687f5a37a2ee1fc" }, "downloads": -1, "filename": "pyramid_assetgen-0.5.2.tar.gz", "has_sig": false, "md5_digest": "e27d9db701f1ae2d73f82a336fe13f4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9713, "upload_time": "2014-03-17T11:10:02", "url": "https://files.pythonhosted.org/packages/1a/98/1d6317a594cd3a6cca5686d209541a3f62ea242cf45794ffcd4acf3949ff/pyramid_assetgen-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "2c2805d337cd5d158e849bb286a5ead3", "sha256": "61e116568f0ca3c53ba75900194b9ebae274afd56bf5448eef0084074097ff16" }, "downloads": -1, "filename": "pyramid_assetgen-0.5.3.tar.gz", "has_sig": false, "md5_digest": "2c2805d337cd5d158e849bb286a5ead3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9861, "upload_time": "2014-03-17T11:25:00", "url": "https://files.pythonhosted.org/packages/82/31/261b549b42dad32eed5aea1383439073c49c4dad2f8065153e61d00a1381/pyramid_assetgen-0.5.3.tar.gz" } ], "0.5.4": [ { "comment_text": "", "digests": { "md5": "372ad0fae43243b7935d7e0cdff8c937", "sha256": "78756d5b1c3b8abf1f8a8f03227e84588161ab87429e2d9a27e7b060528de537" }, "downloads": -1, "filename": "pyramid_assetgen-0.5.4.tar.gz", "has_sig": false, "md5_digest": "372ad0fae43243b7935d7e0cdff8c937", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10069, "upload_time": "2014-03-17T11:32:15", "url": "https://files.pythonhosted.org/packages/36/f4/0d5d1ec3905657f04abbb2bd83d3b3f3ba085d50fb8fb544ecd05394ec1b/pyramid_assetgen-0.5.4.tar.gz" } ], "0.5.5": [ { "comment_text": "", "digests": { "md5": "798a3bd4b9689b1fca888f8dc11fdd8f", "sha256": "57aec101691d8f891ffc97591e453a6b575d4aca9c02cb95a24f8af9f3469c49" }, "downloads": -1, "filename": "pyramid_assetgen-0.5.5.tar.gz", "has_sig": false, "md5_digest": "798a3bd4b9689b1fca888f8dc11fdd8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10058, "upload_time": "2014-04-25T09:18:06", "url": "https://files.pythonhosted.org/packages/30/80/62a5387bf784ee8765772f11f1c7293db5189a2d53a9c89046e4f97c11a5/pyramid_assetgen-0.5.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "798a3bd4b9689b1fca888f8dc11fdd8f", "sha256": "57aec101691d8f891ffc97591e453a6b575d4aca9c02cb95a24f8af9f3469c49" }, "downloads": -1, "filename": "pyramid_assetgen-0.5.5.tar.gz", "has_sig": false, "md5_digest": "798a3bd4b9689b1fca888f8dc11fdd8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10058, "upload_time": "2014-04-25T09:18:06", "url": "https://files.pythonhosted.org/packages/30/80/62a5387bf784ee8765772f11f1c7293db5189a2d53a9c89046e4f97c11a5/pyramid_assetgen-0.5.5.tar.gz" } ] }