Package cssutils :: Module util :: Class _Namespaces |
[hide private]
[frames] | no frames]

# Class _Namespaces

source code

    object --+
             |
            _Namespaces

Known Subclasses:
  - _SimpleNamespaces

A dictionary like wrapper for @namespace rules used in a CSSStyleSheet. Works on effective namespaces, so e.g. if:

    @namespace p1 "uri";
    @namespace p2 "uri";

only the second rule is effective and kept.

namespaces
  a dictionary {prefix: namespaceURI} containing the effective namespaces only. These are the latest set in the CSSStyleSheet.
parentStyleSheet
  the parent CSSStyleSheet

Instance Methods | [hide private]
__init__(self, parentStyleSheet, *args) no initial values are set, only the relevant sheet is | source code
__contains__(self, prefix) | source code
__delitem__(self, prefix) deletes CSSNamespaceRule(s) with rule.prefix == prefix | source code
__getitem__(self, prefix) | source code
__iter__(self) | source code
__len__(self) | source code
__setitem__(self, prefix, namespaceURI) replaces prefix or sets new rule, may raise NoModificationAllowedErr | source code
__findrule(self, prefix) | source code
__getNamespaces(self) | source code
get(self, prefix, default) | source code
items(self) | source code
keys(self) | source code
values(self) | source code
prefixForNamespaceURI(self, namespaceURI) returns effective prefix for given namespaceURI or raises IndexError if this cannot be found | source code
__str__(self) str(x) | source code
_Namespaces__findrule(self, prefix) | source code
_Namespaces__getNamespaces(self) | source code
Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`

Properties | [hide private]
| namespaces Holds only effective @namespace rules in self.parentStyleSheets@namespace rules.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, parentStyleSheet, *args) (Constructor) | source code
no initial values are set, only the relevant sheet is Overrides: object.__init__

### __delitem__(self, prefix) (Index deletion operator) | source code
deletes CSSNamespaceRule(s) with rule.prefix == prefix prefix '' and None are handled the same

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

Property Details | [hide private]

### namespaces Holds only effective @namespace rules in self.parentStyleSheets@namespace rules. Get Method: _Namespaces__getNamespaces(self)