home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1510 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  2.9 KB  |  49 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __all__ = [
  5.     'CSSComment']
  6. __docformat__ = 'restructuredtext'
  7. __version__ = '$Id: csscomment.py 1638 2009-01-13 20:39:33Z cthedot $'
  8. import cssrule
  9. import cssutils
  10. import xml.dom as xml
  11.  
  12. class CSSComment(cssrule.CSSRule):
  13.     
  14.     def __init__(self, cssText = None, parentRule = None, parentStyleSheet = None, readonly = False):
  15.         super(CSSComment, self).__init__(parentRule = parentRule, parentStyleSheet = parentStyleSheet)
  16.         self._cssText = None
  17.         if cssText:
  18.             self._setCssText(cssText)
  19.         
  20.         self._readonly = readonly
  21.  
  22.     
  23.     def __repr__(self):
  24.         return 'cssutils.css.%s(cssText=%r)' % (self.__class__.__name__, self.cssText)
  25.  
  26.     
  27.     def __str__(self):
  28.         return '<cssutils.css.%s object cssText=%r at 0x%x>' % (self.__class__.__name__, self.cssText, id(self))
  29.  
  30.     
  31.     def _getCssText(self):
  32.         return cssutils.ser.do_CSSComment(self)
  33.  
  34.     
  35.     def _setCssText(self, cssText):
  36.         super(CSSComment, self)._setCssText(cssText)
  37.         tokenizer = self._tokenize2(cssText)
  38.         commenttoken = self._nexttoken(tokenizer)
  39.         unexpected = self._nexttoken(tokenizer)
  40.         if not commenttoken and self._type(commenttoken) != self._prods.COMMENT or unexpected:
  41.             self._log.error(u'CSSComment: Not a CSSComment: %r' % self._valuestr(cssText), error = xml.dom.InvalidModificationErr)
  42.         else:
  43.             self._cssText = self._tokenvalue(commenttoken)
  44.  
  45.     cssText = property(_getCssText, _setCssText, doc = u'The parsable textual representation of this rule.')
  46.     type = property((lambda self: self.COMMENT), doc = 'The type of this rule, as defined by a CSSRule type constant.')
  47.     wellformed = property((lambda self: True))
  48.  
  49.