Codulle - L'explorateur de code sources

Accueil>> AlBulle >> AlBulle0.2 >> medias

Informations fichier

Nom du fichier : python.php
Taille du fichier : 9 Ko (227 lignes)
Language : PHP

  1. span style="color: #808080; font-style: italic;">/*************************************************************************************
  2. * python.php
  3. * ----------
  4. * Author: Roberto Rossi (rsoftware@altervista.org)
  5. * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
  6. * Release Version: 1.0.7.5
  7. * CVS Revision Version: $Revision: 1.6 $
  8. * Date Started: 2004/08/30
  9. * Last Modified: $Date: 2005/10/22 07:52:59 $
  10. *
  11. * Python language file for GeSHi.
  12. *
  13. * CHANGES
  14. * -------
  15. * 2005/05/26
  16. * - Modifications by Tim (tim@skreak.com): added more keyword categories, tweaked colors
  17. * 2004/11/27 (1.0.1)
  18. * - Added support for multiple object splitters
  19. * 2004/08/30 (1.0.0)
  20. * - First Release
  21. *
  22. * TODO (updated 2004/11/27)
  23. * -------------------------
  24. *
  25. *************************************************************************************
  26. *
  27. * This file is part of GeSHi.
  28. *
  29. * GeSHi is free software; you can redistribute it and/or modify
  30. * it under the terms of the GNU General Public License as published by
  31. * the Free Software Foundation; either version 2 of the License, or
  32. * (at your option) any later version.
  33. *
  34. * GeSHi is distributed in the hope that it will be useful,
  35. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  36. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  37. * GNU General Public License for more details.
  38. *
  39. * You should have received a copy of the GNU General Public License
  40. * along with GeSHi; if not, write to the Free Software
  41. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  42. *
  43. ************************************************************************************/'LANG_NAME' => 'Python',
  44. 'COMMENT_SINGLE''#'),
  45. 'COMMENT_MULTI''CASE_KEYWORDS''QUOTEMARKS''"', "'", '"""'),
  46. 'ESCAPE_CHAR' => '\\',
  47. 'KEYWORDS'/*
  48. ** Set 1: reserved words
  49. ** http://python.org/doc/current/ref/keywords.html
  50. */'and', 'del', 'for', 'is', 'raise', 'assert', 'elif', 'from', 'lambda', 'return', 'break',
  51. 'else', 'global', 'not', 'try', 'class', 'except', 'if', 'or', 'while', 'continue', 'exec',
  52. 'import', 'pass', 'yield', 'def', 'finally', 'in', 'print'
  53. ),
  54.  
  55. /*
  56. ** Set 2: builtins
  57. ** http://python.org/doc/current/lib/built-in-funcs.html
  58. */'__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
  59. 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
  60. 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
  61. 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
  62. 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
  63. 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
  64. 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
  65. 'vars', 'xrange', 'zip',
  66. // Built-in constants: http://python.org/doc/current/lib/node35.html
  67. 'False', 'True', 'None', 'NotImplemented', 'Ellipsis',
  68. // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
  69. 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
  70. 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
  71. 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
  72. 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
  73. 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
  74. 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
  75. 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
  76. 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
  77. 'RuntimeWarning', 'FutureWarning',
  78. // self: this is a common python convention (but not a reserved word)
  79. 'self'
  80. ),
  81.  
  82. /*
  83. ** Set 3: standard library
  84. ** http://python.org/doc/current/lib/modindex.html
  85. */'__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
  86. 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
  87. 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
  88. 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
  89. 'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',
  90. 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
  91. 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
  92. 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
  93. 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
  94. 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
  95. 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
  96. 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
  97. 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
  98. 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
  99. 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
  100. 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
  101. 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
  102. 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
  103. 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
  104. 're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
  105. 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
  106. 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
  107. 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
  108. 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
  109. 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
  110. 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
  111. 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
  112. 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
  113. 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
  114. 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'
  115. ),
  116.  
  117. /*
  118. ** Set 4: special methods
  119. ** http://python.org/doc/current/ref/specialnames.html
  120. *//*
  121. // Iterator types: http://python.org/doc/current/lib/typeiter.html
  122. '__iter__', 'next',
  123. // String types: http://python.org/doc/current/lib/string-methods.html
  124. 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
  125. 'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
  126. 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
  127. 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
  128. 'translate', 'upper', 'zfill',
  129. */
  130. // Basic customization: http://python.org/doc/current/ref/customization.html
  131. '__new__', '__init__', '__del__', '__repr__', '__str__',
  132. '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
  133. '__hash__', '__nonzero__', '__unicode__', '__dict__',
  134. // Attribute access: http://python.org/doc/current/ref/attribute-access.html
  135. '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
  136. '__delete__', '__slots__',
  137. // Class creation, callable objects
  138. '__metaclass__', '__call__',
  139. // Container types: http://python.org/doc/current/ref/sequence-types.html
  140. '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
  141. '__getslice__', '__setslice__', '__delslice__',
  142. // Numeric types: http://python.org/doc/current/ref/numeric-types.html
  143. '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
  144. '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
  145. '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
  146. '__long__','__lshift__',
  147. '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
  148. '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
  149. '__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',
  150. '__sub__','__xor__'
  151. )
  152.  
  153. ),
  154. 'SYMBOLS''(', ')', '[', ']', '{', '}', '*', '&', '%', '!', ';', '<', '>', '?', '`'
  155. ),
  156. 'CASE_SENSITIVE''STYLES''KEYWORDS''color: #ff7700;font-weight:bold;', // Reserved
  157. 2 => 'color: #008000;', // Built-ins + self
  158. 3 => 'color: #dc143c;', // Standard lib
  159. 4 => 'color: #0000cd;' // Special methods
  160. ),
  161. 'COMMENTS''color: #808080; font-style: italic;',
  162. 'MULTI' => 'color: #808080; font-style: italic;'
  163. ),
  164. 'ESCAPE_CHAR''color: #000099; font-weight: bold;'
  165. ),
  166. 'BRACKETS''color: black;'
  167. ),
  168. 'STRINGS''color: #483d8b;'
  169. ),
  170. 'NUMBERS''color: #ff4500;'
  171. ),
  172. 'METHODS''color: black;'
  173. ),
  174. 'SYMBOLS''color: #66cc66;'
  175. ),
  176. 'REGEXPS''SCRIPT''URLS''OOLANG''OBJECT_SPLITTERS''.'
  177. ),
  178. 'REGEXPS''STRICT_MODE_APPLIES''SCRIPT_DELIMITERS''HIGHLIGHT_STRICT_BLOCK'

Liste des projets

Téléchargez Codulle

Publié par Codulle - v0.1.1 - © Bubulles Creations