Enkodowanie nazw plików do UTF-8 przed przekazaniem ich do localrepo.commit. Powinno...
[redakcja.git] / project / static / js / reg_syntax / python.js
1 /**\r
2  * Python syntax v 1.1 \r
3  * \r
4  * v1.1 by Andre Roberge (2006/12/27)\r
5  *   \r
6 **/\r
7 editAreaLoader.load_syntax["python"] = {\r
8         'COMMENT_SINGLE' : {1 : '#'}\r
9         ,'COMMENT_MULTI' : {}\r
10         ,'QUOTEMARKS' : {1: "'", 2: '"'}\r
11         ,'KEYWORD_CASE_SENSITIVE' : true\r
12         ,'KEYWORDS' : {\r
13                 /*\r
14                 ** Set 1: reserved words\r
15                 ** http://python.org/doc/current/ref/keywords.html\r
16                 ** Note: 'as' and 'with' have been added starting with Python 2.5\r
17                 */\r
18                 'reserved' : [\r
19                         'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',\r
20                         'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', \r
21                         'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise',\r
22                         'return', 'try', 'while', 'with', 'yield'\r
23                         //the following are *almost* reserved; we'll treat them as such\r
24                         , 'False', 'True', 'None'\r
25                 ]\r
26                 /*\r
27                 ** Set 2: builtins\r
28                 ** http://python.org/doc/current/lib/built-in-funcs.html\r
29                 */      \r
30                 ,'builtins' : [\r
31                         '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp', \r
32                         'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', \r
33                         'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',\r
34                         'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',\r
35                         'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',\r
36                         'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',\r
37                         'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', \r
38                         'vars', 'xrange', 'zip',\r
39                         // Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html\r
40                         //'False', 'True', 'None' have been included in 'reserved'\r
41                         'NotImplemented', 'Ellipsis',\r
42                         // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html\r
43                         'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',\r
44                         'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',\r
45                         'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',\r
46                         'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',\r
47                         'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',\r
48                         'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',\r
49                         'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',\r
50                         'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',\r
51                         'RuntimeWarning', 'FutureWarning',              \r
52                         // we will include the string methods as well\r
53                         // http://python.org/doc/current/lib/string-methods.html\r
54                         'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',\r
55                         'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',\r
56                         'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',\r
57                         'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',\r
58                         'translate', 'upper', 'zfill'\r
59                 ]\r
60                 /*\r
61                 ** Set 3: standard library\r
62                 ** http://python.org/doc/current/lib/modindex.html\r
63                 */\r
64                 ,'stdlib' : [\r
65                         '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',\r
66                         'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',\r
67                         'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',\r
68                         'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',\r
69                         'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',\r
70                         'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',\r
71                         'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',\r
72                         'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',\r
73                         'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',\r
74                         'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',\r
75                         'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',\r
76                         'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',\r
77                         'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',\r
78                         'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',\r
79                         'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',\r
80                         'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',\r
81                         'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',\r
82                         'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',\r
83                         'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',\r
84                         're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',\r
85                         'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',\r
86                         'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',\r
87                         'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',\r
88                         'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',\r
89                         'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',\r
90                         'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',\r
91                         'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',\r
92                         'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',\r
93                         'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',\r
94                         'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'\r
95 \r
96                 ]\r
97                 /*\r
98                 ** Set 4: special methods\r
99                 ** http://python.org/doc/current/ref/specialnames.html\r
100                 */\r
101                 ,'special' : [\r
102                         // Basic customization: http://python.org/doc/current/ref/customization.html\r
103                         '__new__', '__init__', '__del__', '__repr__', '__str__', \r
104                         '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',\r
105                         '__hash__', '__nonzero__', '__unicode__', '__dict__',\r
106                         // Attribute access: http://python.org/doc/current/ref/attribute-access.html\r
107                         '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',\r
108                         '__delete__', '__slots__',\r
109                         // Class creation, callable objects\r
110                         '__metaclass__', '__call__', \r
111                         // Container types: http://python.org/doc/current/ref/sequence-types.html\r
112                         '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',\r
113                         '__getslice__', '__setslice__', '__delslice__',\r
114                         // Numeric types: http://python.org/doc/current/ref/numeric-types.html\r
115                         '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',\r
116                         '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',\r
117                         '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',\r
118                         '__long__','__lshift__',\r
119                         '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',\r
120                         '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',\r
121                         '__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',\r
122                         '__sub__','__xor__'\r
123                 ]\r
124         }\r
125         ,'OPERATORS' :[\r
126                 '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','\r
127         ]\r
128         ,'DELIMITERS' :[\r
129                 '(', ')', '[', ']', '{', '}'\r
130         ]\r
131         ,'STYLES' : {\r
132                 'COMMENTS': 'color: #AAAAAA;'\r
133                 ,'QUOTESMARKS': 'color: #660066;'\r
134                 ,'KEYWORDS' : {\r
135                         'reserved' : 'color: #0000FF;'\r
136                         ,'builtins' : 'color: #009900;'\r
137                         ,'stdlib' : 'color: #009900;'\r
138                         ,'special': 'color: #006666;'\r
139                         }\r
140                 ,'OPERATORS' : 'color: #993300;'\r
141                 ,'DELIMITERS' : 'color: #993300;'\r
142                                 \r
143         }\r
144 };\r