| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
CSSParser
parses a CSS StyleSheet string or file and returns a DOM Level 2 CSS StyleSheet object
Usage:
parser = CSSParser()
# optionally
parser.setFetcher(fetcher)
sheet = parser.parseFile('test1.css', 'ascii')
print sheet.cssText
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
Return parsed CSSStyleSheet from given string cssText. Raises errors during retrieving (e.g. UnicodeDecodeError).
|
Retrieve and return a CSSStyleSheet from given filename. Raises errors during retrieving (e.g. IOError).
for other parameters see parseString |
Retrieve and return a CSSStyleSheet from given href (an URL). In case of any errors while reading the URL returns None.
for other parameters see parseString |
Replace the default URL fetch function with a custom one. The fetcher function gets a single parameter
and returns (encoding, content) where encoding is the HTTP charset normally given via the Content-Type header (which may simply omit the charset) and content being the (byte) string content. The Mimetype should be 'text/css' but this has to be checked by the fetcher itself (the default fetcher emits a warning if encountering a different mimetype). Calling setFetcher with fetcher=None resets cssutils to use its default function. |
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Wed Jul 09 15:30:06 2008 | http://epydoc.sourceforge.net |