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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __all__ = [
  5.     'CSSProductions',
  6.     'MACROS',
  7.     'PRODUCTIONS']
  8. __docformat__ = 'restructuredtext'
  9. __version__ = '$Id: cssproductions.py 1855 2009-10-07 17:03:19Z cthedot $'
  10. MACROS = {
  11.     'nonascii': '[^\\0-\\177]',
  12.     'unicode': '\\\\[0-9A-Fa-f]{1,6}(?:{nl}|{s})?',
  13.     'escape': '{unicode}|\\\\[^\\n\\r\\f0-9a-f]',
  14.     'nmstart': '[_a-zA-Z]|{nonascii}|{escape}',
  15.     'nmchar': '[-_a-zA-Z0-9]|{nonascii}|{escape}',
  16.     'string1': '"([^\\n\\r\\f\\\\"]|\\\\{nl}|{escape})*"',
  17.     'string2': "'([^\\n\\r\\f\\\\']|\\\\{nl}|{escape})*'",
  18.     'invalid1': '\\"([^\\n\\r\\f\\\\"]|\\\\{nl}|{escape})*',
  19.     'invalid2': "\\'([^\\n\\r\\f\\\\']|\\\\{nl}|{escape})*",
  20.     'comment': '\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\/',
  21.     'ident': '[-]?{nmstart}{nmchar}*',
  22.     'name': '{nmchar}+',
  23.     'num': '[0-9]*\\.[0-9]+|[0-9]+',
  24.     'string': '{string1}|{string2}',
  25.     'invalid': '{invalid1}|{invalid2}',
  26.     'url': '[\\x09\\x21\\x23-\\x26\\x28\\x2a-\\x7E]|{nonascii}|{escape}',
  27.     's': '\\t|\\r|\\n|\\f|\\x20',
  28.     'w': '{s}*',
  29.     'nl': '\\n|\\r\\n|\\r|\\f',
  30.     'A': 'A|a|\\\\0{0,4}(?:41|61)(?:\\r\\n|[ \\t\\r\\n\\f])?',
  31.     'B': 'B|b|\\\\0{0,4}(?:42|62)(?:\\r\\n|[ \\t\\r\\n\\f])?',
  32.     'C': 'C|c|\\\\0{0,4}(?:43|63)(?:\\r\\n|[ \\t\\r\\n\\f])?',
  33.     'D': 'D|d|\\\\0{0,4}(?:44|64)(?:\\r\\n|[ \\t\\r\\n\\f])?',
  34.     'E': 'E|e|\\\\0{0,4}(?:45|65)(?:\\r\\n|[ \\t\\r\\n\\f])?',
  35.     'F': 'F|f|\\\\0{0,4}(?:46|66)(?:\\r\\n|[ \\t\\r\\n\\f])?',
  36.     'G': 'G|g|\\\\0{0,4}(?:47|67)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\G|\\\\g',
  37.     'H': 'H|h|\\\\0{0,4}(?:48|68)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\H|\\\\h',
  38.     'I': 'I|i|\\\\0{0,4}(?:49|69)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\I|\\\\i',
  39.     'K': 'K|k|\\\\0{0,4}(?:4b|6b)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\K|\\\\k',
  40.     'L': 'L|l|\\\\0{0,4}(?:4c|6c)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\L|\\\\l',
  41.     'M': 'M|m|\\\\0{0,4}(?:4d|6d)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\M|\\\\m',
  42.     'N': 'N|n|\\\\0{0,4}(?:4e|6e)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\N|\\\\n',
  43.     'O': 'O|o|\\\\0{0,4}(?:4f|6f)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\O|\\\\o',
  44.     'P': 'P|p|\\\\0{0,4}(?:50|70)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\P|\\\\p',
  45.     'R': 'R|r|\\\\0{0,4}(?:52|72)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\R|\\\\r',
  46.     'S': 'S|s|\\\\0{0,4}(?:53|73)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\S|\\\\s',
  47.     'T': 'T|t|\\\\0{0,4}(?:54|74)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\T|\\\\t',
  48.     'U': 'U|u|\\\\0{0,4}(?:55|75)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\U|\\\\u',
  49.     'V': 'V|v|\\\\0{0,4}(?:56|76)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\V|\\\\v',
  50.     'X': 'X|x|\\\\0{0,4}(?:58|78)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\X|\\\\x',
  51.     'Z': 'Z|z|\\\\0{0,4}(?:5a|7a)(?:\\r\\n|[ \\t\\r\\n\\f])?|\\\\Z|\\\\z' }
  52. PRODUCTIONS = [
  53.     ('BOM', '\\xFEFF'),
  54.     ('S', '{s}+'),
  55.     ('URI', '{U}{R}{L}\\({w}({string}|{url}*){w}\\)'),
  56.     ('FUNCTION', '{ident}\\('),
  57.     ('UNICODE-RANGE', '{U}\\+[0-9A-Fa-f?]{1,6}(\\-[0-9A-Fa-f]{1,6})?'),
  58.     ('IDENT', '{ident}'),
  59.     ('STRING', '{string}'),
  60.     ('INVALID', '{invalid}'),
  61.     ('HASH', '\\#{name}'),
  62.     ('PERCENTAGE', '{num}\\%'),
  63.     ('DIMENSION', '{num}{ident}'),
  64.     ('NUMBER', '{num}'),
  65.     ('COMMENT', '{comment}'),
  66.     ('ATKEYWORD', '@{ident}'),
  67.     ('CDO', '\\<\\!\\-\\-'),
  68.     ('CDC', '\\-\\-\\>'),
  69.     ('INCLUDES', '\\~\\='),
  70.     ('DASHMATCH', '\\|\\='),
  71.     ('PREFIXMATCH', '\\^\\='),
  72.     ('SUFFIXMATCH', '\\$\\='),
  73.     ('SUBSTRINGMATCH', '\\*\\='),
  74.     ('CHAR', '[^"\\\']')]
  75.  
  76. class CSSProductions(object):
  77.     EOF = True
  78.     CHARSET_SYM = 'CHARSET_SYM'
  79.     FONT_FACE_SYM = 'FONT_FACE_SYM'
  80.     MEDIA_SYM = 'MEDIA_SYM'
  81.     IMPORT_SYM = 'IMPORT_SYM'
  82.     NAMESPACE_SYM = 'NAMESPACE_SYM'
  83.     PAGE_SYM = 'PAGE_SYM'
  84.     VARIABLES_SYM = 'VARIABLES_SYM'
  85.  
  86. for i, t in enumerate(PRODUCTIONS):
  87.     setattr(CSSProductions, t[0].replace('-', '_'), t[0])
  88.  
  89. _DXImageTransform = ('FUNCTION', 'progid\\:DXImageTransform\\.Microsoft\\..+\\(')
  90.