Menu

[r1]: / InheritRule.py  Maximize  Restore  History

Download this file

45 lines (27 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from Translator import *
import Object, SelectorList
class SSSInheritRule(Object.SSSObject):
_selectors = []
def __init__(self, rule = ''):
super(SSSInheritRule, self).__init__()
if (rule): self._parse(rule)
def _parse(self, text):
matches = preg_match(r'@inherit\s+([^\;]*)\;?$', trim(text))
if (matches):
self._selectors = SelectorList.SSSSelectorList(matches[0], self)
def set_cssText(self, txt):
return self._parse(txt)
def get_cssText(self):
return self.__str__()
cssText = property(get_cssText, set_cssText)
def get_type(self):
return Object.SSSObject.INHERIT_RULE
type = property(get_type)
def get_selectorText(self):
return self._selectors.selectorText
selectorText = property(get_selectorText)
def get_selectorList(self):
return self._selectors
selectorList = property(get_selectorList)
def __str__(self):
return self.createCommentText("@inherit " + self._selectors.selectorText) + "\n"
MongoDB Logo MongoDB