2bcf81a62750f68c4b08b685dae1a8bc99503318
[sfa.git] / server / jpywork / stat.java
1 import org.python.core.*;
2
3 public class stat 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 i$1;
11         private static PyObject i$2;
12         private static PyObject i$3;
13         private static PyObject i$4;
14         private static PyObject i$5;
15         private static PyObject i$6;
16         private static PyObject i$7;
17         private static PyObject i$8;
18         private static PyObject i$9;
19         private static PyObject i$10;
20         private static PyObject i$11;
21         private static PyObject i$12;
22         private static PyObject i$13;
23         private static PyObject i$14;
24         private static PyObject i$15;
25         private static PyObject i$16;
26         private static PyObject i$17;
27         private static PyObject i$18;
28         private static PyObject i$19;
29         private static PyObject i$20;
30         private static PyObject i$21;
31         private static PyObject i$22;
32         private static PyObject i$23;
33         private static PyObject i$24;
34         private static PyObject i$25;
35         private static PyObject i$26;
36         private static PyObject i$27;
37         private static PyObject i$28;
38         private static PyObject i$29;
39         private static PyObject s$30;
40         private static PyFunctionTable funcTable;
41         private static PyCode c$0_S_IMODE;
42         private static PyCode c$1_S_IFMT;
43         private static PyCode c$2_S_ISDIR;
44         private static PyCode c$3_S_ISCHR;
45         private static PyCode c$4_S_ISBLK;
46         private static PyCode c$5_S_ISREG;
47         private static PyCode c$6_S_ISFIFO;
48         private static PyCode c$7_S_ISLNK;
49         private static PyCode c$8_S_ISSOCK;
50         private static PyCode c$9_main;
51         private static void initConstants() {
52             s$0 = Py.newString("Constants/functions for interpreting results of os.stat() and os.lstat().\012\012Suggested usage: from stat import *\012");
53             i$1 = Py.newInteger(0);
54             i$2 = Py.newInteger(1);
55             i$3 = Py.newInteger(2);
56             i$4 = Py.newInteger(3);
57             i$5 = Py.newInteger(4);
58             i$6 = Py.newInteger(5);
59             i$7 = Py.newInteger(6);
60             i$8 = Py.newInteger(7);
61             i$9 = Py.newInteger(8);
62             i$10 = Py.newInteger(9);
63             i$11 = Py.newInteger(4095);
64             i$12 = Py.newInteger(61440);
65             i$13 = Py.newInteger(16384);
66             i$14 = Py.newInteger(8192);
67             i$15 = Py.newInteger(24576);
68             i$16 = Py.newInteger(32768);
69             i$17 = Py.newInteger(4096);
70             i$18 = Py.newInteger(40960);
71             i$19 = Py.newInteger(49152);
72             i$20 = Py.newInteger(2048);
73             i$21 = Py.newInteger(1024);
74             i$22 = Py.newInteger(512);
75             i$23 = Py.newInteger(256);
76             i$24 = Py.newInteger(128);
77             i$25 = Py.newInteger(64);
78             i$26 = Py.newInteger(448);
79             i$27 = Py.newInteger(56);
80             i$28 = Py.newInteger(32);
81             i$29 = Py.newInteger(16);
82             s$30 = Py.newString("/usr/share/jython/Lib-cpython/stat.py");
83             funcTable = new _PyInner();
84             c$0_S_IMODE = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_IMODE", false, false, funcTable, 0, null, null, 0, 1);
85             c$1_S_IFMT = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_IFMT", false, false, funcTable, 1, null, null, 0, 1);
86             c$2_S_ISDIR = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_ISDIR", false, false, funcTable, 2, null, null, 0, 1);
87             c$3_S_ISCHR = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_ISCHR", false, false, funcTable, 3, null, null, 0, 1);
88             c$4_S_ISBLK = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_ISBLK", false, false, funcTable, 4, null, null, 0, 1);
89             c$5_S_ISREG = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_ISREG", false, false, funcTable, 5, null, null, 0, 1);
90             c$6_S_ISFIFO = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_ISFIFO", false, false, funcTable, 6, null, null, 0, 1);
91             c$7_S_ISLNK = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_ISLNK", false, false, funcTable, 7, null, null, 0, 1);
92             c$8_S_ISSOCK = Py.newCode(1, new String[] {"mode"}, "/usr/share/jython/Lib-cpython/stat.py", "S_ISSOCK", false, false, funcTable, 8, null, null, 0, 1);
93             c$9_main = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib-cpython/stat.py", "main", false, false, funcTable, 9, null, null, 0, 0);
94         }
95         
96         
97         public PyCode getMain() {
98             if (c$9_main == null) _PyInner.initConstants();
99             return c$9_main;
100         }
101         
102         public PyObject call_function(int index, PyFrame frame) {
103             switch (index){
104                 case 0:
105                 return _PyInner.S_IMODE$1(frame);
106                 case 1:
107                 return _PyInner.S_IFMT$2(frame);
108                 case 2:
109                 return _PyInner.S_ISDIR$3(frame);
110                 case 3:
111                 return _PyInner.S_ISCHR$4(frame);
112                 case 4:
113                 return _PyInner.S_ISBLK$5(frame);
114                 case 5:
115                 return _PyInner.S_ISREG$6(frame);
116                 case 6:
117                 return _PyInner.S_ISFIFO$7(frame);
118                 case 7:
119                 return _PyInner.S_ISLNK$8(frame);
120                 case 8:
121                 return _PyInner.S_ISSOCK$9(frame);
122                 case 9:
123                 return _PyInner.main$10(frame);
124                 default:
125                 return null;
126             }
127         }
128         
129         private static PyObject S_IMODE$1(PyFrame frame) {
130             return frame.getlocal(0)._and(i$11);
131         }
132         
133         private static PyObject S_IFMT$2(PyFrame frame) {
134             return frame.getlocal(0)._and(i$12);
135         }
136         
137         private static PyObject S_ISDIR$3(PyFrame frame) {
138             return frame.getglobal("S_IFMT").__call__(frame.getlocal(0))._eq(frame.getglobal("S_IFDIR"));
139         }
140         
141         private static PyObject S_ISCHR$4(PyFrame frame) {
142             return frame.getglobal("S_IFMT").__call__(frame.getlocal(0))._eq(frame.getglobal("S_IFCHR"));
143         }
144         
145         private static PyObject S_ISBLK$5(PyFrame frame) {
146             return frame.getglobal("S_IFMT").__call__(frame.getlocal(0))._eq(frame.getglobal("S_IFBLK"));
147         }
148         
149         private static PyObject S_ISREG$6(PyFrame frame) {
150             return frame.getglobal("S_IFMT").__call__(frame.getlocal(0))._eq(frame.getglobal("S_IFREG"));
151         }
152         
153         private static PyObject S_ISFIFO$7(PyFrame frame) {
154             return frame.getglobal("S_IFMT").__call__(frame.getlocal(0))._eq(frame.getglobal("S_IFIFO"));
155         }
156         
157         private static PyObject S_ISLNK$8(PyFrame frame) {
158             return frame.getglobal("S_IFMT").__call__(frame.getlocal(0))._eq(frame.getglobal("S_IFLNK"));
159         }
160         
161         private static PyObject S_ISSOCK$9(PyFrame frame) {
162             return frame.getglobal("S_IFMT").__call__(frame.getlocal(0))._eq(frame.getglobal("S_IFSOCK"));
163         }
164         
165         private static PyObject main$10(PyFrame frame) {
166             frame.setglobal("__file__", s$30);
167             
168             /* Constants/functions for interpreting results of os.stat() and os.lstat().
169             
170             Suggested usage: from stat import *
171              */
172             frame.setlocal("ST_MODE", i$1);
173             frame.setlocal("ST_INO", i$2);
174             frame.setlocal("ST_DEV", i$3);
175             frame.setlocal("ST_NLINK", i$4);
176             frame.setlocal("ST_UID", i$5);
177             frame.setlocal("ST_GID", i$6);
178             frame.setlocal("ST_SIZE", i$7);
179             frame.setlocal("ST_ATIME", i$8);
180             frame.setlocal("ST_MTIME", i$9);
181             frame.setlocal("ST_CTIME", i$10);
182             frame.setlocal("S_IMODE", new PyFunction(frame.f_globals, new PyObject[] {}, c$0_S_IMODE));
183             frame.setlocal("S_IFMT", new PyFunction(frame.f_globals, new PyObject[] {}, c$1_S_IFMT));
184             frame.setlocal("S_IFDIR", i$13);
185             frame.setlocal("S_IFCHR", i$14);
186             frame.setlocal("S_IFBLK", i$15);
187             frame.setlocal("S_IFREG", i$16);
188             frame.setlocal("S_IFIFO", i$17);
189             frame.setlocal("S_IFLNK", i$18);
190             frame.setlocal("S_IFSOCK", i$19);
191             frame.setlocal("S_ISDIR", new PyFunction(frame.f_globals, new PyObject[] {}, c$2_S_ISDIR));
192             frame.setlocal("S_ISCHR", new PyFunction(frame.f_globals, new PyObject[] {}, c$3_S_ISCHR));
193             frame.setlocal("S_ISBLK", new PyFunction(frame.f_globals, new PyObject[] {}, c$4_S_ISBLK));
194             frame.setlocal("S_ISREG", new PyFunction(frame.f_globals, new PyObject[] {}, c$5_S_ISREG));
195             frame.setlocal("S_ISFIFO", new PyFunction(frame.f_globals, new PyObject[] {}, c$6_S_ISFIFO));
196             frame.setlocal("S_ISLNK", new PyFunction(frame.f_globals, new PyObject[] {}, c$7_S_ISLNK));
197             frame.setlocal("S_ISSOCK", new PyFunction(frame.f_globals, new PyObject[] {}, c$8_S_ISSOCK));
198             frame.setlocal("S_ISUID", i$20);
199             frame.setlocal("S_ISGID", i$21);
200             frame.setlocal("S_ENFMT", frame.getname("S_ISGID"));
201             frame.setlocal("S_ISVTX", i$22);
202             frame.setlocal("S_IREAD", i$23);
203             frame.setlocal("S_IWRITE", i$24);
204             frame.setlocal("S_IEXEC", i$25);
205             frame.setlocal("S_IRWXU", i$26);
206             frame.setlocal("S_IRUSR", i$23);
207             frame.setlocal("S_IWUSR", i$24);
208             frame.setlocal("S_IXUSR", i$25);
209             frame.setlocal("S_IRWXG", i$27);
210             frame.setlocal("S_IRGRP", i$28);
211             frame.setlocal("S_IWGRP", i$29);
212             frame.setlocal("S_IXGRP", i$9);
213             frame.setlocal("S_IRWXO", i$8);
214             frame.setlocal("S_IROTH", i$5);
215             frame.setlocal("S_IWOTH", i$3);
216             frame.setlocal("S_IXOTH", i$2);
217             return Py.None;
218         }
219         
220     }
221     public static void moduleDictInit(PyObject dict) {
222         dict.__setitem__("__name__", new PyString("stat"));
223         Py.runCode(new _PyInner().getMain(), dict, dict);
224     }
225     
226     public static void main(String[] args) throws java.lang.Exception {
227         String[] newargs = new String[args.length+1];
228         newargs[0] = "stat";
229         System.arraycopy(args, 0, newargs, 1, args.length);
230         Py.runMain(stat._PyInner.class, newargs, stat.jpy$packages, stat.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"});
231     }
232     
233 }