f1377fa96486579d0210c444dd31c20195b2d998
[sfa.git] / server / jpywork / re.java
1 import org.python.core.*;
2
3 public class re extends java.lang.Object {
4     static String[] jpy$mainProperties = new String[] {"python.modules.builtin", "exceptions:org.python.core.exceptions"};
5     static String[] jpy$proxyProperties = new String[] {"python.modules.builtin", "exceptions:org.python.core.exceptions", "python.options.showJavaExceptions", "true"};
6     static String[] jpy$packages = new String[] {"java.net", null, "java.lang", null, "org.python.core", null, "java.io", null, "java.util.zip", null};
7     
8     public static class _PyInner extends PyFunctionTable implements PyRunnable {
9         private static PyObject s$0;
10         private static PyObject s$1;
11         private static PyObject s$2;
12         private static PyObject s$3;
13         private static PyObject s$4;
14         private static PyObject s$5;
15         private static PyObject s$6;
16         private static PyObject s$7;
17         private static PyObject s$8;
18         private static PyObject s$9;
19         private static PyObject s$10;
20         private static PyObject s$11;
21         private static PyObject s$12;
22         private static PyObject s$13;
23         private static PyObject s$14;
24         private static PyObject s$15;
25         private static PyObject s$16;
26         private static PyObject s$17;
27         private static PyObject s$18;
28         private static PyObject s$19;
29         private static PyObject s$20;
30         private static PyObject s$21;
31         private static PyObject s$22;
32         private static PyObject s$23;
33         private static PyObject s$24;
34         private static PyFunctionTable funcTable;
35         private static PyCode c$0_main;
36         private static void initConstants() {
37             s$0 = Py.newString("match");
38             s$1 = Py.newString("search");
39             s$2 = Py.newString("sub");
40             s$3 = Py.newString("subn");
41             s$4 = Py.newString("split");
42             s$5 = Py.newString("findall");
43             s$6 = Py.newString("compile");
44             s$7 = Py.newString("purge");
45             s$8 = Py.newString("template");
46             s$9 = Py.newString("escape");
47             s$10 = Py.newString("I");
48             s$11 = Py.newString("L");
49             s$12 = Py.newString("M");
50             s$13 = Py.newString("S");
51             s$14 = Py.newString("X");
52             s$15 = Py.newString("U");
53             s$16 = Py.newString("IGNORECASE");
54             s$17 = Py.newString("LOCALE");
55             s$18 = Py.newString("MULTILINE");
56             s$19 = Py.newString("DOTALL");
57             s$20 = Py.newString("VERBOSE");
58             s$21 = Py.newString("UNICODE");
59             s$22 = Py.newString("error");
60             s$23 = Py.newString("re");
61             s$24 = Py.newString("/usr/share/jython/Lib/re.py");
62             funcTable = new _PyInner();
63             c$0_main = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib/re.py", "main", false, false, funcTable, 0, null, null, 0, 0);
64         }
65         
66         
67         public PyCode getMain() {
68             if (c$0_main == null) _PyInner.initConstants();
69             return c$0_main;
70         }
71         
72         public PyObject call_function(int index, PyFrame frame) {
73             switch (index){
74                 case 0:
75                 return _PyInner.main$1(frame);
76                 default:
77                 return null;
78             }
79         }
80         
81         private static PyObject main$1(PyFrame frame) {
82             frame.setglobal("__file__", s$24);
83             
84             // Temporary Variables
85             int t$0$int;
86             PyObject t$0$PyObject, t$1$PyObject;
87             
88             // Code
89             frame.setlocal("__all__", new PyList(new PyObject[] {s$0, s$1, s$2, s$3, s$4, s$5, s$6, s$7, s$8, s$9, s$10, s$11, s$12, s$13, s$14, s$15, s$16, s$17, s$18, s$19, s$20, s$21, s$22}));
90             frame.setlocal("sre", org.python.core.imp.importOne("sre", frame));
91             frame.setlocal("sys", org.python.core.imp.importOne("sys", frame));
92             frame.setlocal("module", frame.getname("sys").__getattr__("modules").__getitem__(s$23));
93             t$0$int = 0;
94             t$1$PyObject = frame.getname("__all__");
95             while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
96                 frame.setlocal("name", t$0$PyObject);
97                 frame.getname("setattr").__call__(frame.getname("module"), frame.getname("name"), frame.getname("getattr").__call__(frame.getname("sre"), frame.getname("name")));
98             }
99             return Py.None;
100         }
101         
102     }
103     public static void moduleDictInit(PyObject dict) {
104         dict.__setitem__("__name__", new PyString("re"));
105         Py.runCode(new _PyInner().getMain(), dict, dict);
106     }
107     
108     public static void main(String[] args) throws java.lang.Exception {
109         String[] newargs = new String[args.length+1];
110         newargs[0] = "re";
111         System.arraycopy(args, 0, newargs, 1, args.length);
112         Py.runMain(re._PyInner.class, newargs, re.jpy$packages, re.jpy$mainProperties, "", new String[] {"string", "random", "util", "traceback", "sre_compile", "atexit", "sre", "sre_constants", "StringIO", "javaos", "socket", "yapm", "calendar", "repr", "copy_reg", "SocketServer", "server", "re", "linecache", "javapath", "UserDict", "copy", "threading", "stat", "PathVFS", "sre_parse"});
113     }
114     
115 }