home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1574 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  4.3 KB  |  68 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 1943 2010-03-23 20:54:00Z cthedot $'
  8. import cssutils
  9. import xml.dom as xml
  10.  
  11. class CSSRule(cssutils.util.Base2):
  12.     UNKNOWN_RULE = 0
  13.     STYLE_RULE = 1
  14.     CHARSET_RULE = 2
  15.     IMPORT_RULE = 3
  16.     MEDIA_RULE = 4
  17.     FONT_FACE_RULE = 5
  18.     PAGE_RULE = 6
  19.     NAMESPACE_RULE = 10
  20.     COMMENT = 1001
  21.     VARIABLES_RULE = 1008
  22.     _typestrings = {
  23.         UNKNOWN_RULE: u'UNKNOWN_RULE',
  24.         STYLE_RULE: u'STYLE_RULE',
  25.         CHARSET_RULE: u'CHARSET_RULE',
  26.         IMPORT_RULE: u'IMPORT_RULE',
  27.         MEDIA_RULE: u'MEDIA_RULE',
  28.         FONT_FACE_RULE: u'FONT_FACE_RULE',
  29.         PAGE_RULE: u'PAGE_RULE',
  30.         NAMESPACE_RULE: u'NAMESPACE_RULE',
  31.         COMMENT: u'COMMENT',
  32.         VARIABLES_RULE: u'VARIABLES_RULE' }
  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 = u'(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 = u'The Parent Node of this CSSRule or None.')
  56.     parentRule = property((lambda self: self._parentRule), doc = u'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.     
  58.     def _getParentStyleSheet(self):
  59.         if self.parentRule:
  60.             return self.parentRule._parentStyleSheet
  61.         return self._parentStyleSheet
  62.  
  63.     parentStyleSheet = property(_getParentStyleSheet, doc = u'The style sheet that contains this rule.')
  64.     type = property((lambda self: self.UNKNOWN_RULE), doc = u'The type of this rule, as defined by a CSSRule type constant.')
  65.     typeString = property((lambda self: CSSRule._typestrings[self.type]), doc = u"Descriptive name of this rule's type.")
  66.     wellformed = property((lambda self: False), doc = u'If the rule is wellformed.')
  67.  
  68.