Home | Trees | Indices | Help |
|
---|
|
1 """CSSComment is not defined in DOM Level 2 at all but a cssutils defined 2 class only. 3 Implements CSSRule which is also extended for a CSSComment rule type 4 """ 5 __all__ = ['CSSComment'] 6 __docformat__ = 'restructuredtext' 7 __author__ = '$LastChangedBy: cthedot $' 8 __date__ = '$LastChangedDate: 2008-01-27 17:28:41 +0100 (So, 27 Jan 2008) $' 9 __version__ = '$LastChangedRevision: 950 $' 10 11 import xml.dom 12 import cssrule 13 import cssutils 1416 """ 17 (cssutils) a CSS comment 18 19 Properties 20 ========== 21 cssText: of type DOMString 22 The comment text including comment delimiters 23 24 Inherits properties from CSSRule 25 26 Format 27 ====== 28 :: 29 30 /*...*/ 31 """ 32 type = cssrule.CSSRule.COMMENT # value = -1 339336 super(CSSComment, self).__init__(parentRule=parentRule, 37 parentStyleSheet=parentStyleSheet) 38 39 self._cssText = None 40 if cssText: 41 self._setCssText(cssText) 42 43 self._readonly = readonly44 4850 """ 51 cssText 52 textual text to set or tokenlist which is not tokenized 53 anymore. May also be a single token for this rule 54 parser 55 if called from cssparser directly this is Parser instance 56 57 DOMException on setting 58 59 - SYNTAX_ERR: (self) 60 Raised if the specified CSS string value has a syntax error and 61 is unparsable. 62 - INVALID_MODIFICATION_ERR: (self) 63 Raised if the specified CSS string value represents a different 64 type of rule than the current one. 65 - NO_MODIFICATION_ALLOWED_ERR: (CSSRule) 66 Raised if the rule is readonly. 67 """ 68 super(CSSComment, self)._setCssText(cssText) 69 tokenizer = self._tokenize2(cssText) 70 71 commenttoken = self._nexttoken(tokenizer) 72 unexpected = self._nexttoken(tokenizer) 73 74 if not commenttoken or\ 75 self._type(commenttoken) != self._prods.COMMENT or\ 76 unexpected: 77 self._log.error(u'CSSComment: Not a CSSComment: %r' % 78 self._valuestr(cssText), 79 error=xml.dom.InvalidModificationErr) 80 else: 81 self._cssText = self._tokenvalue(commenttoken)82 83 cssText = property(_getCssText, _setCssText, 84 doc=u"(cssutils) Textual representation of this comment") 85 8991 return "<cssutils.css.%s object cssText=%r at 0x%x>" % ( 92 self.__class__.__name__, self.cssText, id(self))
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Feb 03 21:11:02 2008 | http://epydoc.sourceforge.net |