%
% API Documentation for cssutils
% Module cssutils.css.cssstylesheet
%
% Generated by epydoc 3.0.1
% [Fri Feb 01 19:05:21 2008]
%

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

    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}|(}
\section{Module cssutils.css.cssstylesheet}

    \label{cssutils:css:cssstylesheet}

CSSStyleSheet implements DOM Level 2 CSS CSSStyleSheet.
\begin{description}
\item[{Partly also:}] \leavevmode \begin{itemize}
\item {} 
\href{http://dev.w3.org/csswg/cssom/\#the-cssstylesheet}{http://dev.w3.org/csswg/cssom/{\#}the-cssstylesheet}

\item {} 
\href{http://www.w3.org/TR/2006/WD-css3-namespace-20060828/}{http://www.w3.org/TR/2006/WD-css3-namespace-20060828/}

\end{itemize}

\item[{TODO:}] \leavevmode \begin{itemize}
\item {} 
ownerRule and ownerNode

\end{itemize}

\end{description}
\textbf{Version:} \$LastChangedRevision: 955 \$



\textbf{Date:} \$LastChangedDate: 2008-01-27 17:57:38 +0100 (So, 27 Jan 2008) \$



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




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

    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}|(}
\subsection{Class CSSStyleSheet}

    \label{cssutils:css:cssstylesheet:CSSStyleSheet}
\begin{tabular}{cccccccccc}
% Line for object, linespec=[False, False, False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
&&
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
&&
&&
  \\
% Line for cssutils.util.Base, linespec=[False, False]
\multicolumn{4}{r}{\settowidth{\BCL}{cssutils.util.Base}\multirow{2}{\BCL}{cssutils.util.Base}}
&&
&&
  \\\cline{5-5}
  &&&&\multicolumn{1}{c|}{}
&&
&&
  \\
% Line for cssutils.stylesheets.stylesheet.StyleSheet, linespec=[False]
\multicolumn{6}{r}{\settowidth{\BCL}{cssutils.stylesheets.stylesheet.StyleSheet}\multirow{2}{\BCL}{cssutils.stylesheets.stylesheet.StyleSheet}}
&&
  \\\cline{7-7}
  &&&&&&\multicolumn{1}{c|}{}
&&
  \\
&&&&&&\multicolumn{2}{l}{\textbf{cssutils.css.cssstylesheet.CSSStyleSheet}}
\end{tabular}


The CSSStyleSheet interface represents a CSS style sheet.


%___________________________________________________________________________

\hypertarget{properties}{}
\pdfbookmark[3]{Properties}{properties}
\paragraph*{Properties}
\label{properties}


%___________________________________________________________________________

\hypertarget{cssom}{}
\pdfbookmark[4]{CSSOM}{cssom}
\subparagraph*{CSSOM}
\label{cssom}
\begin{description}
\item[{cssRules}] \leavevmode 
of type CSSRuleList, (DOM readonly)

\item[{encoding}] \leavevmode 
reflects the encoding of an @charset rule or 'utf-8' (default)
if set to \texttt{None}

\item[{ownerRule}] \leavevmode 
of type CSSRule, readonly (NOT IMPLEMENTED YET)

\end{description}

Inherits properties from stylesheet.StyleSheet


%___________________________________________________________________________

\hypertarget{cssutils}{}
\pdfbookmark[4]{cssutils}{cssutils}
\subparagraph*{cssutils}
\label{cssutils}
\begin{description}
\item[{cssText: string}] \leavevmode 
a textual representation of the stylesheet

\item[{namespaces}] \leavevmode 
reflects set @namespace rules of this rule.
A dict of {\{}prefix: namespaceURI{\}} mapping.

\end{description}


%___________________________________________________________________________

\hypertarget{format}{}
\pdfbookmark[3]{Format}{format}
\paragraph*{Format}
\label{format}
\begin{description}
\item[{stylesheet}] \leavevmode \begin{description}
\item[{: {[} CHARSET{\_}SYM S* STRING S* ';' {]}?}] \leavevmode 
{[}S{\textbar}CDO{\textbar}CDC{]}* {[} import {[}S{\textbar}CDO{\textbar}CDC{]}* {]}*
{[} namespace {[}S{\textbar}CDO{\textbar}CDC{]}* {]}* {\#} according to @namespace WD
{[} {[} ruleset {\textbar} media {\textbar} page {]} {[}S{\textbar}CDO{\textbar}CDC{]}* {]}*

\end{description}

\end{description}

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

  \subsubsection{Methods}

    \vspace{0.5ex}

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

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{href}={\tt None}, \textit{media}={\tt None}, \textit{title}={\tt \texttt{u'}\texttt{}\texttt{'}}, \textit{disabled}={\tt None}, \textit{ownerNode}={\tt None}, \textit{parentStyleSheet}={\tt None}, \textit{readonly}={\tt False})

    \vspace{-1.5ex}

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

init parameters are the same as for stylesheets.StyleSheet
\setlength{\parskip}{1ex}
      Overrides: object.\_\_init\_\_

    \end{boxedminipage}

    \label{cssutils:css:cssstylesheet:CSSStyleSheet:__iter__}
    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}!cssutils.css.cssstylesheet.CSSStyleSheet.\_\_iter\_\_ \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{\_\_iter\_\_}(\textit{self})

    \vspace{-1.5ex}

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

generator which iterates over cssRules.
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:css:cssstylesheet:CSSStyleSheet:add}
    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}!cssutils.css.cssstylesheet.CSSStyleSheet.add \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{add}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

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

Adds rule to stylesheet at appropriate position.
Same as \texttt{sheet.insertRule(rule, inOrder=True)}.
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:css:cssstylesheet:CSSStyleSheet:deleteRule}
    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}!cssutils.css.cssstylesheet.CSSStyleSheet.deleteRule \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{deleteRule}(\textit{self}, \textit{index})

    \vspace{-1.5ex}

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

Used to delete a rule from the style sheet.
\setlength{\parskip}{1ex}
      \textbf{Parameters}
      \vspace{-1ex}

      \begin{quote}
        \begin{Ventry}{xxxxx}

          \item[index]


of the rule to remove in the StyleSheet's rule list. For an
index {\textless} 0 \textbf{no} INDEX{\_}SIZE{\_}ERR is raised but rules for
normal Python lists are used. E.g. \texttt{deleteRule(-1)} removes
the last rule in cssRules.
        \end{Ventry}

      \end{quote}

      \textbf{Raises}
    \vspace{-1ex}

      \begin{quote}
        \begin{description}

          \item[\texttt{INDEX\_SIZE\_ERR}]


(self)
Raised if the specified index does not correspond to a rule in
the style sheet's rule list.
          \item[\texttt{NAMESPACE\_ERR}]


(self)
Raised if removing this rule would result in an invalid StyleSheet
          \item[\texttt{NO\_MODIFICATION\_ALLOWED\_ERR}]


(self)
Raised if this style sheet is readonly.
        \end{description}

      \end{quote}

    \end{boxedminipage}

    \label{cssutils:css:cssstylesheet:CSSStyleSheet:insertRule}
    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}!cssutils.css.cssstylesheet.CSSStyleSheet.insertRule \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{insertRule}(\textit{self}, \textit{rule}, \textit{index}={\tt None}, \textit{inOrder}={\tt False})

    \vspace{-1.5ex}

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

Used to insert a new rule into the style sheet. The new rule now
becomes part of the cascade.
\setlength{\parskip}{1ex}
      \textbf{Parameters}
      \vspace{-1ex}

      \begin{quote}
        \begin{Ventry}{xxxxxxx}

          \item[rule]


a parsable DOMString, in cssutils also a CSSRule or a
CSSRuleList
          \item[index]


of the rule before the new rule will be inserted.
If the specified index is equal to the length of the
StyleSheet's rule collection, the rule will be added to the end
of the style sheet.
If index is not given or None rule will be appended to rule
list.
          \item[inOrder]


if True the rule will be put to a proper location while
ignoring index but without raising HIERARCHY{\_}REQUEST{\_}ERR.
The resulting index is returned nevertheless
        \end{Ventry}

      \end{quote}

      \textbf{Return Value}
    \vspace{-1ex}

      \begin{quote}

the index within the stylesheet's rule collection
      \end{quote}

      \textbf{Raises}
    \vspace{-1ex}

      \begin{quote}
        \begin{description}

          \item[\texttt{HIERARCHY\_REQUEST\_ERR}]


(self)
Raised if the rule cannot be inserted at the specified index
e.g. if an @import rule is inserted after a standard rule set
or other at-rule.
          \item[\texttt{INDEX\_SIZE\_ERR}]


(self)
Raised if the specified index is not a valid insertion point.
          \item[\texttt{NO\_MODIFICATION\_ALLOWED\_ERR}]


(self)
Raised if this style sheet is readonly.
          \item[\texttt{SYNTAX\_ERR}]


(rule)
Raised if the specified rule has a syntax error and is
unparsable.
        \end{description}

      \end{quote}

    \end{boxedminipage}

    \label{cssutils:css:cssstylesheet:CSSStyleSheet:replaceUrls}
    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}!cssutils.css.cssstylesheet.CSSStyleSheet.replaceUrls \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{replaceUrls}(\textit{self}, \textit{replacer})

    \vspace{-1.5ex}

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

\textbf{EXPERIMENTAL}

Utility method to replace all \texttt{url(urlstring)} values in
\texttt{CSSImportRules} and \texttt{CSSStyleDeclaration} objects (properties).

\texttt{replacer} must be a function which is called with a single
argument \texttt{urlstring} which is the current value of url()
excluding \texttt{url(} and \texttt{)}. It still may have surrounding
single or double quotes though.
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:css:cssstylesheet:CSSStyleSheet:setSerializer}
    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}!cssutils.css.cssstylesheet.CSSStyleSheet.setSerializer \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{setSerializer}(\textit{self}, \textit{cssserializer})

    \vspace{-1.5ex}

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

Sets the global Serializer used for output of all stylesheet
output.
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:css:cssstylesheet:CSSStyleSheet:setSerializerPref}
    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}!cssutils.css.cssstylesheet.CSSStyleSheet.setSerializerPref \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{setSerializerPref}(\textit{self}, \textit{pref}, \textit{value})

    \vspace{-1.5ex}

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

Sets Preference of CSSSerializer used for output of this
stylesheet. See cssutils.serialize.Preferences for possible
preferences to be set.
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \vspace{0.5ex}

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

    \raggedright \textbf{\_\_repr\_\_}(\textit{self})

\setlength{\parskip}{2ex}
    repr(x)

\setlength{\parskip}{1ex}
      Overrides: object.\_\_repr\_\_ 	extit{(inherited documentation)}

    \end{boxedminipage}

    \vspace{0.5ex}

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

    \raggedright \textbf{\_\_str\_\_}(\textit{self})

\setlength{\parskip}{2ex}
    str(x)

\setlength{\parskip}{1ex}
      Overrides: object.\_\_str\_\_ 	extit{(inherited documentation)}

    \end{boxedminipage}


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

\begin{quote}
\_\_delattr\_\_(), \_\_getattribute\_\_(), \_\_hash\_\_(), \_\_new\_\_(), \_\_reduce\_\_(), \_\_reduce\_ex\_\_(), \_\_setattr\_\_()
\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\raggedright c\-s\-s\-T\-e\-x\-t\- & &\\
\cline{1-2}
\raggedright e\-n\-c\-o\-d\-i\-n\-g\- & \raggedright return encoding if @charset rule if given or default of 'utf-8'&\\
\cline{1-2}
\raggedright n\-a\-m\-e\-s\-p\-a\-c\-e\-s\- & \raggedright Namespaces used in this CSSStyleSheet.&\\
\cline{1-2}
\raggedright o\-w\-n\-e\-r\-R\-u\-l\-e\- & \raggedright (DOM attribute) NOT IMPLEMENTED YET&\\
\cline{1-2}
\multicolumn{2}{|l|}{\textit{Inherited from cssutils.stylesheets.stylesheet.StyleSheet \textit{(Section \ref{cssutils:stylesheets:stylesheet:StyleSheet})}}}\\
\multicolumn{2}{|p{\varwidth}|}{\raggedright parentStyleSheet}\\
\cline{1-2}
\multicolumn{2}{|l|}{\textit{Inherited from object}}\\
\multicolumn{2}{|p{\varwidth}|}{\raggedright \_\_class\_\_}\\
\cline{1-2}
\end{longtable}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                            Class Variables                            %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Class Variables}

    \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\raggedright t\-y\-p\-e\- & \raggedright \textbf{Value:} 
{\tt \texttt{'}\texttt{text/css}\texttt{'}}&\\
\cline{1-2}
\end{longtable}

    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}!cssutils.css.cssstylesheet.CSSStyleSheet \textit{(class)}|)}
    \index{cssutils \textit{(package)}!cssutils.css \textit{(package)}!cssutils.css.cssstylesheet \textit{(module)}|)}
