1 """
2 StyleSheetList implements DOM Level 2 Style Sheets StyleSheetList.
3 """
4 __all__ = ['StyleSheetList']
5 __docformat__ = 'restructuredtext'
6 __author__ = '$LastChangedBy: doerwalter $'
7 __date__ = '$LastChangedDate: 2007-08-02 22:58:23 +0200 (Do, 02 Aug 2007) $'
8 __version__ = '0.9.2a2 $LastChangedRevision: 160 $'
9
10
12 """
13 Interface StyleSheetList (introduced in DOM Level 2)
14
15 The StyleSheetList interface provides the abstraction of an ordered
16 collection of style sheets.
17
18 The items in the StyleSheetList are accessible via an integral index,
19 starting from 0.
20
21 This Python implementation is based on a standard Python list so e.g.
22 allows ``examplelist[index]`` usage.
23 """
26
27 length = property(_getLength,
28 doc="""The number of StyleSheets in the list. The range of valid
29 child stylesheet indices is 0 to length-1 inclusive.""")
30
31
32 - def item(self, index):
33 """
34 Used to retrieve a style sheet by ordinal index. If index is
35 greater than or equal to the number of style sheets in the list,
36 this returns None.
37 """
38 try:
39 return self[index]
40 except IndexError:
41 return None
42