Home | Trees | Indices | Help |
|
---|
|
1 """CSSComment is not defined in DOM Level 2 at all but a cssutils defined 2 class. 3 Implements CSSRule which is also extended for a CSSComment rule type 4 """ 5 __all__ = ['CSSComment'] 6 __docformat__ = 'restructuredtext' 7 __author__ = '$LastChangedBy: doerwalter $' 8 __date__ = '$LastChangedDate: 2007-08-02 22:58:23 +0200 (Do, 02 Aug 2007) $' 9 __version__ = '0.9.2a1, $LastChangedRevision: 160 $' 10 11 import xml.dom 12 13 import cssrule 14 import cssutils 15 1618 """ 19 (cssutils) a CSS comment 20 21 Properties 22 ========== 23 cssText: of type DOMString 24 The comment text including comment delimiters 25 26 Inherits properties from CSSRule 27 28 Format 29 ====== 30 :: 31 32 /*...*/ 33 """ 34 type = cssrule.CSSRule.COMMENT # value = -1 358737 super(CSSComment, self).__init__() 38 39 if cssText: 40 self._setCssText(cssText) 41 else: 42 self._cssText = None 43 44 self._readonly = readonly45 46 5052 """ 53 cssText 54 textual text to set or tokenlist which is not tokenized 55 anymore. May also be a single token for this rule 56 parser 57 if called from cssparser directly this is Parser instance 58 59 DOMException on setting 60 61 - SYNTAX_ERR: (self) 62 Raised if the specified CSS string value has a syntax error and 63 is unparsable. 64 - INVALID_MODIFICATION_ERR: (self) 65 Raised if the specified CSS string value represents a different 66 type of rule than the current one. 67 - NO_MODIFICATION_ALLOWED_ERR: (CSSRule) 68 Raised if the rule is readonly. 69 """ 70 super(CSSComment, self)._setCssText(cssText) 71 tokens = self._tokenize(cssText) 72 73 if not tokens or tokens[0].type != self._ttypes.COMMENT: 74 self._log.error(u'CSSComent: Not a CSSComment: %s' % 75 self._valuestr(cssText), 76 error=xml.dom.InvalidModificationErr) 77 elif len(tokens) > 1: 78 self._log.error( 79 u'CSSComment: Syntax error. %s' % self._valuestr( 80 cssText)) 81 else: 82 token = tokens[0] 83 self._cssText = token.value84 85 cssText = property(_getCssText, _setCssText, 86 doc=u"(cssutils) Textual representation of this comment")
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Sat Aug 04 12:58:34 2007 | http://epydoc.sourceforge.net |