%
% API Documentation for cssutils
% Package cssutils
%
% Generated by epydoc 3.0.1
% [Fri Feb 01 19:05:21 2008]
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                          Module Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{cssutils \textit{(package)}|(}
\section{Package cssutils}

    \label{cssutils}

cssutils - CSS Cascading Style Sheets library for Python
\begin{quote}

Copyright (C) 2004-2008 Christof Hoeke

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\end{quote}

A Python package to parse and build CSS Cascading Style Sheets.

Based upon and partly implements the following specifications (DOM only, not any rendering facilities):
\begin{description}
\item[{\href{http://www.w3.org/TR/DOM-Level-2-Style/css.html}{DOM Level 2 Style CSS}}] \leavevmode 
DOM for package css

\item[{\href{http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html}{DOM Level 2 Style Stylesheets}}] \leavevmode 
DOM for package stylesheets

\item[{\href{http://dev.w3.org/csswg/cssom/}{CSSOM}}] \leavevmode 
A few details (mainly the NamespaceRule DOM) is taken from here. Plan is to move implementation to the stuff defined here which is newer but still no REC so might change in the future

\item[{\href{http://www.w3.org/TR/CSS21/}{CSS 2.1}}] \leavevmode 
Rules and properties are defined here

\item[{\href{http://www.w3.org/Style/css2-updates/CR-CSS21-20070719-errata.html}{CSS 2.1 Errata}}] \leavevmode 
A few erratas, mainly the definition of CHARSET{\_}SYM tokens

\item[{\href{http://www.w3.org/TR/css3-mediaqueries/}{MediaQueries}}] \leavevmode 
MediaQueries are part of \texttt{stylesheets.MediaList} since v0.9.4, used in @import and @media rules.

\item[{\href{http://www.w3.org/TR/css3-namespace/}{Namespaces}}] \leavevmode 
Added in v0.9.1 and updated to definition in CSSOM in v0.9.4

\item[{\href{http://www.w3.org/TR/css3-selectors/}{Selectors}}] \leavevmode 
The selector syntax defined here (and not in CSS 2.1) should be parsable with cssutils (\emph{should} mind though ;) )

\end{description}

Please visit \href{http://cthedot.de/cssutils/}{http://cthedot.de/cssutils/} for full details and updates.

Tested with Python 2.5 on Windows XP.

This library is optimized for usage of \texttt{from cssutils import *} which
import subpackages \texttt{css} and \texttt{stylesheets}, CSSParser and
CSSSerializer classes only.

Usage may be:
\begin{quote}{\ttfamily \raggedright \noindent
>{}>{}>~from~cssutils~import~*~\\
>{}>{}>~parser~=~CSSParser()~\\
>{}>{}>~sheet~=~parser.parseString(u'a~{\{}~color:~red{\}}')~\\
>{}>{}>~print~sheet.cssText
}\end{quote}
\textbf{Version:} 0.9.5a2 \$LastChangedRevision: 901 \$



\textbf{Date:} \$LastChangedDate: 2008-01-20 18:46:51 +0100 (So, 20 Jan 2008) \$



\textbf{Author:} \$LastChangedBy: cthedot \$




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Modules                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{Modules}

\begin{itemize}
\setlength{\parskip}{0ex}
\item \textbf{codec}: 
Python codec for CSS.


  \textit{(Section \ref{cssutils:codec}, p.~\pageref{cssutils:codec})}

\item \textbf{css}: 
Document Object Model Level 2 CSS
\href{http://www.w3.org/TR/2000/PR-DOM-Level-2-Style-20000927/css.html}{http://www.w3.org/TR/2000/PR-DOM-Level-2-Style-20000927/css.html}


  \textit{(Section \ref{cssutils:css}, p.~\pageref{cssutils:css})}

  \begin{itemize}
\setlength{\parskip}{0ex}
    \item \textbf{csscharsetrule}: 
CSSCharsetRule implements DOM Level 2 CSS CSSCharsetRule.


  \textit{(Section \ref{cssutils:css:csscharsetrule}, p.~\pageref{cssutils:css:csscharsetrule})}

    \item \textbf{csscomment}: 
CSSComment is not defined in DOM Level 2 at all but a cssutils defined
class only.


  \textit{(Section \ref{cssutils:css:csscomment}, p.~\pageref{cssutils:css:csscomment})}

    \item \textbf{cssfontfacerule}: 
CSSFontFaceRule implements DOM Level 2 CSS CSSFontFaceRule.


  \textit{(Section \ref{cssutils:css:cssfontfacerule}, p.~\pageref{cssutils:css:cssfontfacerule})}

    \item \textbf{cssimportrule}: 
CSSImportRule implements DOM Level 2 CSS CSSImportRule.


  \textit{(Section \ref{cssutils:css:cssimportrule}, p.~\pageref{cssutils:css:cssimportrule})}

    \item \textbf{cssmediarule}: 
CSSMediaRule implements DOM Level 2 CSS CSSMediaRule.


  \textit{(Section \ref{cssutils:css:cssmediarule}, p.~\pageref{cssutils:css:cssmediarule})}

    \item \textbf{cssnamespacerule}: 
CSSNamespaceRule currently implements
\href{http://www.w3.org/TR/2006/WD-css3-namespace-20060828/}{http://www.w3.org/TR/2006/WD-css3-namespace-20060828/}


  \textit{(Section \ref{cssutils:css:cssnamespacerule}, p.~\pageref{cssutils:css:cssnamespacerule})}

    \item \textbf{csspagerule}: 
CSSPageRule implements DOM Level 2 CSS CSSPageRule.


  \textit{(Section \ref{cssutils:css:csspagerule}, p.~\pageref{cssutils:css:csspagerule})}

    \item \textbf{cssproperties}: 
CSS2Properties (partly!) implements DOM Level 2 CSS CSS2Properties used
by CSSStyleDeclaration


  \textit{(Section \ref{cssutils:css:cssproperties}, p.~\pageref{cssutils:css:cssproperties})}

    \item \textbf{cssrule}: 
CSSRule implements DOM Level 2 CSS CSSRule.


  \textit{(Section \ref{cssutils:css:cssrule}, p.~\pageref{cssutils:css:cssrule})}

    \item \textbf{cssrulelist}: 
CSSRuleList implements DOM Level 2 CSS CSSRuleList.


  \textit{(Section \ref{cssutils:css:cssrulelist}, p.~\pageref{cssutils:css:cssrulelist})}

    \item \textbf{cssstyledeclaration}: 
CSSStyleDeclaration implements DOM Level 2 CSS CSSStyleDeclaration and
extends CSS2Properties


  \textit{(Section \ref{cssutils:css:cssstyledeclaration}, p.~\pageref{cssutils:css:cssstyledeclaration})}

    \item \textbf{cssstylerule}: 
CSSStyleRule implements DOM Level 2 CSS CSSStyleRule.


  \textit{(Section \ref{cssutils:css:cssstylerule}, p.~\pageref{cssutils:css:cssstylerule})}

    \item \textbf{cssstylesheet}: 
CSSStyleSheet implements DOM Level 2 CSS CSSStyleSheet.


  \textit{(Section \ref{cssutils:css:cssstylesheet}, p.~\pageref{cssutils:css:cssstylesheet})}

    \item \textbf{cssunknownrule}: 
CSSUnknownRule implements DOM Level 2 CSS CSSUnknownRule.


  \textit{(Section \ref{cssutils:css:cssunknownrule}, p.~\pageref{cssutils:css:cssunknownrule})}

    \item \textbf{cssvalue}: 
CSSValue related classes


  \textit{(Section \ref{cssutils:css:cssvalue}, p.~\pageref{cssutils:css:cssvalue})}

    \item \textbf{property}: 
Property is a single CSS property in a CSSStyleDeclaration


  \textit{(Section \ref{cssutils:css:property}, p.~\pageref{cssutils:css:property})}

    \item \textbf{selector}: 
Selector is a single Selector of a CSSStyleRule SelectorList.


  \textit{(Section \ref{cssutils:css:selector}, p.~\pageref{cssutils:css:selector})}

    \item \textbf{selectorlist}: 
SelectorList is a list of CSS Selector objects.


  \textit{(Section \ref{cssutils:css:selectorlist}, p.~\pageref{cssutils:css:selectorlist})}

  \end{itemize}
\item \textbf{css2productions}: 
productions for CSS 2.1


  \textit{(Section \ref{cssutils:css2productions}, p.~\pageref{cssutils:css2productions})}

\item \textbf{css3productions}: 
productions for CSS 3


  \textit{(Section \ref{cssutils:css3productions}, p.~\pageref{cssutils:css3productions})}

\item \textbf{cssproductions}: 
productions for cssutils based on a mix of CSS 2.1 and CSS 3 Syntax
productions


  \textit{(Section \ref{cssutils:cssproductions}, p.~\pageref{cssutils:cssproductions})}

\item \textbf{errorhandler}: 
cssutils ErrorHandler


  \textit{(Section \ref{cssutils:errorhandler}, p.~\pageref{cssutils:errorhandler})}

\item \textbf{parse'}: 
a validating CSSParser


  \textit{(Section \ref{cssutils:parse'}, p.~\pageref{cssutils:parse'})}

\item \textbf{scripts}
  \textit{(Section \ref{cssutils:scripts}, p.~\pageref{cssutils:scripts})}

  \begin{itemize}
\setlength{\parskip}{0ex}
    \item \textbf{csscapture}: 
Retrieve all CSS stylesheets including embedded for a given URL.


  \textit{(Section \ref{cssutils:scripts:csscapture}, p.~\pageref{cssutils:scripts:csscapture})}

    \item \textbf{csscombine}
  \textit{(Section \ref{cssutils:scripts:csscombine}, p.~\pageref{cssutils:scripts:csscombine})}

    \item \textbf{csscombine'}: combines sheets referred to by @import rules in a given CSS proxy sheet
into a single new sheet. 


  \textit{(Section \ref{cssutils:scripts:csscombine'}, p.~\pageref{cssutils:scripts:csscombine'})}

    \item \textbf{cssparse}: 
utility scripts installed as Python scripts


  \textit{(Section \ref{cssutils:scripts:cssparse}, p.~\pageref{cssutils:scripts:cssparse})}

  \end{itemize}
\item \textbf{serialize}: 
serializer classes for CSS classes


  \textit{(Section \ref{cssutils:serialize}, p.~\pageref{cssutils:serialize})}

\item \textbf{stylesheets}: 
Document Object Model Level 2 Style Sheets
\href{http://www.w3.org/TR/2000/PR-DOM-Level-2-Style-20000927/stylesheets.html}{http://www.w3.org/TR/2000/PR-DOM-Level-2-Style-20000927/stylesheets.html}


  \textit{(Section \ref{cssutils:stylesheets}, p.~\pageref{cssutils:stylesheets})}

  \begin{itemize}
\setlength{\parskip}{0ex}
    \item \textbf{medialist}: 
MediaList implements DOM Level 2 Style Sheets MediaList.


  \textit{(Section \ref{cssutils:stylesheets:medialist}, p.~\pageref{cssutils:stylesheets:medialist})}

    \item \textbf{mediaquery}: 
MediaQuery, see \href{http://www.w3.org/TR/css3-mediaqueries/}{http://www.w3.org/TR/css3-mediaqueries/}


  \textit{(Section \ref{cssutils:stylesheets:mediaquery}, p.~\pageref{cssutils:stylesheets:mediaquery})}

    \item \textbf{stylesheet}: 
StyleSheet implements DOM Level 2 Style Sheets StyleSheet.


  \textit{(Section \ref{cssutils:stylesheets:stylesheet}, p.~\pageref{cssutils:stylesheets:stylesheet})}

    \item \textbf{stylesheetlist}: 
StyleSheetList implements DOM Level 2 Style Sheets StyleSheetList.


  \textit{(Section \ref{cssutils:stylesheets:stylesheetlist}, p.~\pageref{cssutils:stylesheets:stylesheetlist})}

  \end{itemize}
\item \textbf{tests}: cssutils unittests



  \textit{(Section \ref{cssutils:tests}, p.~\pageref{cssutils:tests})}

  \begin{itemize}
\setlength{\parskip}{0ex}
    \item \textbf{basetest}: base class for all tests



  \textit{(Section \ref{cssutils:tests:basetest}, p.~\pageref{cssutils:tests:basetest})}

    \item \textbf{encutils}: tests for encutils.py



  \textit{(Section \ref{cssutils:tests:encutils}, p.~\pageref{cssutils:tests:encutils})}

    \item \textbf{test\_codec}: testcases for cssutils.codec



  \textit{(Section \ref{cssutils:tests:test_codec}, p.~\pageref{cssutils:tests:test_codec})}

    \item \textbf{test\_csscharsetrule}: testcases for cssutils.css.CSSCharsetRule



  \textit{(Section \ref{cssutils:tests:test_csscharsetrule}, p.~\pageref{cssutils:tests:test_csscharsetrule})}

    \item \textbf{test\_csscomment}: testcases for cssutils.css.CSSComment



  \textit{(Section \ref{cssutils:tests:test_csscomment}, p.~\pageref{cssutils:tests:test_csscomment})}

    \item \textbf{test\_cssfontfacerule}: testcases for cssutils.css.CSSFontFaceRule



  \textit{(Section \ref{cssutils:tests:test_cssfontfacerule}, p.~\pageref{cssutils:tests:test_cssfontfacerule})}

    \item \textbf{test\_cssimportrule}: testcases for cssutils.css.CSSImportRule



  \textit{(Section \ref{cssutils:tests:test_cssimportrule}, p.~\pageref{cssutils:tests:test_cssimportrule})}

    \item \textbf{test\_cssmediarule}: testcases for cssutils.css.CSSMediaRule



  \textit{(Section \ref{cssutils:tests:test_cssmediarule}, p.~\pageref{cssutils:tests:test_cssmediarule})}

    \item \textbf{test\_cssnamespacerule}: testcases for cssutils.css.CSSImportRule



  \textit{(Section \ref{cssutils:tests:test_cssnamespacerule}, p.~\pageref{cssutils:tests:test_cssnamespacerule})}

    \item \textbf{test\_csspagerule}: testcases for cssutils.css.CSSPageRule



  \textit{(Section \ref{cssutils:tests:test_csspagerule}, p.~\pageref{cssutils:tests:test_csspagerule})}

    \item \textbf{test\_cssproperties}: Testcases for cssutils.css.cssproperties.



  \textit{(Section \ref{cssutils:tests:test_cssproperties}, p.~\pageref{cssutils:tests:test_cssproperties})}

    \item \textbf{test\_cssrule}: testcases for cssutils.css.CSSRule



  \textit{(Section \ref{cssutils:tests:test_cssrule}, p.~\pageref{cssutils:tests:test_cssrule})}

    \item \textbf{test\_cssrulelist}: testcases for cssutils.css.CSSRuleList



  \textit{(Section \ref{cssutils:tests:test_cssrulelist}, p.~\pageref{cssutils:tests:test_cssrulelist})}

    \item \textbf{test\_cssstyledeclaration}: Testcases for cssutils.css.cssstyledelaration.CSSStyleDeclaration.



  \textit{(Section \ref{cssutils:tests:test_cssstyledeclaration}, p.~\pageref{cssutils:tests:test_cssstyledeclaration})}

    \item \textbf{test\_cssstylerule}: testcases for cssutils.css.CSSStyleRuleTestCase



  \textit{(Section \ref{cssutils:tests:test_cssstylerule}, p.~\pageref{cssutils:tests:test_cssstylerule})}

    \item \textbf{test\_cssstylesheet}: tests for css.CSSStyleSheet



  \textit{(Section \ref{cssutils:tests:test_cssstylesheet}, p.~\pageref{cssutils:tests:test_cssstylesheet})}

    \item \textbf{test\_cssunknownrule}: testcases for cssutils.css.CSSUnkownRule



  \textit{(Section \ref{cssutils:tests:test_cssunknownrule}, p.~\pageref{cssutils:tests:test_cssunknownrule})}

    \item \textbf{test\_cssutils}: testcases for cssutils.css.CSSCharsetRule



  \textit{(Section \ref{cssutils:tests:test_cssutils}, p.~\pageref{cssutils:tests:test_cssutils})}

    \item \textbf{test\_cssutilsimport}: testcase for cssutils imports



  \textit{(Section \ref{cssutils:tests:test_cssutilsimport}, p.~\pageref{cssutils:tests:test_cssutilsimport})}

    \item \textbf{test\_cssvalue}: Testcases for cssutils.css.CSSValue and CSSPrimitiveValue.



  \textit{(Section \ref{cssutils:tests:test_cssvalue}, p.~\pageref{cssutils:tests:test_cssvalue})}

    \item \textbf{test\_domimplementation}: testcases for cssutils.css.DOMImplementation



  \textit{(Section \ref{cssutils:tests:test_domimplementation}, p.~\pageref{cssutils:tests:test_domimplementation})}

    \item \textbf{test\_medialist}: testcases for cssutils.stylesheets.MediaList



  \textit{(Section \ref{cssutils:tests:test_medialist}, p.~\pageref{cssutils:tests:test_medialist})}

    \item \textbf{test\_mediaquery}: testcases for cssutils.stylesheets.MediaList



  \textit{(Section \ref{cssutils:tests:test_mediaquery}, p.~\pageref{cssutils:tests:test_mediaquery})}

    \item \textbf{test\_parse}: tests for parsing which does not raise Exceptions normally



  \textit{(Section \ref{cssutils:tests:test_parse}, p.~\pageref{cssutils:tests:test_parse})}

    \item \textbf{test\_property}: Testcases for cssutils.css.property.\_Property.



  \textit{(Section \ref{cssutils:tests:test_property}, p.~\pageref{cssutils:tests:test_property})}

    \item \textbf{test\_scripts\_csscombine}: testcases for cssutils.scripts.csscombine



  \textit{(Section \ref{cssutils:tests:test_scripts_csscombine}, p.~\pageref{cssutils:tests:test_scripts_csscombine})}

    \item \textbf{test\_selector}: Testcases for cssutils.css.selector.Selector.



  \textit{(Section \ref{cssutils:tests:test_selector}, p.~\pageref{cssutils:tests:test_selector})}

    \item \textbf{test\_selectorlist}: Testcases for cssutils.css.selectorlist.SelectorList.



  \textit{(Section \ref{cssutils:tests:test_selectorlist}, p.~\pageref{cssutils:tests:test_selectorlist})}

    \item \textbf{test\_serialize}: testcases for cssutils.CSSSerializer



  \textit{(Section \ref{cssutils:tests:test_serialize}, p.~\pageref{cssutils:tests:test_serialize})}

    \item \textbf{test\_tokenize2}: testcases for new cssutils.tokenize.Tokenizer



  \textit{(Section \ref{cssutils:tests:test_tokenize2}, p.~\pageref{cssutils:tests:test_tokenize2})}

    \item \textbf{test\_util}: testcases for cssutils.util



  \textit{(Section \ref{cssutils:tests:test_util}, p.~\pageref{cssutils:tests:test_util})}

  \end{itemize}
\item \textbf{tokenize2}: 
New CSS Tokenizer (a generator)


  \textit{(Section \ref{cssutils:tokenize2}, p.~\pageref{cssutils:tokenize2})}

\item \textbf{util}: 
base classes for css and stylesheets packages


  \textit{(Section \ref{cssutils:util}, p.~\pageref{cssutils:util})}

\end{itemize}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           Class Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{cssutils \textit{(package)}!cssutils.parse' \textit{(module)}!cssutils.parse'.CSSParser \textit{(class)}|(}
\subsection{Class CSSParser}

    \label{cssutils:parse':CSSParser}
\begin{tabular}{cccccc}
% Line for object, linespec=[False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
  \\
&&\multicolumn{2}{l}{\textbf{cssutils.parse'.CSSParser}}
\end{tabular}


parses a CSS StyleSheet string or file and
returns a DOM Level 2 CSS StyleSheet object

Usage:
\begin{quote}{\ttfamily \raggedright \noindent
parser~=~CSSParser()~\\
stylesheet~=~p.parse('test1.css',~'ascii')~\\
~\\
print~stylesheet.cssText
}\end{quote}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Methods                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Methods}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{log}={\tt None}, \textit{loglevel}={\tt None}, \textit{raiseExceptions}={\tt False})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}
\begin{description}
\item[{log}] \leavevmode 
logging object

\item[{loglevel}] \leavevmode 
logging loglevel

\item[{raiseExceptions}] \leavevmode 
if log should simple log (default) or raise errors

\end{description}
\setlength{\parskip}{1ex}
      Overrides: object.\_\_init\_\_

    \end{boxedminipage}

    \label{cssutils:parse':CSSParser:parseString}
    \index{cssutils \textit{(package)}!cssutils.parse' \textit{(module)}!cssutils.parse'.CSSParser \textit{(class)}!cssutils.parse'.CSSParser.parseString \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{parseString}(\textit{self}, \textit{cssText}, \textit{href}={\tt None}, \textit{media}={\tt None})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

parse a CSSStyleSheet string
returns the parsed CSS as a CSSStyleSheet object
\begin{description}
\item[{cssText}] \leavevmode 
CSS string to parse

\item[{href}] \leavevmode 
The href attribute to assign to the generated stylesheet

\item[{media}] \leavevmode 
The media attribute to assign to the generated stylesheet
(may be a MediaList, list or a string)

\end{description}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:parse':CSSParser:parse}
    \index{cssutils \textit{(package)}!cssutils.parse' \textit{(module)}!cssutils.parse'.CSSParser \textit{(class)}!cssutils.parse'.CSSParser.parse \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{parse}(\textit{self}, \textit{filename}, \textit{encoding}={\tt None}, \textit{href}={\tt None}, \textit{media}={\tt None})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

parse a CSSStyleSheet file
returns the parsed CSS as a CSSStyleSheet object
\begin{description}
\item[{filename}] \leavevmode 
name of the CSS file to parse

\item[{encoding}] \leavevmode 
of the CSS file, defaults to 'css' codec encoding

\item[{href}] \leavevmode 
The href attribute to assign to the generated stylesheet

\item[{media}] \leavevmode 
The media attribute to assign to the generated stylesheet
(may be a MediaList or a string)

\end{description}
\setlength{\parskip}{1ex}
    \end{boxedminipage}


\large{\textbf{\textit{Inherited from object}}}

\begin{quote}
\_\_delattr\_\_(), \_\_getattribute\_\_(), \_\_hash\_\_(), \_\_new\_\_(), \_\_reduce\_\_(), \_\_reduce\_ex\_\_(), \_\_repr\_\_(), \_\_setattr\_\_(), \_\_str\_\_()
\end{quote}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                              Properties                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Properties}

    \vspace{-1cm}
\hspace{\varindent}\begin{longtable}{|p{\varnamewidth}|p{\vardescrwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\multicolumn{2}{|l|}{\textit{Inherited from object}}\\
\multicolumn{2}{|p{\varwidth}|}{\raggedright \_\_class\_\_}\\
\cline{1-2}
\end{longtable}

    \index{cssutils \textit{(package)}!cssutils.parse' \textit{(module)}!cssutils.parse'.CSSParser \textit{(class)}|)}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           Class Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}|(}
\subsection{Class CSSSerializer}

    \label{cssutils:serialize:CSSSerializer}
\begin{tabular}{cccccc}
% Line for object, linespec=[False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
  \\
&&\multicolumn{2}{l}{\textbf{cssutils.serialize.CSSSerializer}}
\end{tabular}


Methods to serialize a CSSStylesheet and its parts

To use your own serializing method the easiest is to subclass CSS
Serializer and overwrite the methods you like to customize.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Methods                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Methods}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{prefs}={\tt None})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}
\begin{description}
\item[{prefs}] \leavevmode 
instance of Preferences

\end{description}
\setlength{\parskip}{1ex}
      Overrides: object.\_\_init\_\_

    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_stylesheets_mediaquery}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_stylesheets\_mediaquery \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_stylesheets\_mediaquery}(\textit{self}, \textit{mediaquery})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

a single media used in medialist
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_stylesheets_medialist}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_stylesheets\_medialist \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_stylesheets\_medialist}(\textit{self}, \textit{medialist})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

comma-separated list of media, default is 'all'

If ``all'' is in the list, every other media \emph{except} ``handheld'' will
be stripped. This is because how Opera handles CSS for PDAs.
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSStyleSheet}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSStyleSheet \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSStyleSheet}(\textit{self}, \textit{stylesheet})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes a complete CSSStyleSheet
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSComment}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSComment \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSComment}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSComment which consists only of commentText
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSCharsetRule}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSCharsetRule \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSCharsetRule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSCharsetRule
encoding: string

always @charset ``encoding'';
no comments or other things allowed!
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSFontFaceRule}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSFontFaceRule \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSFontFaceRule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSFontFaceRule
\begin{description}
\item[{style}] \leavevmode 
CSSStyleDeclaration

\end{description}
\begin{itemize}
\item {} 
CSSComments

\end{itemize}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSImportRule}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSImportRule \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSImportRule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSImportRule
\begin{description}
\item[{href}] \leavevmode 
string

\item[{hreftype}] \leavevmode 
'uri' or 'string'

\item[{media}] \leavevmode 
cssutils.stylesheets.medialist.MediaList

\end{description}
\begin{itemize}
\item {} 
CSSComments

\end{itemize}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSNamespaceRule}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSNamespaceRule \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSNamespaceRule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSNamespaceRule
\begin{description}
\item[{uri}] \leavevmode 
string

\item[{prefix}] \leavevmode 
string

\end{description}
\begin{itemize}
\item {} 
CSSComments

\end{itemize}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSMediaRule}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSMediaRule \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSMediaRule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSMediaRule
\begin{itemize}
\item {} 
CSSComments

\end{itemize}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSPageRule}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSPageRule \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSPageRule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSPageRule
\begin{description}
\item[{selectorText}] \leavevmode 
string

\item[{style}] \leavevmode 
CSSStyleDeclaration

\end{description}
\begin{itemize}
\item {} 
CSSComments

\end{itemize}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_pageselector}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_pageselector \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_pageselector}(\textit{self}, \textit{seq})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

a selector of a CSSPageRule including comments
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSUnknownRule}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSUnknownRule \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSUnknownRule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSUnknownRule
anything until ``;'' or ``{\{}...{\}}''
+ CSSComments
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_CSSStyleRule}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_CSSStyleRule \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_CSSStyleRule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes CSSStyleRule

selectorList
style
\begin{itemize}
\item {} 
CSSComments

\end{itemize}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_css_SelectorList}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_css\_SelectorList \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_css\_SelectorList}(\textit{self}, \textit{selectorlist})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

comma-separated list of Selectors
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_css_Selector}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_css\_Selector \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_css\_Selector}(\textit{self}, \textit{selector})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

a single Selector including comments

an element has syntax (namespaceURI, name) where namespaceURI may be:
\begin{itemize}
\item {} 
cssutils.{\_}ANYNS ={\textgreater} \texttt{*|name}

\item {} 
None ={\textgreater} \texttt{name}

\item {} 
u'' ={\textgreater} \texttt{|name}

\item {} 
any other value: ={\textgreater} \texttt{prefix|name}

\end{itemize}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_css_CSSStyleDeclaration}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_css\_CSSStyleDeclaration \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_css\_CSSStyleDeclaration}(\textit{self}, \textit{style}, \textit{separator}={\tt None})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

Style declaration of CSSStyleRule
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_Property}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_Property \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_Property}(\textit{self}, \textit{property})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

Style declaration of CSSStyleRule

Property has a seqs attribute which contains seq lists for
name, a CSSvalue and a seq list for priority
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_Property_priority}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_Property\_priority \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_Property\_priority}(\textit{self}, \textit{priorityseq})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

a Properties priority ``!'' S* ``important''
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:serialize:CSSSerializer:do_css_CSSValue}
    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}!cssutils.serialize.CSSSerializer.do\_css\_CSSValue \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{do\_css\_CSSValue}(\textit{self}, \textit{cssvalue})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}

serializes a CSSValue
\setlength{\parskip}{1ex}
    \end{boxedminipage}


\large{\textbf{\textit{Inherited from object}}}

\begin{quote}
\_\_delattr\_\_(), \_\_getattribute\_\_(), \_\_hash\_\_(), \_\_new\_\_(), \_\_reduce\_\_(), \_\_reduce\_ex\_\_(), \_\_repr\_\_(), \_\_setattr\_\_(), \_\_str\_\_()
\end{quote}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                              Properties                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Properties}

    \vspace{-1cm}
\hspace{\varindent}\begin{longtable}{|p{\varnamewidth}|p{\vardescrwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\multicolumn{2}{|l|}{\textit{Inherited from object}}\\
\multicolumn{2}{|p{\varwidth}|}{\raggedright \_\_class\_\_}\\
\cline{1-2}
\end{longtable}

    \index{cssutils \textit{(package)}!cssutils.serialize \textit{(module)}!cssutils.serialize.CSSSerializer \textit{(class)}|)}
    \index{cssutils \textit{(package)}|)}
