ANN: cssutils 0.9.5b1

Christof Hoeke cthedot at gmail.com
Wed Mar 19 23:41:17 CET 2008


what is it
----------
A Python package to parse and build CSS Cascading Style Sheets. (Not a 
renderer though!)

main changes
------------
0.9.5b1
     - **API CHANGE**: 
``cssutils.css.CSSSStyleSheet.replaceUrls(replacer)`` has been 
**DEPRECATED** but is available as an utility function so simply use 
``cssutils.replaceUrls(sheet, replacer)`` instead. For the why see 
``getUrls(sheet)`` below.

     - **API CHANGE/FEATURE**: ``parseString`` has a new parameter 
``encoding`` now which is used if a ``str`` is given for cssText. 
Otherwise it is ignored. (patch by doerwalter)

     - API CHANGE/FEATURE: ``.parse() .parseString()`` and constructor 
of ``CSSStyleSheet`` have a new parameter ``title`` needed for the 
cascade (yet to be implemented ;).

     + **FEATURE**: Referenced stylesheet in an @import rule is read and 
parsed now if possible. Therefor the ``href`` given during parsing 
(parameter ``href`` to the ``parse*`` functions is used. It is also 
properly set on imported rules. The ``name`` property of the @import 
rule is set as the imported sheets ``title`` property.

     + **FEATURE**: Added ``cssutils.getUrls(sheet)`` utility method to 
get all ``url(urlstring)`` values in ``CSSImportRules`` and 
``CSSStyleDeclaration`` objects (properties). As this function and the 
above mentioned ``replaceUrls(sheet, replacer)`` are useful not only for 
a single sheet but (later) also for a stylesheet list they are not 
methods of CSSStyleSheet anymore (also because they are not part of the 
official DOM spec). (patch by doerwalter)

     + FEATURE: Added ``cssutils.parseURL(url, encoding=None, ...)``

     + BUGFIX: Fixes Issue #10, using full ``$LastChangedDate: 
2008-03-19 22:47:34 +0100 (Mi, 19 Mrz 2008) $`` in source files breaks 
code for some locales. Now only in a few files this svn:keywords 
replacement is used and only to a fixed length without the problematic 
part. In all other files ``$Id: ANN.txt 1164 2008-03-19 21:47:34Z 
cthedot $`` is used which also includes simple but sufficient date 
information.

     + **BUGFIX/IMPROVEMENT**: Handling of trailing content, WS and 
comments in rules should be more consistent and properly handled now, 
added tests. Exception is ``CSSCharsetRule`` where no comments are 
allowed at all.

     - TESTS: **Tests need ``minimock`` now!** Install with 
``easy_install minimock``


Note:
     CSSValue, CSSValueList, and CSSPrimitiveValue and the relevant 
methods/properties Property.cssValue and 
CSSStyleDeclaration.getPropertyCSSValue are more or less DEPRECATED and 
will probably be replaced with interfaces defined in CSSOM. For now use 
the properties and methods that handle values as simple strings, e.g. 
``Property.value``. As the aforementioned classes are not hardly that 
useful anyway this should not be a big problem but please beware if you 
use or have used them.

     If you think this a bad idea please let me know!


license
-------
cssutils is published under the LGPL version 2.1 or later, see 
http://cthedot.de/cssutils/

The included `encutils <http://cthedot.de/encutils/>`__ has been updated 
to version 0.8.2 with a compatible LGPL license. `restserver.py 
<http://cthedot.de/restserver/>`__ has been updates to version 2.1 which 
is in the public domain now (no Creative Commons license anymore). So 
only a single license (the LGPL) is used throughout cssutils now. If you 
have other licensing needs please let me know.

download
--------
For download options see http://cthedot.de/cssutils/

cssutils needs Python 2.4 or higher (tested with Python 2.5.2 on Vista only)


Bug reports (via Google code), comments, etc are very much appreciated! 
Thanks.

Christof


More information about the Python-announce-list mailing list