1<?php 2/************************************************************************************** 3 * pys60.php 4 * ---------- 5 * Author: Sohan Basak (ronnie.basak96 @gmail.com) 6 * Copyright: (c) 2012 Sohan Basak (http://tothepower.tk), Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter) 7 * Release Version: 1.0.9.1 8 * Date Started: 2012/05/03 9 * 10 * Python for S60 language file for GeSHi. 11 * 12 * CHANGES 13 * ------- 14 * No Changes Till Date 15 * 16 * The python.php file is extended to pys60.php with required modifications 17 * 18 * NOTES 19 * 20 * -I have kept the ":" in Reserved chars, so that it gets highlighted differently than brackets and/or symbols 21 * 22 ************************************************************************************* 23 * 24 * This file is part of GeSHi. 25 * 26 * GeSHi is free software; you can redistribute it and/or modify 27 * it under the terms of the GNU General Public License as published by 28 * the Free Software Foundation; either version 2 of the License, or 29 * (at your option) any later version. 30 * 31 * GeSHi is distributed in the hope that it will be useful, 32 * but WITHOUT ANY WARRANTY; without even the implied warranty of 33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 34 * GNU General Public License for more details. 35 * 36 * You should have received a copy of the GNU General Public License 37 * along with GeSHi; if not, write to the Free Software 38 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 39 * 40 ************************************************************************************/ 41 42$language_data = array ( 43 'LANG_NAME' => 'Python for S60', 44 'COMMENT_SINGLE' => array(1 => '#'), 45 'COMMENT_MULTI' => array(), 46 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 47 'QUOTEMARKS' => array('"', "'", '"""',"'''",'""','""'), 48 'ESCAPE_CHAR' => '\\', 49 'KEYWORDS' => array( 50 51 /* 52 ** Set 1: reserved words 53 ** http://python.org/doc/current/ref/keywords.html 54 */ 55 1 => array( 56 'and', 'del', 'for', 'is', 'raise', 'assert', 'elif', 'from', 'lambda', 'return', 'break', 57 'else', 'global', 'not', 'try', 'class', 'except', 'if', 'or', 'while', 'continue', 'exec', 58 'import', 'pass', 'yield', 'def', 'finally', 'in', 'print', "<<", ">>", "as" 59 ), 60 61 /* 62 ** Set 2: builtins 63 ** http://python.org/doc/current/lib/built-in-funcs.html 64 */ 65 2 => array( 66 '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp', 67 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', 68 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 69 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals', 70 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range', 71 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 72 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', 73 'vars', 'xrange', 'zip', 74 // Built-in constants: http://python.org/doc/current/lib/node35.html 75 'False', 'True', 'None', 'NotImplemented', 'Ellipsis', 76 // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html 77 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError', 78 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError', 79 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError', 80 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError', 81 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError', 82 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError', 83 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning', 84 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning', 85 'RuntimeWarning', 'FutureWarning', 86 //Symbian Errors 87 "SymbianError", "KernelError", 88 // self: this is a common python convention (but not a reserved word) 89 'self' 90 ), 91 92 /* 93 ** Set 3: standard library 94 ** http://python.org/doc/current/lib/modindex.html 95 */ 96 3 => array( 97 '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm', 98 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer', 99 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi', 100 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop', 101 'collections', 'colorsys', 'commands', 'compileall', 'compiler', 102 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt', 103 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE', 104 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm', 105 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl', 106 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl', 107 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob', 108 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib', 109 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect', 110 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap', 111 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify', 112 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator', 113 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes', 114 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile', 115 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random', 116 're', 'readline', 'resource', 'rexec', 'rgbimg', 'rlcompleter', 117 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve', 118 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd', 119 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string', 120 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev', 121 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', 122 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token', 123 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2', 124 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings', 125 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml', 126 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib', "os.path", "sys.path", 127 128 //PythonS60 Standard Library 129 //http://pys60.garage.maemo.org/doc/s60/ 130 //These are the standard modules in the archive 131 132 "appuifw", "globalui","e32", "telephone", "aosocket", "btsocket", 133 "sysinfo","camera","graphics","keycapture","key_codes","topwindow", "gles", 134 "glcanvas","sensor", "audio","messaging", "inbox","location","positioning", 135 "contacts", "e32calendar", "e32db","e32dbm","logs","scriptext", 136 "series60_console", 137 138 //These are external but very often usable modules 139 140 "appuifw2","ArchetypeUI","elementtree","lightblue", 141 "activaprofile","Adjustor","akntextutils","aosocketnativenew", 142 "appreciation","applicationmanager","appswitch","atextit","bt_teror","btconsole", 143 "btswitch","cElementTree","cenrep","cerealizer","cl_gui","clipboard", 144 "clipboard_CHN","debugger","decompile2", 145 "dir_iter","download","easydb","ECenrep","Edit_find","efeature","elocation","envy", 146 "EProfile","erestart","error","esyagent","Execwap","exprofile","fastcamera", 147 "feature","fgimage","filebrowser","firmware","fold","fonts","fraction","FTP", 148 "ftplibnew","fy_manager","fy_menu","gles_utils","gps_location","hack", 149 "HTML2TXT","iapconnect","icon_image","image_decoder", 150 "ini","interactive_console","inting","key_modifiers","key_tricks","keypress", 151 "landmarks","lite_fm","locationacq","locationrequestor", 152 "logo","markupbase","mbm","mbm2","minidb","miniinfo","MISC", 153 "misty","Msg","ntpath","odict","Paintbox","pathinfo","pexif","pickcolor", 154 "powlite_fm","powlite_fm2","powlite_fm3","powlite_fme","prgbar","prodb", 155 "profileengine","progressbar","progressbartw","progressnotes", 156 "ProgressBarTW2","proshivka","py_upload","pyConnection","PyFileMan", 157 "pykeylock","PyPyc","pyqq","pys60crypto","pys60usb","rfc822", 158 "RUSOS","scmk","scrollpage","SISFIELDS","SISFIELD","sisfile", 159 "SISINFO","sisreader","Sistools","smidi","smsreject","speechy","sre_compile", 160 "sre_constants","sre_parse","sre","sysagent","syslang","TextMan", 161 "textrenderer","TextWrap","topwind","tsocket","uikludge","uikludges","uitricks", 162 "walkfile","wallpaper","wfm_lite", 163 "wif_keys","wif","window","wlanmgmt","wlantools","wt_color","wt_requesters", 164 "zhkey", 165 166 //These are recent additions 167 "miffile" 168 ), 169 170 /* 171 ** Set 4: special methods 172 ** http://python.org/doc/current/ref/specialnames.html 173 */ 174 4 => array( 175 ///* 176 //// Iterator types: http://python.org/doc/current/lib/typeiter.html 177 //'__iter__', 'next', 178 //// String types: http://python.org/doc/current/lib/string-methods.html 179 //'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 180 //'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 181 //'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', 182 //'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 183 //'translate', 'upper', 'zfill', 184 // */ 185 186 // Basic customization: http://python.org/doc/current/ref/customization.html 187 '__new__', '__init__', '__del__', '__repr__', '__str__', 188 '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__', 189 '__hash__', '__nonzero__', '__unicode__', '__dict__', 190 // Attribute access: http://python.org/doc/current/ref/attribute-access.html 191 '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__', 192 '__delete__', '__slots__', 193 // Class creation, callable objects 194 '__metaclass__', '__call__', 195 // Container types: http://python.org/doc/current/ref/sequence-types.html 196 '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__', 197 '__getslice__', '__setslice__', '__delslice__', 198 // Numeric types: http://python.org/doc/current/ref/numeric-types.html 199 '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__', 200 '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__', 201 '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__', 202 '__long__','__lshift__', 203 '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__', 204 '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__', 205 '__rshift__','__rsub__','__rmul__','__rand__','__rxor__','__ror__', 206 '__sub__','__xor__' 207 ) 208 209 ), 210 'SYMBOLS' => array( 211 '(', ')', '[', ']', '{', '}', '*', '&', '%', '!', ';', '<', '>', '?', '`' 212 ), 213 'CASE_SENSITIVE' => array( 214 GESHI_COMMENTS => true, 215 1 => true, 216 2 => true, 217 3 => true, 218 4 => true 219 ), 220 'STYLES' => array( 221 'KEYWORDS' => array( 222 1 => 'color: #006000;font-weight:bold;', // Reserved 223 2 => 'color: #800950;font-size:105%', // Built-ins + self 224 3 => 'color: #003399;font-size:106%', // Standard lib 225 4 => 'color: #0000cd;' // Special methods 226 ), 227 'COMMENTS' => array( 228 1 => 'color: #808080; font-style:italic;font-size:92%', 229 'MULTI' => 'color: #808080; font-style: italic;' 230 ), 231 'ESCAPE_CHAR' => array( 232 0 => 'color: #930; font-weight: bold;font-size:105%' 233 ), 234 'BRACKETS' => array( 235 0 => 'color: maroon;font-size:102%;padding:2px' 236 ), 237 'STRINGS' => array( 238 0 => 'color: #666;' 239 ), 240 'NUMBERS' => array( 241 0 => 'color: #2356F8;' 242 ), 243 'METHODS' => array( 244 1 => 'color: navy;' 245 ), 246 'SYMBOLS' => array( 247 0 => 'color: #66ccFF;' 248 ), 249 'REGEXPS' => array( 250 ), 251 'SCRIPT' => array( 252 ) 253 ), 254 'URLS' => array( 255 1 => '', 256 2 => '', 257 3 => '', 258 4 => '' 259 ), 260 'OOLANG' => true, 261 'OBJECT_SPLITTERS' => array( 262 1 => '.' 263 ), 264 'REGEXPS' => array( 265 ), 266 'STRICT_MODE_APPLIES' => GESHI_NEVER, 267 'SCRIPT_DELIMITERS' => array( 268 ), 269 'HIGHLIGHT_STRICT_BLOCK' => array( 270 ) 271); 272