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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __all__ = [
  5.     'CSSRule']
  6. __docformat__ = 'restructuredtext'
  7. __version__ = '$Id: cssrule.py 1855 2009-10-07 17:03:19Z cthedot $'
  8. import cssutils
  9. import xml.dom as xml
  10.  
  11. class CSSRule(cssutils.util.Base2):
  12.     COMMENT = -1
  13.     UNKNOWN_RULE = 0
  14.     STYLE_RULE = 1
  15.     CHARSET_RULE = 2
  16.     IMPORT_RULE = 3
  17.     MEDIA_RULE = 4
  18.     FONT_FACE_RULE = 5
  19.     PAGE_RULE = 6
  20.     NAMESPACE_RULE = 7
  21.     VARIABLES_RULE = 8
  22.     _typestrings = [
  23.         'UNKNOWN_RULE',
  24.         'STYLE_RULE',
  25.         'CHARSET_RULE',
  26.         'IMPORT_RULE',
  27.         'MEDIA_RULE',
  28.         'FONT_FACE_RULE',
  29.         'PAGE_RULE',
  30.         'NAMESPACE_RULE',
  31.         'VARIABLES_RULE',
  32.         'COMMENT']
  33.     
  34.     def __init__(self, parentRule = None, parentStyleSheet = None, readonly = False):
  35.         super(CSSRule, self).__init__()
  36.         self._parent = parentRule
  37.         self._parentRule = parentRule
  38.         self._parentStyleSheet = parentStyleSheet
  39.         self._setSeq(self._tempSeq())
  40.         self._readonly = False
  41.  
  42.     
  43.     def _setAtkeyword(self, akw):
  44.         if not (self.atkeyword) or self._normalize(akw) == self._normalize(self.atkeyword):
  45.             self._atkeyword = akw
  46.         else:
  47.             self._log.error(u'%s: Invalid atkeyword for this rule: %r' % (self._normalize(self.atkeyword), akw), error = xml.dom.InvalidModificationErr)
  48.  
  49.     atkeyword = property((lambda self: self._atkeyword), _setAtkeyword, doc = u'Literal keyword of an @rule (e.g. ``@IMport``).')
  50.     
  51.     def _setCssText(self, cssText):
  52.         self._checkReadonly()
  53.  
  54.     cssText = property((lambda self: u''), _setCssText, doc = '(DOM) The parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.')
  55.     parent = property((lambda self: self._parent), doc = 'The Parent Node of this CSSRule (currently if a CSSStyleDeclaration only!) or None.')
  56.     parentRule = property((lambda self: self._parentRule), doc = 'If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.')
  57.     parentStyleSheet = property((lambda self: self._parentStyleSheet), doc = 'The style sheet that contains this rule.')
  58.     type = property((lambda self: self.UNKNOWN_RULE), doc = 'The type of this rule, as defined by a CSSRule type constant.')
  59.     typeString = property((lambda self: CSSRule._typestrings[self.type]), doc = "Descriptive name of this rule's type.")
  60.     wellformed = property((lambda self: False), doc = u'If the rule is wellformed.')
  61.  
  62.