Package cssutils :: Package stylesheets :: Module mediaquery :: Class MediaQuery |
[hide private]
[frames] | no frames]

# Class MediaQuery

source code

    object --+
             |
     util.Base --+
                 |
                MediaQuery

A Media Query consists of a media type and one or more expressions involving media features.

# Properties

mediaText: of type DOMString
  The parsable textual representation of this MediaQuery
mediaType: of type DOMString
  one of MEDIA_TYPES like e.g. 'print'
seq: a list (cssutils)
  All parts of this MediaQuery including CSSComments
valid:
  if this query is valid

# Format

    media_query: [[only | not]? <media_type> [ and <expression> ]*]
      | <expression> [ and <expression> ]*
    expression: ( <media_feature> [: <value>]? )
    media_type: all | aural | braille | handheld | print |
      projection | screen | tty | tv | embossed
    media_feature: width | min-width | max-width
      | height | min-height | max-height
      | device-width | min-device-width | max-device-width
      | device-height | min-device-height | max-device-height
      | device-aspect-ratio | min-device-aspect-ratio | max-device-aspect-ratio
      | color | min-color | max-color
      | color-index | min-color-index | max-color-index
      | monochrome | min-monochrome | max-monochrome
      | resolution | min-resolution | max-resolution
      | scan | grid

Nested Classes | [hide private]
Inherited from `util.Base` (private): `_prods`

Instance Methods | [hide private]
__mediaTypeMatch(...) match(string[, pos[, endpos]]) --> match object or None. | source code
__init__(self, mediaText=None, readonly=False) unicodestring of parsable media | source code
_getMediaText(self) returns serialized property mediaText | source code
_setMediaText(self, mediaText) a single media query string, e.g. | source code
_getMediaType(self) returns serialized property mediaText | source code
_setMediaType(self, mediaType) one of MEDIA_TYPES | source code
__repr__(self) repr(x) | source code
__str__(self) str(x) | source code
Inherited from `util.Base` (private): `_checkReadonly`, `_getProductions`, `_newseq`, `_nexttoken`, `_parse`, `_tokenize2`, `_tokensupto2`, `_tokenvalue`, `_type`, `_valuestr` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Static Methods | [hide private]
Inherited from `util.Base` (private): `_normalize`

Class Variables | [hide private]
| MEDIA_TYPES = ``[``u'``all``'``,` `u'``aural``'``,` `u'``braille``'``,` `u'``embossed``'``,` `u'``ha``...``
Inherited from `util.Base` (private): `_SHORTHANDPROPERTIES`, `_log`

Properties | [hide private]
| mediaText (DOM) The parsable textual representation of the media list.
| mediaType (DOM) media type (one of MediaQuery.MEDIA_TYPES) of this MediaQuery.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __mediaTypeMatch(...) | source code
match(string[, pos[, endpos]]) --> match object or None. Matches zero or more characters at the beginning of the string

### __init__(self, mediaText=None, readonly=False) (Constructor) | source code
mediaText unicodestring of parsable media Overrides: object.__init__

### _setMediaText(self, mediaText) | source code
mediaText a single media query string, e.g. "print and (min-width: 25cm)" DOMException SYNTAX_ERR: (self) Raised if the specified string value has a syntax error and is unparsable. INVALID_CHARACTER_ERR: (self) Raised if the given mediaType is unknown. NO_MODIFICATION_ALLOWED_ERR: (self) Raised if this media query is readonly.

### _setMediaType(self, mediaType) | source code
mediaType one of MEDIA_TYPES DOMException SYNTAX_ERR: (self) Raised if the specified string value has a syntax error and is unparsable. INVALID_CHARACTER_ERR: (self) Raised if the given mediaType is unknown. NO_MODIFICATION_ALLOWED_ERR: (self) Raised if this media query is readonly.

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

Class Variable Details | [hide private]

  ### MEDIA_TYPES Value:
      [u'all',
       u'aural',
       u'braille',
       u'embossed',
       u'handheld',
       u'print',
       u'projection',
       u'screen',
      ...

Property Details | [hide private]

  ### mediaText (DOM) The parsable textual representation of the media list. This is a comma-separated list of media. Get Method: cssutils.stylesheets.mediaquery.MediaQuery._getMediaText(self) - returns serialized property mediaText Set Method: cssutils.stylesheets.mediaquery.MediaQuery._setMediaText(self, mediaText) - a single media query string, e.g. Delete Method:
      None

  ### mediaType (DOM) media type (one of MediaQuery.MEDIA_TYPES) of this MediaQuery. Get Method: cssutils.stylesheets.mediaquery.MediaQuery._getMediaType(self) - returns serialized property mediaText Set Method: cssutils.stylesheets.mediaquery.MediaQuery._setMediaType(self, mediaType) - one of MEDIA_TYPES Delete Method:
      None