Menu

[r7]: / CopyRule.py  Maximize  Restore  History

Download this file

44 lines (25 with data), 1.0 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
from Translator import *
import Object
import SelectorList, pdb
class SSSCopyRule(Object.SSSObject):
def __init__(self, rule):
super(SSSCopyRule, self).__init__()
self._selectors = None
self._parse(rule)
def _parse(self, text):
matches = preg_match('^@copy\s+([^\;]*);?$', trim(text))
if (matches):
self._selectors = SelectorList.SSSSelectorList(matches[0])
def set_cssText(self, value):
return self._parse(value)
def get_cssText(self):
return self.__str__()
cssText = property(get_cssText, set_cssText)
def get_selectorText(self):
return self._selectors.selectorText
selectorText = property(get_selectorText)
def get(var):
if (var == 'type'): return SSSObject.COPY_RULE
return super(SSSDirective, self).get(var)
def __str__(self):
return self.createCommentText("@copy " + self._selectors.selectorText) + "\n\n"
MongoDB Logo MongoDB