js.yui
Introduction
This library packages YUI for fanstatic. It is aware of YUI’s structure and different modes (normal, minified, debug).
This requires integration between your web framework and fanstatic, and making sure that the original resources (shipped in the resources directory in js.yui) are published to some URL.
js.yui basic tests
Here are some basic tests for js.yui.
Let’s check the YUI structure by picking out a resource in it:
>>> import js.yui >>> from fanstatic import init_needed >>> needed = init_needed(base_url='http://localhost') >>> needed.need(js.yui.fonts) >>> print needed.render() <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/fonts/fonts.css" />
Let’s try a resource that has a dependency on fonts, namely grids:
>>> needed = init_needed(base_url='http://localhost') >>> needed.need(js.yui.grids) >>> print needed.render() <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/fonts/fonts.css" /> <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/grids/grids.css" />
Let’s need two resources at the same time:
>>> needed = init_needed(base_url='http://localhost') >>> needed.need(js.yui.grids) >>> needed.need(js.yui.reset) >>> print needed.render() <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/fonts/fonts.css" /> <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/reset/reset.css" /> <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/grids/grids.css" />
Let’s get the same, minified:
>>> needed = init_needed(base_url='http://localhost', minified=True) >>> needed.need(js.yui.grids) >>> needed.need(js.yui.reset) >>> print needed.render() <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/fonts/fonts-min.css" /> <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/reset/reset-min.css" /> <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/grids/grids-min.css" />
Now let’s try to see consolidation: we include grids and reset at the same time. Since this time we enable rolling up, we expect to see the rollup reset-fonts-grids:
>>> needed = init_needed( ... base_url='http://localhost', rollup=True) >>> needed.need(js.yui.grids) >>> needed.need(js.yui.reset) >>> print needed.render() <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/reset-fonts-grids/reset-fonts-grids.css" />
Requesting minification has no effect on rollups, as the original rollup is already minified:
>>> needed = init_needed( ... base_url='http://localhost', rollup=True, minified=True) >>> needed.need(js.yui.grids) >>> needed.need(js.yui.reset) >>> print needed.render() <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/yui/reset-fonts-grids/reset-fonts-grids.css" />
CHANGES
2.8.2-1 (2011-04-13)
Update to fanstatic 0.11.1.
No longer list the resources it self as it’s own minified version.
2.8.2 (2011-01-07)
Rewrote hurry.yui to use fanstatic instead of hurry.resource.
Use YUI version 2.8.2.
Metadata
Release files for js.yui 2.8.2-1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| js.yui-2.8.2-1.tar.gz | 2.3 MB | Without provenance | Details for js.yui-2.8.2-1.tar.gz |
Release files / js.yui-2.8.2-1.tar.gz
| Download URL | js.yui-2.8.2-1.tar.gz |
|---|---|
| Size | 2.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bc96628b10bec2d33b8549c155ab02939485d6dffe3b5b4f261adabbe39bf1b
|
|
BLAKE2b-256 checksum How to use checksums |
c466f897c3b1123c082febcf150fba009d75ebe54e2d77816eccc75999beaf80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for js.yui 2.8.2-1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.