%
% API Documentation for cssutils
% Module cssutils.scripts.csscapture
%
% Generated by epydoc 3.0.1
% [Fri Feb 01 19:05:22 2008]
%

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

    \index{cssutils \textit{(package)}!cssutils.scripts \textit{(package)}!cssutils.scripts.csscapture \textit{(module)}|(}
\section{Module cssutils.scripts.csscapture}

    \label{cssutils:scripts:csscapture}

Retrieve all CSS stylesheets including embedded for a given URL.
Retrieve as StyleSheetList or save to disk - raw, parsed or minified version.

TODO:
- maybe use DOM 3 load/save?
- logger class which handles all cases when no log is given...
- saveto: why does urllib2 hang?
\textbf{Version:} \$LastChangedRevision: 950 \$



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



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




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

    \index{cssutils \textit{(package)}!cssutils.scripts \textit{(package)}!cssutils.scripts.csscapture \textit{(module)}!cssutils.scripts.csscapture.CSSCapture \textit{(class)}|(}
\subsection{Class CSSCapture}

    \label{cssutils:scripts:csscapture:CSSCapture}
\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.scripts.csscapture.CSSCapture}}
\end{tabular}


Retrieve all CSS stylesheets including embedded for a given URL.
Optional setting of User-Agent used for retrieval possible
to handle browser sniffing servers.

raises urllib2.HTTPError

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

  \subsubsection{Methods}

    \vspace{0.5ex}

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

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{ua}={\tt None}, \textit{log}={\tt None}, \textit{defaultloglevel}={\tt 20})

    \vspace{-1.5ex}

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

initialize a new Capture object
\begin{description}
\item[{ua}] \leavevmode 
init User-Agent to use for requests

\item[{log}] \leavevmode 
supply a log object which is used instead of the default
log which writes to sys.stderr

\item[{defaultloglevel}] \leavevmode 
constant of logging package which defines the level of the
default log if no explicit log given

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

    \end{boxedminipage}

    \label{cssutils:scripts:csscapture:CSSCapture:capture}
    \index{cssutils \textit{(package)}!cssutils.scripts \textit{(package)}!cssutils.scripts.csscapture \textit{(module)}!cssutils.scripts.csscapture.CSSCapture \textit{(class)}!cssutils.scripts.csscapture.CSSCapture.capture \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{capture}(\textit{self}, \textit{url}, \textit{ua}={\tt None})

    \vspace{-1.5ex}

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

Capture stylesheets for the given url, any HTTPError is raised to
caller.
\begin{description}
\item[{url}] \leavevmode 
to capture CSS from

\item[{ua}] \leavevmode 
User-Agent to use for requests

\end{description}

Returns StyleSheetList.
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{cssutils:scripts:csscapture:CSSCapture:saveto}
    \index{cssutils \textit{(package)}!cssutils.scripts \textit{(package)}!cssutils.scripts.csscapture \textit{(module)}!cssutils.scripts.csscapture.CSSCapture \textit{(class)}!cssutils.scripts.csscapture.CSSCapture.saveto \textit{(method)}}

    \vspace{0.5ex}

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

    \raggedright \textbf{saveto}(\textit{self}, \textit{dir}, \textit{saveraw}={\tt False}, \textit{minified}={\tt False})

    \vspace{-1.5ex}

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

saves css in ``dir'' in the same layout as on the server
internal stylesheets are saved as ``dir/{\_}{\_}INLINE{\_}STYLE{\_}{\_}.html.css''
\begin{description}
\item[{dir}] \leavevmode 
directory to save files to

\item[{saveparsed}] \leavevmode 
save literal CSS from server or save the parsed CSS

\item[{minified}] \leavevmode 
save minified CSS

\end{description}

Both parsed and minified (which is also parsed of course) will
loose information which cssutils is unable to understand or where
it is simple buggy. You might to first save the raw version before
parsing of even minifying it.
\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.scripts \textit{(package)}!cssutils.scripts.csscapture \textit{(module)}!cssutils.scripts.csscapture.CSSCapture \textit{(class)}|)}
    \index{cssutils \textit{(package)}!cssutils.scripts \textit{(package)}!cssutils.scripts.csscapture \textit{(module)}|)}
