Package sld :: Class Rules
[hide private]
[frames] | no frames]

Class Rules

source code


A collection of Rule nodes. This is a pythonic helper (list of nodes) that does not correspond to a true element in the SLD spec.

Instance Methods [hide private]
 
__init__(self, parent, descendant=True)
Create a new list of Rules from the specified parent node.
source code
 
normalize(self)
Normalize this node and all rules contained within.
source code
integer
__len__(self)
Get the number of CssParameter nodes in this list.
source code
Rule
__getitem__(self, key)
Get one of the Rule nodes in the list.
source code
 
__setitem__(self, key, value)
Set one of the Rule nodes in the list with a new value.
source code
 
__delitem__(self, key)
Delete one of the Rule nodes from the list.
source code

Inherited from SLDNode: create_element, get_or_create_element

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from SLDNode: makeproperty

Class Variables [hide private]

Inherited from SLDNode (private): _nsmap

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, descendant=True)
(Constructor)

source code 

Create a new list of Rules from the specified parent node.

Parameters:
  • parent (FeatureTypeStyle) - The parent class object.
  • descendant (boolean) - A flag indicating if this is a descendant node of the parent.
Overrides: object.__init__

normalize(self)

source code 

Normalize this node and all rules contained within. The SLD model is modified in place.

__len__(self)
(Length operator)

source code 

Get the number of CssParameter nodes in this list.

Returns: integer
The number of CssParameter nodes.

__getitem__(self, key)
(Indexing operator)

source code 

Get one of the Rule nodes in the list.

Parameters:
  • key (integer) - The index of the child node.
Returns: Rule
The specific Rule node.

__setitem__(self, key, value)
(Index assignment operator)

source code 

Set one of the Rule nodes in the list with a new value.

Parameters:
  • key (integer) - The index of the child node.
  • value (Rule, etree.Element) - The new value of the specific child node.

__delitem__(self, key)
(Index deletion operator)

source code 

Delete one of the Rule nodes from the list.

Parameters:
  • key (integer) - The index of the child node.