Changeset 2876:a23fafb46993 in livinglogic.python.xist

Show
Ignore:
Timestamp:
08/10/07 17:35:42 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Docstrings for css.iterrules() and css.applysteylesheets()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/css.py

    r2875 r2876  
    1010 
    1111""" 
    12 <par>Contains functions related to the handling of &css;.</par> 
     12<par>This module ontains functions related to the handling of &css;.</par> 
    1313""" 
    1414 
     
    8585def iterrules(node, base=None, media=None): 
    8686    """ 
    87     Return an iterator for all &css; rules defined in the &html; tree <arg>node</arg>. 
     87    <par>Return an iterator for all &css; rules defined in the &html; tree <arg>node</arg>. 
    8888    This will parse the &css; defined in any <class>html.style</class> or 
    8989    <class>html.link</class> element (and recursively in those stylesheets imported 
    9090    via the <lit>@import</lit> rule). The rules will be returned as 
    9191    <class>CSSStyleRule</class> objects from the <module>cssutils</module> package 
    92     (so this requires <module>cssutils</module>). The <arg>base</arg> argument 
    93     will be used as the base &url; for parsing the stylesheet references in the 
    94     tree (so <lit>None</lit> means the &url;s will be used exactly as they appear 
    95     in the tree). All &url;s in the style properties will be resolved. 
    96     If <arg>media</arg> is given, only rules that apply to this media type will 
    97     be produced. 
     92    (so this requires <module>cssutils</module>).</par> 
     93 
     94    <par>The <arg>base</arg> argument will be used as the base &url; for parsing 
     95    the stylesheet references in the tree (so <lit>None</lit> means the &url;s  
     96    will be used exactly as they appear in the tree). All &url;s in the style 
     97    properties will be resolved.</par> 
     98 
     99    <par>If <arg>media</arg> is given, only rules that apply to this media type 
     100    will be produced.</par> 
    98101    """ 
    99102    if base is not None: 
     
    123126 
    124127def applystylesheets(node, base=None, media=None): 
     128    """ 
     129    <par><function>applystylesheets</function> modifies the &xist; tree <arg>node</arg> 
     130    by removing all &css; (from <class>html.link</class> and <class>html.style</class> 
     131    elements and their <lit>@import</lit>ed stylesheets) and puts the resulting 
     132    styles properties into the <lit>style</lit> attribute of the every affected 
     133    element instead.</par> 
     134     
     135    <par>The <arg>base</arg> argument will be used as the base &url; for parsing 
     136    the stylesheet references in the tree (so <lit>None</lit> means the &url;s 
     137    will be used exactly as they appear in the tree). All &url;s in the style 
     138    properties will be resolved.</par> 
     139 
     140    <par>If <arg>media</arg> is given, only rules that apply to this media type 
     141    will be applied.</par> 
     142    """ 
    125143    def iterstyles(node, rules): 
    126144        if "style" in node.attrs: