Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install js.yui

How to install js.yui

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install js.yui
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2.8.2-1 Available View build log
2.8.2 Available View build log
Windows (64-bit)
2.8.2-1 Available View build log
2.8.2 Available View build log
Mac OS X (10.5+)
2.8.2-1 Available View build log
2.8.2 Available View build log
Linux (32-bit)
2.8.2-1 Available View build log
2.8.2 Available View build log
Linux (64-bit)
2.8.2-1 Available View build log
2.8.2 Available View build log
 
License
BSD
Imports
Lastest release
version 2.8.2-1 on Apr 14th, 2011

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)

Subscribe to package updates

Last updated Apr 14th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.