ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
HFile_python.php
Go to the documentation of this file.
1 <?php
2 
3 $BEAUT_PATH = realpath(".")."/Services/COPage/syntax_highlight/php";
4 if (!isset ($BEAUT_PATH)) return;
5 require_once("$BEAUT_PATH/Beautifier/HFile.php");
6  class HFile_python extends HFile{
7  function HFile_python(){
8  $this->HFile();
9 
10 /*************************************/
11 // Beautifier Highlighting Configuration File
12 // Python
13 /*************************************/
14 // Flags
15 
16 $this->nocase = "0";
17 $this->notrim = "1";
18 $this->perl = "0";
19 
20 // Colours
21 
22 $this->colours = array("blue", "purple", "gray", "brown", "blue", "purple", "gray");
23 $this->quotecolour = "blue";
24 $this->blockcommentcolour = "green";
25 $this->linecommentcolour = "green";
26 
27 // Indent Strings
28 
29 $this->indent = array();
30 $this->unindent = array();
31 
32 // String characters and delimiters
33 
34 $this->stringchars = array();
35 $this->delimiters = array("[", "]", "{", "}", "(", ")", "<", ">", "=", "\"", "'", ".", ",", ":", "+", " ", " ");
36 $this->escchar = "";
37 
38 // Comment settings
39 
40 $this->linecommenton = array("#");
41 $this->blockcommenton = array("");
42 $this->blockcommentoff = array("");
43 
44 // Keywords (keyword mapping to colour number)
45 
46 $this->keywords = array(
47  "and" => "1",
48  "assert" => "1",
49  "break" => "1",
50  "class" => "1",
51  "continue" => "1",
52  "def" => "1",
53  "del" => "1",
54  "elif" => "1",
55  "else" => "1",
56  "except" => "1",
57  "exec" => "1",
58  "finally" => "1",
59  "for" => "1",
60  "from" => "1",
61  "global" => "1",
62  "if" => "1",
63  "import" => "1",
64  "in" => "1",
65  "is" => "1",
66  "lambda" => "1",
67  "map" => "1",
68  "not" => "1",
69  "None" => "1",
70  "or" => "1",
71  "pass" => "1",
72  "print" => "1",
73  "raise" => "1",
74  "range" => "1",
75  "return" => "1",
76  "try" => "1",
77  "while" => "1",
78  "abs" => "2",
79  "apply" => "2",
80  "callable" => "2",
81  "chr" => "2",
82  "cmp" => "2",
83  "coerce" => "2",
84  "compile" => "2",
85  "complex" => "2",
86  "delattr" => "2",
87  "dir" => "2",
88  "divmod" => "2",
89  "eval" => "2",
90  "execfile" => "2",
91  "filter" => "2",
92  "float" => "2",
93  "getattr" => "2",
94  "globals" => "2",
95  "group" => "2",
96  "hasattr" => "2",
97  "hash" => "2",
98  "hex" => "2",
99  "id" => "2",
100  "input" => "2",
101  "int" => "2",
102  "intern" => "2",
103  "isinstance" => "2",
104  "issubclass" => "2",
105  "joinfields" => "2",
106  "len" => "2",
107  "list" => "2",
108  "local" => "2",
109  "long" => "2",
110  "max" => "2",
111  "min" => "2",
112  "match" => "2",
113  "oct" => "2",
114  "open" => "2",
115  "ord" => "2",
116  "pow" => "2",
117  "raw_input" => "2",
118  "reduce" => "2",
119  "reload" => "2",
120  "repr" => "2",
121  "round" => "2",
122  "search" => "2",
123  "setattr" => "2",
124  "slice" => "2",
125  "str" => "2",
126  "splitfields" => "2",
127  "tuple" => "2",
128  "type" => "2",
129  "vars" => "2",
130  "xrange" => "2",
131  "__import__" => "2",
132  "__abs__" => "3",
133  "__add__" => "3",
134  "__and__" => "3",
135  "__call__" => "3",
136  "__cmp__" => "3",
137  "__coerce__" => "3",
138  "__del__" => "3",
139  "__delattr__" => "3",
140  "__delitem__" => "3",
141  "__delslice__" => "3",
142  "__div__" => "3",
143  "__divmod__" => "3",
144  "__float__" => "3",
145  "__getattr__" => "3",
146  "__getitem__" => "3",
147  "__getslice__" => "3",
148  "__hash__" => "3",
149  "__hex__" => "3",
150  "__invert__" => "3",
151  "__int__" => "3",
152  "__init__" => "3",
153  "__len__" => "3",
154  "__long__" => "3",
155  "__lshift__" => "3",
156  "__mod__" => "3",
157  "__mul__" => "3",
158  "__neg__" => "3",
159  "__nonzero__" => "3",
160  "__oct__" => "3",
161  "__or__" => "3",
162  "__pos__" => "3",
163  "__pow__" => "3",
164  "__radd__" => "3",
165  "__rdiv__" => "3",
166  "__rdivmod__" => "3",
167  "__rmod__" => "3",
168  "__rpow__" => "3",
169  "__rlshift__" => "3",
170  "__rrshift__" => "3",
171  "__rshift__" => "3",
172  "__rsub__" => "3",
173  "__rmul__" => "3",
174  "__repr__" => "3",
175  "__rand__" => "3",
176  "__rxor__" => "3",
177  "__ror__" => "3",
178  "__setattr__" => "3",
179  "__setitem__" => "3",
180  "__setslice__" => "3",
181  "__str__" => "3",
182  "__sub__" => "3",
183  "__xor__" => "3",
184  "__bases__" => "4",
185  "__class__" => "4",
186  "__dict__" => "4",
187  "__methods__" => "4",
188  "__members__" => "4",
189  "__name__" => "4",
190  "__version__" => "4",
191  "ArithmeticError" => "5",
192  "AssertionError" => "5",
193  "AttributeError" => "5",
194  "EOFError" => "5",
195  "Exception" => "5",
196  "FloatingPointError" => "5",
197  "IOError" => "5",
198  "ImportError" => "5",
199  "IndexError" => "5",
200  "KeyError" => "5",
201  "KeyboardInterrupt" => "5",
202  "LookupError" => "5",
203  "MemoryError" => "5",
204  "NameError" => "5",
205  "OverflowError" => "5",
206  "RuntimeError" => "5",
207  "StandardError" => "5",
208  "SyntaxError" => "5",
209  "SystemError" => "5",
210  "SystemExit" => "5",
211  "TypeError" => "5",
212  "ValueError" => "5",
213  "ZeroDivisionError" => "5",
214  "AST" => "6",
215  "BaseHTTPServer" => "6",
216  "Bastion" => "6",
217  "cmd" => "6",
218  "commands" => "6",
219  "compileall" => "6",
220  "copy" => "6",
221  "CGIHTTPServer" => "6",
222  "Complex" => "6",
223  "dbhash" => "6",
224  "dircmp" => "6",
225  "dis" => "6",
226  "dospath" => "6",
227  "dumbdbm" => "6",
228  "emacs" => "6",
229  "find" => "6",
230  "fmt" => "6",
231  "fnmatch" => "7",
232  "ftplib" => "6",
233  "getopt" => "6",
234  "glob" => "6",
235  "gopherlib" => "6",
236  "grep" => "6",
237  "htmllib" => "6",
238  "httplib" => "6",
239  "ihooks" => "6",
240  "imghdr" => "6",
241  "linecache" => "6",
242  "lockfile" => "6",
243  "macpath" => "6",
244  "macurl2path" => "6",
245  "mailbox" => "6",
246  "mailcap" => "6",
247  "mimetools" => "6",
248  "mimify" => "6",
249  "mutex" => "6",
250  "math" => "6",
251  "Mimewriter" => "6",
252  "newdir" => "6",
253  "ni" => "6",
254  "nntplib" => "6",
255  "ntpath" => "6",
256  "nturl2path" => "6",
257  "os" => "6",
258  "ospath" => "6",
259  "pdb" => "6",
260  "pickle" => "6",
261  "pipes" => "6",
262  "poly" => "6",
263  "popen2" => "6",
264  "posixfile" => "6",
265  "posixpath" => "6",
266  "profile" => "6",
267  "pstats" => "6",
268  "pyclbr" => "6",
269  "Para" => "6",
270  "quopri" => "6",
271  "Queue" => "6",
272  "rand" => "6",
273  "random" => "6",
274  "regex" => "6",
275  "regsub" => "6",
276  "rfc822" => "6",
277  "sched" => "6",
278  "sgmllib" => "6",
279  "shelve" => "6",
280  "site" => "6",
281  "sndhdr" => "6",
282  "string" => "6",
283  "sys" => "6",
284  "snmp" => "6",
285  "SimpleHTTPServer" => "6",
286  "StringIO" => "6",
287  "SocketServer" => "6",
288  "tb" => "6",
289  "tempfile" => "6",
290  "toaiff" => "6",
291  "token" => "6",
292  "tokenize" => "6",
293  "traceback" => "6",
294  "tty" => "6",
295  "types" => "6",
296  "tzparse" => "6",
297  "Tkinter" => "6",
298  "urllib" => "6",
299  "urlparse" => "6",
300  "util" => "6",
301  "uu" => "6",
302  "UserDict" => "6",
303  "UserList" => "6",
304  "wave" => "6",
305  "whatsound" => "6",
306  "whichdb" => "6",
307  "whrandom" => "6",
308  "xdrlib" => "6",
309  "zmod" => "6",
310  "array" => "7",
311  "struct" => "7",
312  "self" => "7");
313 
314 // Special extensions
315 
316 // Each category can specify a PHP function that returns an altered
317 // version of the keyword.
318 
319 
320 
321 $this->linkscripts = array(
322  "1" => "donothing",
323  "2" => "donothing",
324  "3" => "donothing",
325  "4" => "donothing",
326  "5" => "donothing",
327  "6" => "donothing",
328  "7" => "donothing");
329 
330 }
331 
332 
333 
334 function donothing($keywordin)
335 {
336  return $keywordin;
337 }
338 
339 }
340 
341 ?>