ANN: cssutils 0.9.5final
cthedot at gmail.com
Wed Jul 30 14:10:50 CEST 2008
what is it
A Python package to parse and build CSS Cascading Style Sheets. (Not a
0.9.5 had been in development for about half a year and this is the
first *final* release for quite some time now - actually the last has
been 0.6 ... It is nevertheless definitely not perfect but tests have
been expanded, included scripts should all work and all examples on the
website have been checked. 0.9.6 will start soon ...
- **API CHANGE**: If a new medium is trying to be appended to a
``MediaList`` already set to ``all`` an
``xml.dom.InvalidModificationErr`` is raised. The exception to this
handling is adding ``handheld`` which is a special case for Opera and
kept for now. This special handling may be removed in the future. A
``WARNING`` is logged in any case.
- **BUGFIX**: Fixed reference error in @import rule preventing
change of the used ``MediaList``.
- **BUGFIX**: Deeply nested ``CSSImportRule``\ s with different
encodings should keep the encoding as defined (via HTTP, parendSheet,
@charset etc) now. Therefor ``cssutils.util._readUrl`` does return
``(encoding, enctype, decodedCssText)`` now where ``enctype`` is a
number from 0 to 5 indicating which encoding type was used: 0 for
encoding override, 1 for HTTP encoding, 2 for BOM or @charset rule, (3
is unused currently), 4 for encoding of the parent sheet and 5 if
encoding defaults to UTF-8 as no other information is available. (This
may later be done as constants but this function should not be used from
- **BUGFIX**: Replaced usage of ``WindowsError`` with ``OSError``.
I (naively ;) thought ``WindowsError`` at least be present in
environments other than Windows but it just results in a
``NameError``... The part of the API which triggered this Exception is
an @import rule with an invalid or local (file) URI so should have
happened quite rarely anyway.
+ IMPROVEMENT: Standalone scripts ``csscombine`` and ``csscapture``
are available for programmatic use in ``cssutils.script.csscombine`` and
+ IMPROVEMENT: ``cssutils.script.csscombine`` and ``csscombine``
script do use the cssutils log now instead of just writing messages to
+ IMPROVEMENT: Optimized and refactored tokenizer (CHARSET_SYM).
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!
cssutils is published under the LGPL version 3 or later, see
If you have other licensing needs please let me know.
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!
More information about the Python-announce-list