1 import org.python.core.*;
3 public class javaos 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};
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 i$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 PyObject f$25;
35 private static PyObject s$26;
36 private static PyObject i$27;
37 private static PyObject s$28;
38 private static PyObject s$29;
39 private static PyObject s$30;
40 private static PyObject s$31;
41 private static PyObject s$32;
42 private static PyObject s$33;
43 private static PyObject s$34;
44 private static PyObject s$35;
45 private static PyObject s$36;
46 private static PyObject s$37;
47 private static PyObject s$38;
48 private static PyObject s$39;
49 private static PyObject s$40;
50 private static PyObject s$41;
51 private static PyObject s$42;
52 private static PyObject s$43;
53 private static PyObject s$44;
54 private static PyObject s$45;
55 private static PyObject s$46;
56 private static PyObject s$47;
57 private static PyObject s$48;
58 private static PyObject s$49;
59 private static PyObject s$50;
60 private static PyObject s$51;
61 private static PyObject s$52;
62 private static PyObject s$53;
63 private static PyObject s$54;
64 private static PyObject s$55;
65 private static PyObject s$56;
66 private static PyObject s$57;
67 private static PyObject s$58;
68 private static PyObject s$59;
69 private static PyObject s$60;
70 private static PyObject s$61;
71 private static PyObject s$62;
72 private static PyObject s$63;
73 private static PyObject s$64;
74 private static PyObject s$65;
75 private static PyObject s$66;
76 private static PyObject s$67;
77 private static PyObject s$68;
78 private static PyObject s$69;
79 private static PyObject s$70;
80 private static PyObject s$71;
81 private static PyObject s$72;
82 private static PyObject s$73;
83 private static PyObject s$74;
84 private static PyObject s$75;
85 private static PyObject s$76;
86 private static PyObject s$77;
87 private static PyObject s$78;
88 private static PyObject s$79;
89 private static PyObject s$80;
90 private static PyObject s$81;
91 private static PyObject s$82;
92 private static PyObject s$83;
93 private static PyObject s$84;
94 private static PyObject s$85;
95 private static PyObject s$86;
96 private static PyObject s$87;
97 private static PyObject s$88;
98 private static PyObject s$89;
99 private static PyObject s$90;
100 private static PyObject s$91;
101 private static PyObject s$92;
102 private static PyObject s$93;
103 private static PyObject s$94;
104 private static PyObject s$95;
105 private static PyObject s$96;
106 private static PyObject s$97;
107 private static PyObject s$98;
108 private static PyObject s$99;
109 private static PyObject s$100;
110 private static PyObject s$101;
111 private static PyObject s$102;
112 private static PyObject s$103;
113 private static PyObject s$104;
114 private static PyObject s$105;
115 private static PyObject s$106;
116 private static PyObject s$107;
117 private static PyObject s$108;
118 private static PyObject s$109;
119 private static PyFunctionTable funcTable;
120 private static PyCode c$0__exit;
121 private static PyCode c$1_getcwd;
122 private static PyCode c$2_chdir;
123 private static PyCode c$3_listdir;
124 private static PyCode c$4_mkdir;
125 private static PyCode c$5_makedirs;
126 private static PyCode c$6_remove;
127 private static PyCode c$7_rename;
128 private static PyCode c$8_rmdir;
129 private static PyCode c$9_stat;
130 private static PyCode c$10_utime;
131 private static PyCode c$11_lambda;
132 private static PyCode c$12_lambda;
133 private static PyCode c$13___init__;
134 private static PyCode c$14__LazyDict__populate;
135 private static PyCode c$15___repr__;
136 private static PyCode c$16___cmp__;
137 private static PyCode c$17___len__;
138 private static PyCode c$18___getitem__;
139 private static PyCode c$19___setitem__;
140 private static PyCode c$20___delitem__;
141 private static PyCode c$21_clear;
142 private static PyCode c$22_copy;
143 private static PyCode c$23_keys;
144 private static PyCode c$24_items;
145 private static PyCode c$25_values;
146 private static PyCode c$26_has_key;
147 private static PyCode c$27_update;
148 private static PyCode c$28_get;
149 private static PyCode c$29_setdefault;
150 private static PyCode c$30_popitem;
151 private static PyCode c$31_LazyDict;
152 private static PyCode c$32___init__;
153 private static PyCode c$33_println;
154 private static PyCode c$34_printlnStdErr;
155 private static PyCode c$35_system;
156 private static PyCode c$36_execute;
157 private static PyCode c$37__readLines;
158 private static PyCode c$38__formatCmd;
159 private static PyCode c$39__formatEnvironment;
160 private static PyCode c$40__getEnvironment;
161 private static PyCode c$41__ShellEnv;
162 private static PyCode c$42__getOsType;
163 private static PyCode c$43__getShellEnv;
164 private static PyCode c$44__testGetOsType;
165 private static PyCode c$45__testCmds;
166 private static PyCode c$46__testSystem;
167 private static PyCode c$47__testBadShell;
168 private static PyCode c$48__testBadGetEnv;
169 private static PyCode c$49__test;
170 private static PyCode c$50_main;
171 private static void initConstants() {
172 s$0 = Py.newString("OS routines for Java, with some attempts to support DOS, NT, and\012Posix functionality.\012\012This exports:\012 - all functions from posix, nt, dos, os2, mac, or ce, e.g. unlink, stat, etc.\012 - os.path is one of the modules posixpath, ntpath, macpath, or dospath\012 - os.name is 'posix', 'nt', 'dos', 'os2', 'mac', 'ce' or 'riscos'\012 - os.curdir is a string representing the current directory ('.' or ':')\012 - os.pardir is a string representing the parent directory ('..' or '::')\012 - os.sep is the (or a most common) pathname separator ('/' or ':' or '\\\\')\012 - os.altsep is the alternate pathname separator (None or '/')\012 - os.pathsep is the component separator used in $PATH etc\012 - os.linesep is the line separator in text files ('\\r' or '\\n' or '\\r\\n')\012 - os.defpath is the default search path for executables\012\012Programs that import and use 'os' stand a better chance of being\012portable between different platforms. Of course, they must then\012only use functions that are defined by all platforms (e.g., unlink\012and opendir), and leave all pathname manipulation to os.path\012(e.g., split and join).\012");
173 s$1 = Py.newString("altsep");
174 s$2 = Py.newString("curdir");
175 s$3 = Py.newString("pardir");
176 s$4 = Py.newString("sep");
177 s$5 = Py.newString("pathsep");
178 s$6 = Py.newString("linesep");
179 s$7 = Py.newString("defpath");
180 s$8 = Py.newString("name");
181 s$9 = Py.newString("java");
182 s$10 = Py.newString(".");
183 s$11 = Py.newString("..");
184 s$12 = Py.newString("line.separator");
185 i$13 = Py.newInteger(0);
186 s$14 = Py.newString("foo");
187 s$15 = Py.newString("chdir not supported in Java");
188 s$16 = Py.newString("No such directory");
189 s$17 = Py.newString("couldn't make directory");
190 s$18 = Py.newString("ignored");
191 s$19 = Py.newString("couldn't make directories");
192 s$20 = Py.newString("couldn't delete file");
193 s$21 = Py.newString("couldn't rename file");
194 s$22 = Py.newString("couldn't delete directory");
195 s$23 = Py.newString("The Java stat implementation only returns a small subset of\012 the standard fields");
196 s$24 = Py.newString("No such file or directory");
197 f$25 = Py.newFloat(1000.0);
198 s$26 = Py.newString("setLastModified");
199 i$27 = Py.newInteger(1);
200 s$28 = Py.newString("A lazy-populating User Dictionary.\012 Lazy initialization is not thread-safe.\012 ");
201 s$29 = Py.newString("dict: starting dictionary of values\012 populate: function that returns the populated dictionary\012 keyTransform: function to normalize the keys (e.g., toupper/None)\012 ");
202 s$30 = Py.newString("Provide environment derived by spawning a subshell and parsing its\012 environment. Also supports system functions and provides empty\012 environment support for platforms with unknown shell\012 functionality.\012 ");
203 s$31 = Py.newString("cmd: list of exec() arguments to run command in subshell, or None\012 getEnv: shell command to list environment variables, or None\012 keyTransform: normalization function for environment keys, or None\012 ");
204 s$32 = Py.newString("Imitate the standard library 'system' call.\012 Execute 'cmd' in a shell, and send output to stdout & stderr.\012 ");
205 s$33 = Py.newString("\012");
206 s$34 = Py.newString("Execute cmd in a shell, and return the process instance");
207 s$35 = Py.newString("Failed to execute command (%s): %s");
208 s$36 = Py.newString("Read lines of stream, and either append them to return\012 array of lines, or call func on each line.\012 ");
209 s$37 = Py.newString("Format a command for execution in a shell.");
210 s$38 = Py.newString("Unable to execute commands in subshell because shell functionality not implemented for OS %s with shell setting %s. Failed command=%s");
211 s$39 = Py.newString("Format enviroment in lines suitable for Runtime.exec");
212 s$40 = Py.newString("%s=%s");
213 s$41 = Py.newString("Get the environment variables by spawning a subshell.\012 This allows multi-line variables as long as subsequent lines do\012 not have '=' signs.\012 ");
214 s$42 = Py.newString("=");
215 s$43 = Py.newString("getEnv command (%s) did not print environment.\012Output=%s");
216 s$44 = Py.newString("%s\012%s");
217 s$45 = Py.newString("Failed to get environment, environ will be empty:");
218 s$46 = Py.newString("Select the OS behavior based on os argument, 'python.os' registry\012 setting and 'os.name' Java property.\012 os: explicitly select desired OS. os=None to autodetect, os='None' to\012 disable \012 ");
219 s$47 = Py.newString("python.os");
220 s$48 = Py.newString("os.name");
221 s$49 = Py.newString("nt");
222 s$50 = Py.newString("(nt)|(Windows NT)|(Windows NT 4.0)|(WindowsNT)|(Windows 2000)|(Windows XP)|(Windows CE)");
223 s$51 = Py.newString("dos");
224 s$52 = Py.newString("(dos)|(Windows 95)|(Windows 98)|(Windows ME)");
225 s$53 = Py.newString("mac");
226 s$54 = Py.newString("(mac)|(MacOS.*)|(Darwin)");
227 s$55 = Py.newString("None");
228 s$56 = Py.newString("(None)");
229 s$57 = Py.newString("posix");
230 s$58 = Py.newString("(.*)");
231 s$59 = Py.newString("Create the desired environment type.\012 envType: 'shell' or None\012 ");
232 s$60 = Py.newString("shell");
233 s$61 = Py.newString("python.environment");
234 s$62 = Py.newString("cmd");
235 s$63 = Py.newString("/c");
236 s$64 = Py.newString("set");
237 s$65 = Py.newString("command.com");
238 s$66 = Py.newString("sh");
239 s$67 = Py.newString("-c");
240 s$68 = Py.newString("env");
241 s$69 = Py.newString(":");
242 s$70 = Py.newString("::");
243 s$71 = Py.newString("Windows NT");
244 s$72 = Py.newString("Windows 95");
245 s$73 = Py.newString("MacOS");
246 s$74 = Py.newString("Solaris");
247 s$75 = Py.newString("Linux");
248 s$76 = Py.newString("_getOsType( '%s' ) should return '%s', not '%s'");
249 s$77 = Py.newString("\012Executing '%s' with %s environment");
250 s$78 = Py.newString("%s failed with %s environment");
251 s$79 = Py.newString("expected match for %s, got %s");
252 s$80 = Py.newString("testKey");
253 s$81 = Py.newString("testValue");
254 s$82 = Py.newString("echo hello there");
255 s$83 = Py.newString("hello there");
256 s$84 = Py.newString("echo PATH=%PATH%");
257 s$85 = Py.newString("(PATH=.*;.*)|(PATH=%PATH%)");
258 s$86 = Py.newString("echo %s=%%%s%%");
259 s$87 = Py.newString("(%s=)");
260 s$88 = Py.newString("echo PATH=$PATH");
261 s$89 = Py.newString("PATH=.*");
262 s$90 = Py.newString("echo %s=$%s");
263 s$91 = Py.newString("(%s=$%s)|(%s=)|(%s=%s)");
264 s$92 = Py.newString("echo \"hello there\"");
265 s$93 = Py.newString("\"?hello there\"?");
266 s$94 = Py.newString("jython -c \"import sys;sys.stdout.write( 'why\\n' )\"");
267 s$95 = Py.newString("why");
268 s$96 = Py.newString("jython -c \"import sys;sys.stderr.write('why\\n');print \" ");
269 s$97 = Py.newString("");
270 s$98 = Py.newString("before population, environ._populated should be false");
271 s$99 = Py.newString("default");
272 s$100 = Py.newString("after population, environ._populated should be true");
273 s$101 = Py.newString("expected stub to have %s set");
274 s$102 = Py.newString("expected real environment to have %s set");
275 s$103 = Py.newString("initialized");
276 s$104 = Py.newString("PATH");
277 s$105 = Py.newString("expected environment to have PATH attribute (this may not apply to all platforms!)");
278 s$106 = Py.newString("badshell");
279 s$107 = Py.newString("environment should be empty");
280 s$108 = Py.newString("echo This command does not print environment");
281 s$109 = Py.newString("/usr/share/jython/Lib/javaos.py");
282 funcTable = new _PyInner();
283 c$0__exit = Py.newCode(1, new String[] {"n"}, "/usr/share/jython/Lib/javaos.py", "_exit", false, false, funcTable, 0, null, null, 0, 1);
284 c$1_getcwd = Py.newCode(0, new String[] {"foo"}, "/usr/share/jython/Lib/javaos.py", "getcwd", false, false, funcTable, 1, null, null, 0, 1);
285 c$2_chdir = Py.newCode(1, new String[] {"path"}, "/usr/share/jython/Lib/javaos.py", "chdir", false, false, funcTable, 2, null, null, 0, 1);
286 c$3_listdir = Py.newCode(1, new String[] {"path", "l"}, "/usr/share/jython/Lib/javaos.py", "listdir", false, false, funcTable, 3, null, null, 0, 1);
287 c$4_mkdir = Py.newCode(2, new String[] {"path", "mode"}, "/usr/share/jython/Lib/javaos.py", "mkdir", false, false, funcTable, 4, null, null, 0, 1);
288 c$5_makedirs = Py.newCode(2, new String[] {"path", "mode"}, "/usr/share/jython/Lib/javaos.py", "makedirs", false, false, funcTable, 5, null, null, 0, 1);
289 c$6_remove = Py.newCode(1, new String[] {"path"}, "/usr/share/jython/Lib/javaos.py", "remove", false, false, funcTable, 6, null, null, 0, 1);
290 c$7_rename = Py.newCode(2, new String[] {"path", "newpath"}, "/usr/share/jython/Lib/javaos.py", "rename", false, false, funcTable, 7, null, null, 0, 1);
291 c$8_rmdir = Py.newCode(1, new String[] {"path"}, "/usr/share/jython/Lib/javaos.py", "rmdir", false, false, funcTable, 8, null, null, 0, 1);
292 c$9_stat = Py.newCode(1, new String[] {"path", "mtime", "size", "f"}, "/usr/share/jython/Lib/javaos.py", "stat", false, false, funcTable, 9, null, null, 0, 1);
293 c$10_utime = Py.newCode(2, new String[] {"path", "times"}, "/usr/share/jython/Lib/javaos.py", "utime", false, false, funcTable, 10, null, null, 0, 1);
294 c$11_lambda = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib/javaos.py", "<lambda>", false, false, funcTable, 11, null, null, 0, 1);
295 c$12_lambda = Py.newCode(1, new String[] {"key"}, "/usr/share/jython/Lib/javaos.py", "<lambda>", false, false, funcTable, 12, null, null, 0, 1);
296 c$13___init__ = Py.newCode(4, new String[] {"self", "dict", "populate", "keyTransform"}, "/usr/share/jython/Lib/javaos.py", "__init__", false, false, funcTable, 13, null, null, 0, 1);
297 c$14__LazyDict__populate = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "_LazyDict__populate", false, false, funcTable, 14, null, null, 0, 1);
298 c$15___repr__ = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "__repr__", false, false, funcTable, 15, null, null, 0, 1);
299 c$16___cmp__ = Py.newCode(2, new String[] {"self", "dict"}, "/usr/share/jython/Lib/javaos.py", "__cmp__", false, false, funcTable, 16, null, null, 0, 1);
300 c$17___len__ = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "__len__", false, false, funcTable, 17, null, null, 0, 1);
301 c$18___getitem__ = Py.newCode(2, new String[] {"self", "key"}, "/usr/share/jython/Lib/javaos.py", "__getitem__", false, false, funcTable, 18, null, null, 0, 1);
302 c$19___setitem__ = Py.newCode(3, new String[] {"self", "key", "item"}, "/usr/share/jython/Lib/javaos.py", "__setitem__", false, false, funcTable, 19, null, null, 0, 1);
303 c$20___delitem__ = Py.newCode(2, new String[] {"self", "key"}, "/usr/share/jython/Lib/javaos.py", "__delitem__", false, false, funcTable, 20, null, null, 0, 1);
304 c$21_clear = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "clear", false, false, funcTable, 21, null, null, 0, 1);
305 c$22_copy = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "copy", false, false, funcTable, 22, null, null, 0, 1);
306 c$23_keys = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "keys", false, false, funcTable, 23, null, null, 0, 1);
307 c$24_items = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "items", false, false, funcTable, 24, null, null, 0, 1);
308 c$25_values = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "values", false, false, funcTable, 25, null, null, 0, 1);
309 c$26_has_key = Py.newCode(2, new String[] {"self", "key"}, "/usr/share/jython/Lib/javaos.py", "has_key", false, false, funcTable, 26, null, null, 0, 1);
310 c$27_update = Py.newCode(2, new String[] {"self", "dict"}, "/usr/share/jython/Lib/javaos.py", "update", false, false, funcTable, 27, null, null, 0, 1);
311 c$28_get = Py.newCode(3, new String[] {"self", "key", "failobj"}, "/usr/share/jython/Lib/javaos.py", "get", false, false, funcTable, 28, null, null, 0, 1);
312 c$29_setdefault = Py.newCode(3, new String[] {"self", "key", "failobj"}, "/usr/share/jython/Lib/javaos.py", "setdefault", false, false, funcTable, 29, null, null, 0, 1);
313 c$30_popitem = Py.newCode(1, new String[] {"self"}, "/usr/share/jython/Lib/javaos.py", "popitem", false, false, funcTable, 30, null, null, 0, 1);
314 c$31_LazyDict = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib/javaos.py", "LazyDict", false, false, funcTable, 31, null, null, 0, 0);
315 c$32___init__ = Py.newCode(4, new String[] {"self", "cmd", "getEnv", "keyTransform"}, "/usr/share/jython/Lib/javaos.py", "__init__", false, false, funcTable, 32, null, null, 0, 1);
316 c$33_println = Py.newCode(2, new String[] {"arg", "write"}, "/usr/share/jython/Lib/javaos.py", "println", false, false, funcTable, 33, null, null, 0, 1);
317 c$34_printlnStdErr = Py.newCode(2, new String[] {"arg", "write"}, "/usr/share/jython/Lib/javaos.py", "printlnStdErr", false, false, funcTable, 34, null, null, 0, 1);
318 c$35_system = Py.newCode(2, new String[] {"self", "cmd", "println", "printlnStdErr", "p"}, "/usr/share/jython/Lib/javaos.py", "system", false, false, funcTable, 35, null, null, 0, 1);
319 c$36_execute = Py.newCode(2, new String[] {"self", "cmd", "p", "shellCmd", "env", "ex"}, "/usr/share/jython/Lib/javaos.py", "execute", false, false, funcTable, 36, null, null, 0, 1);
320 c$37__readLines = Py.newCode(3, new String[] {"self", "stream", "func", "bufStream", "lines", "line"}, "/usr/share/jython/Lib/javaos.py", "_readLines", false, false, funcTable, 37, null, null, 0, 1);
321 c$38__formatCmd = Py.newCode(2, new String[] {"self", "cmd", "msgFmt"}, "/usr/share/jython/Lib/javaos.py", "_formatCmd", false, false, funcTable, 38, null, null, 0, 1);
322 c$39__formatEnvironment = Py.newCode(2, new String[] {"self", "env", "lines", "keyValue"}, "/usr/share/jython/Lib/javaos.py", "_formatEnvironment", false, false, funcTable, 39, null, null, 0, 1);
323 c$40__getEnvironment = Py.newCode(1, new String[] {"self", "p", "i", "env", "ex", "value", "key", "lines", "line"}, "/usr/share/jython/Lib/javaos.py", "_getEnvironment", false, false, funcTable, 40, null, null, 0, 1);
324 c$41__ShellEnv = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib/javaos.py", "_ShellEnv", false, false, funcTable, 41, null, null, 0, 0);
325 c$42__getOsType = Py.newCode(1, new String[] {"os", "osType", "pattern", "_osTypeMap"}, "/usr/share/jython/Lib/javaos.py", "_getOsType", false, false, funcTable, 42, null, null, 0, 1);
326 c$43__getShellEnv = Py.newCode(4, new String[] {"envType", "shellCmd", "envCmd", "envTransform"}, "/usr/share/jython/Lib/javaos.py", "_getShellEnv", false, false, funcTable, 43, null, null, 0, 1);
327 c$44__testGetOsType = Py.newCode(0, new String[] {"got", "key", "testVals", "msgFmt", "val"}, "/usr/share/jython/Lib/javaos.py", "_testGetOsType", false, false, funcTable, 44, null, null, 0, 1);
328 c$45__testCmds = Py.newCode(3, new String[] {"_shellEnv", "testCmds", "whichEnv", "line", "pattern", "cmd"}, "/usr/share/jython/Lib/javaos.py", "_testCmds", false, false, funcTable, 45, null, null, 0, 1);
329 c$46__testSystem = Py.newCode(1, new String[] {"shellEnv", "testCmds", "value", "key", "org"}, "/usr/share/jython/Lib/javaos.py", "_testSystem", false, false, funcTable, 46, null, null, 0, 1);
330 c$47__testBadShell = Py.newCode(0, new String[] {"se2"}, "/usr/share/jython/Lib/javaos.py", "_testBadShell", false, false, funcTable, 47, null, null, 0, 1);
331 c$48__testBadGetEnv = Py.newCode(0, new String[] {"se2"}, "/usr/share/jython/Lib/javaos.py", "_testBadGetEnv", false, false, funcTable, 48, null, null, 0, 1);
332 c$49__test = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib/javaos.py", "_test", false, false, funcTable, 49, null, null, 0, 1);
333 c$50_main = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib/javaos.py", "main", false, false, funcTable, 50, null, null, 0, 0);
337 public PyCode getMain() {
338 if (c$50_main == null) _PyInner.initConstants();
342 public PyObject call_function(int index, PyFrame frame) {
345 return _PyInner._exit$1(frame);
347 return _PyInner.getcwd$2(frame);
349 return _PyInner.chdir$3(frame);
351 return _PyInner.listdir$4(frame);
353 return _PyInner.mkdir$5(frame);
355 return _PyInner.makedirs$6(frame);
357 return _PyInner.remove$7(frame);
359 return _PyInner.rename$8(frame);
361 return _PyInner.rmdir$9(frame);
363 return _PyInner.stat$10(frame);
365 return _PyInner.utime$11(frame);
367 return _PyInner.lambda$12(frame);
369 return _PyInner.lambda$13(frame);
371 return _PyInner.__init__$14(frame);
373 return _PyInner._LazyDict__populate$15(frame);
375 return _PyInner.__repr__$16(frame);
377 return _PyInner.__cmp__$17(frame);
379 return _PyInner.__len__$18(frame);
381 return _PyInner.__getitem__$19(frame);
383 return _PyInner.__setitem__$20(frame);
385 return _PyInner.__delitem__$21(frame);
387 return _PyInner.clear$22(frame);
389 return _PyInner.copy$23(frame);
391 return _PyInner.keys$24(frame);
393 return _PyInner.items$25(frame);
395 return _PyInner.values$26(frame);
397 return _PyInner.has_key$27(frame);
399 return _PyInner.update$28(frame);
401 return _PyInner.get$29(frame);
403 return _PyInner.setdefault$30(frame);
405 return _PyInner.popitem$31(frame);
407 return _PyInner.LazyDict$32(frame);
409 return _PyInner.__init__$33(frame);
411 return _PyInner.println$34(frame);
413 return _PyInner.printlnStdErr$35(frame);
415 return _PyInner.system$36(frame);
417 return _PyInner.execute$37(frame);
419 return _PyInner._readLines$38(frame);
421 return _PyInner._formatCmd$39(frame);
423 return _PyInner._formatEnvironment$40(frame);
425 return _PyInner._getEnvironment$41(frame);
427 return _PyInner._ShellEnv$42(frame);
429 return _PyInner._getOsType$43(frame);
431 return _PyInner._getShellEnv$44(frame);
433 return _PyInner._testGetOsType$45(frame);
435 return _PyInner._testCmds$46(frame);
437 return _PyInner._testSystem$47(frame);
439 return _PyInner._testBadShell$48(frame);
441 return _PyInner._testBadGetEnv$49(frame);
443 return _PyInner._test$50(frame);
445 return _PyInner.main$51(frame);
451 private static PyObject _exit$1(PyFrame frame) {
452 frame.getglobal("java").__getattr__("lang").__getattr__("System").__getattr__("exit").__call__(frame.getlocal(0));
456 private static PyObject getcwd$2(PyFrame frame) {
457 frame.setlocal(0, frame.getglobal("File").__call__(frame.getglobal("File").__call__(s$14).invoke("getAbsolutePath")));
458 return frame.getlocal(0).invoke("getParent");
461 private static PyObject chdir$3(PyFrame frame) {
462 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$15, frame.getlocal(0)));
465 private static PyObject listdir$4(PyFrame frame) {
466 frame.setlocal(1, frame.getglobal("File").__call__(frame.getlocal(0)).invoke("list"));
467 if (frame.getlocal(1)._is(frame.getglobal("None")).__nonzero__()) {
468 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$16, frame.getlocal(0)));
470 return frame.getglobal("list").__call__(frame.getlocal(1));
473 private static PyObject mkdir$5(PyFrame frame) {
474 if (frame.getglobal("File").__call__(frame.getlocal(0)).invoke("mkdir").__not__().__nonzero__()) {
475 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$17, frame.getlocal(0)));
480 private static PyObject makedirs$6(PyFrame frame) {
481 if (frame.getglobal("File").__call__(frame.getlocal(0)).invoke("mkdirs").__not__().__nonzero__()) {
482 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$19, frame.getlocal(0)));
487 private static PyObject remove$7(PyFrame frame) {
488 if (frame.getglobal("File").__call__(frame.getlocal(0)).invoke("delete").__not__().__nonzero__()) {
489 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$20, frame.getlocal(0)));
494 private static PyObject rename$8(PyFrame frame) {
495 if (frame.getglobal("File").__call__(frame.getlocal(0)).invoke("renameTo", frame.getglobal("File").__call__(frame.getlocal(1))).__not__().__nonzero__()) {
496 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$21, frame.getlocal(0)));
501 private static PyObject rmdir$9(PyFrame frame) {
502 if (frame.getglobal("File").__call__(frame.getlocal(0)).invoke("delete").__not__().__nonzero__()) {
503 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$22, frame.getlocal(0)));
508 private static PyObject stat$10(PyFrame frame) {
509 // Temporary Variables
510 PyObject t$0$PyObject;
513 /* The Java stat implementation only returns a small subset of
514 the standard fields */
515 frame.setlocal(3, frame.getglobal("File").__call__(frame.getlocal(0)));
516 frame.setlocal(2, frame.getlocal(3).invoke("length"));
517 if (((t$0$PyObject = frame.getlocal(2)._eq(i$13)).__nonzero__() ? frame.getlocal(3).invoke("exists").__not__() : t$0$PyObject).__nonzero__()) {
518 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$24, frame.getlocal(0)));
520 frame.setlocal(1, frame.getlocal(3).invoke("lastModified")._div(f$25));
521 return new PyTuple(new PyObject[] {i$13, i$13, i$13, i$13, i$13, i$13, frame.getlocal(2), frame.getlocal(1), frame.getlocal(1), i$13});
524 private static PyObject utime$11(PyFrame frame) {
525 // Temporary Variables
526 PyObject t$0$PyObject;
529 if (((t$0$PyObject = frame.getlocal(1)).__nonzero__() ? frame.getglobal("hasattr").__call__(frame.getglobal("File"), s$26) : t$0$PyObject).__nonzero__()) {
530 frame.getglobal("File").__call__(frame.getlocal(0)).invoke("setLastModified", frame.getglobal("long").__call__(frame.getlocal(1).__getitem__(i$27)._mul(f$25)));
535 private static PyObject lambda$12(PyFrame frame) {
536 return new PyDictionary(new PyObject[] {});
539 private static PyObject lambda$13(PyFrame frame) {
540 return frame.getlocal(0);
543 private static PyObject __init__$14(PyFrame frame) {
544 // Temporary Variables
545 PyObject t$0$PyObject;
548 /* dict: starting dictionary of values
549 populate: function that returns the populated dictionary
550 keyTransform: function to normalize the keys (e.g., toupper/None)
552 frame.getglobal("UserDict").__getattr__("__init__").__call__(frame.getlocal(0), frame.getlocal(1));
553 frame.getlocal(0).__setattr__("_populated", i$13);
554 frame.getlocal(0).__setattr__("_LazyDict__populateFunc", (t$0$PyObject = frame.getlocal(2)).__nonzero__() ? t$0$PyObject : new PyFunction(frame.f_globals, new PyObject[] {}, c$11_lambda));
555 frame.getlocal(0).__setattr__("_keyTransform", (t$0$PyObject = frame.getlocal(3)).__nonzero__() ? t$0$PyObject : new PyFunction(frame.f_globals, new PyObject[] {}, c$12_lambda));
559 private static PyObject _LazyDict__populate$15(PyFrame frame) {
560 if (frame.getlocal(0).__getattr__("_populated").__not__().__nonzero__()) {
561 frame.getlocal(0).__setattr__("data", frame.getlocal(0).invoke("_LazyDict__populateFunc"));
562 frame.getlocal(0).__setattr__("_populated", i$27);
567 private static PyObject __repr__$16(PyFrame frame) {
568 frame.getlocal(0).invoke("_LazyDict__populate");
569 return frame.getglobal("UserDict").__getattr__("__repr__").__call__(frame.getlocal(0));
572 private static PyObject __cmp__$17(PyFrame frame) {
573 frame.getlocal(0).invoke("_LazyDict__populate");
574 return frame.getglobal("UserDict").__getattr__("__cmp__").__call__(frame.getlocal(0), frame.getlocal(1));
577 private static PyObject __len__$18(PyFrame frame) {
578 frame.getlocal(0).invoke("_LazyDict__populate");
579 return frame.getglobal("UserDict").__getattr__("__len__").__call__(frame.getlocal(0));
582 private static PyObject __getitem__$19(PyFrame frame) {
583 frame.getlocal(0).invoke("_LazyDict__populate");
584 return frame.getglobal("UserDict").__getattr__("__getitem__").__call__(frame.getlocal(0), frame.getlocal(0).invoke("_keyTransform", frame.getlocal(1)));
587 private static PyObject __setitem__$20(PyFrame frame) {
588 frame.getlocal(0).invoke("_LazyDict__populate");
589 frame.getglobal("UserDict").__getattr__("__setitem__").__call__(frame.getlocal(0), frame.getlocal(0).invoke("_keyTransform", frame.getlocal(1)), frame.getlocal(2));
593 private static PyObject __delitem__$21(PyFrame frame) {
594 frame.getlocal(0).invoke("_LazyDict__populate");
595 frame.getglobal("UserDict").__getattr__("__delitem__").__call__(frame.getlocal(0), frame.getlocal(0).invoke("_keyTransform", frame.getlocal(1)));
599 private static PyObject clear$22(PyFrame frame) {
600 frame.getlocal(0).invoke("_LazyDict__populate");
601 frame.getglobal("UserDict").__getattr__("clear").__call__(frame.getlocal(0));
605 private static PyObject copy$23(PyFrame frame) {
606 frame.getlocal(0).invoke("_LazyDict__populate");
607 return frame.getglobal("UserDict").__getattr__("copy").__call__(frame.getlocal(0));
610 private static PyObject keys$24(PyFrame frame) {
611 frame.getlocal(0).invoke("_LazyDict__populate");
612 return frame.getglobal("UserDict").__getattr__("keys").__call__(frame.getlocal(0));
615 private static PyObject items$25(PyFrame frame) {
616 frame.getlocal(0).invoke("_LazyDict__populate");
617 return frame.getglobal("UserDict").__getattr__("items").__call__(frame.getlocal(0));
620 private static PyObject values$26(PyFrame frame) {
621 frame.getlocal(0).invoke("_LazyDict__populate");
622 return frame.getglobal("UserDict").__getattr__("values").__call__(frame.getlocal(0));
625 private static PyObject has_key$27(PyFrame frame) {
626 frame.getlocal(0).invoke("_LazyDict__populate");
627 return frame.getglobal("UserDict").__getattr__("has_key").__call__(frame.getlocal(0), frame.getlocal(0).invoke("_keyTransform", frame.getlocal(1)));
630 private static PyObject update$28(PyFrame frame) {
631 frame.getlocal(0).invoke("_LazyDict__populate");
632 frame.getglobal("UserDict").__getattr__("update").__call__(frame.getlocal(0), frame.getlocal(1));
636 private static PyObject get$29(PyFrame frame) {
637 frame.getlocal(0).invoke("_LazyDict__populate");
638 return frame.getglobal("UserDict").__getattr__("get").__call__(frame.getlocal(0), frame.getlocal(0).invoke("_keyTransform", frame.getlocal(1)), frame.getlocal(2));
641 private static PyObject setdefault$30(PyFrame frame) {
642 frame.getlocal(0).invoke("_LazyDict__populate");
643 return frame.getglobal("UserDict").__getattr__("setdefault").__call__(frame.getlocal(0), frame.getlocal(0).invoke("_keyTransform", frame.getlocal(1)), frame.getlocal(2));
646 private static PyObject popitem$31(PyFrame frame) {
647 frame.getlocal(0).invoke("_LazyDict__populate");
648 return frame.getglobal("UserDict").__getattr__("popitem").__call__(frame.getlocal(0));
651 private static PyObject LazyDict$32(PyFrame frame) {
652 /* A lazy-populating User Dictionary.
653 Lazy initialization is not thread-safe.
655 frame.setlocal("__init__", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None"), frame.getname("None"), frame.getname("None")}, c$13___init__));
656 frame.setlocal("_LazyDict__populate", new PyFunction(frame.f_globals, new PyObject[] {}, c$14__LazyDict__populate));
657 frame.setlocal("__repr__", new PyFunction(frame.f_globals, new PyObject[] {}, c$15___repr__));
658 frame.setlocal("__cmp__", new PyFunction(frame.f_globals, new PyObject[] {}, c$16___cmp__));
659 frame.setlocal("__len__", new PyFunction(frame.f_globals, new PyObject[] {}, c$17___len__));
660 frame.setlocal("__getitem__", new PyFunction(frame.f_globals, new PyObject[] {}, c$18___getitem__));
661 frame.setlocal("__setitem__", new PyFunction(frame.f_globals, new PyObject[] {}, c$19___setitem__));
662 frame.setlocal("__delitem__", new PyFunction(frame.f_globals, new PyObject[] {}, c$20___delitem__));
663 frame.setlocal("clear", new PyFunction(frame.f_globals, new PyObject[] {}, c$21_clear));
664 frame.setlocal("copy", new PyFunction(frame.f_globals, new PyObject[] {}, c$22_copy));
665 frame.setlocal("keys", new PyFunction(frame.f_globals, new PyObject[] {}, c$23_keys));
666 frame.setlocal("items", new PyFunction(frame.f_globals, new PyObject[] {}, c$24_items));
667 frame.setlocal("values", new PyFunction(frame.f_globals, new PyObject[] {}, c$25_values));
668 frame.setlocal("has_key", new PyFunction(frame.f_globals, new PyObject[] {}, c$26_has_key));
669 frame.setlocal("update", new PyFunction(frame.f_globals, new PyObject[] {}, c$27_update));
670 frame.setlocal("get", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None")}, c$28_get));
671 frame.setlocal("setdefault", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None")}, c$29_setdefault));
672 frame.setlocal("popitem", new PyFunction(frame.f_globals, new PyObject[] {}, c$30_popitem));
673 return frame.getf_locals();
676 private static PyObject __init__$33(PyFrame frame) {
677 /* cmd: list of exec() arguments to run command in subshell, or None
678 getEnv: shell command to list environment variables, or None
679 keyTransform: normalization function for environment keys, or None
681 frame.getlocal(0).__setattr__("cmd", frame.getlocal(1));
682 frame.getlocal(0).__setattr__("getEnv", frame.getlocal(2));
683 frame.getlocal(0).__setattr__("environment", frame.getglobal("LazyDict").__call__(new PyObject[] {frame.getlocal(0).__getattr__("_getEnvironment"), frame.getlocal(3)}, new String[] {"populate", "keyTransform"}));
684 frame.getlocal(0).__setattr__("_keyTransform", frame.getlocal(0).__getattr__("environment").__getattr__("_keyTransform"));
688 private static PyObject println$34(PyFrame frame) {
689 frame.getlocal(1).__call__(frame.getlocal(0)._add(s$33));
693 private static PyObject printlnStdErr$35(PyFrame frame) {
694 frame.getlocal(1).__call__(frame.getlocal(0)._add(s$33));
698 private static PyObject system$36(PyFrame frame) {
699 /* Imitate the standard library 'system' call.
700 Execute 'cmd' in a shell, and send output to stdout & stderr.
702 frame.setlocal(4, frame.getlocal(0).invoke("execute", frame.getlocal(1)));
703 frame.setlocal(2, new PyFunction(frame.f_globals, new PyObject[] {frame.getglobal("sys").__getattr__("stdout").__getattr__("write")}, c$33_println));
704 frame.setlocal(3, new PyFunction(frame.f_globals, new PyObject[] {frame.getglobal("sys").__getattr__("stderr").__getattr__("write")}, c$34_printlnStdErr));
705 frame.getglobal("thread").__getattr__("start_new_thread").__call__(frame.getlocal(0).__getattr__("_readLines"), new PyTuple(new PyObject[] {frame.getlocal(4).invoke("getErrorStream"), frame.getlocal(3)}));
706 frame.getlocal(0).invoke("_readLines", frame.getlocal(4).invoke("getInputStream"), frame.getlocal(2));
707 return frame.getlocal(4).invoke("waitFor");
710 private static PyObject execute$37(PyFrame frame) {
711 // Temporary Variables
712 PyException t$0$PyException;
715 /* Execute cmd in a shell, and return the process instance */
716 frame.setlocal(3, frame.getlocal(0).invoke("_formatCmd", frame.getlocal(1)));
717 if (frame.getlocal(0).__getattr__("environment").__getattr__("_populated").__nonzero__()) {
718 frame.setlocal(4, frame.getlocal(0).invoke("_formatEnvironment", frame.getlocal(0).__getattr__("environment")));
721 frame.setlocal(4, frame.getglobal("None"));
724 frame.setlocal(2, frame.getglobal("java").__getattr__("lang").__getattr__("Runtime").__getattr__("getRuntime").__call__().invoke("exec", frame.getlocal(3), frame.getlocal(4)));
725 return frame.getlocal(2);
727 catch (Throwable x$0) {
728 t$0$PyException = Py.setException(x$0, frame);
729 if (Py.matchException(t$0$PyException, frame.getglobal("IOException"))) {
730 frame.setlocal(5, t$0$PyException.value);
731 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, s$35._mod(new PyTuple(new PyObject[] {frame.getlocal(3), frame.getlocal(5)}))));
733 else throw t$0$PyException;
737 private static PyObject _readLines$38(PyFrame frame) {
738 // Temporary Variables
739 PyObject t$0$PyObject;
742 /* Read lines of stream, and either append them to return
743 array of lines, or call func on each line.
745 frame.setlocal(4, new PyList(new PyObject[] {}));
746 frame.setlocal(2, (t$0$PyObject = frame.getlocal(2)).__nonzero__() ? t$0$PyObject : frame.getlocal(4).__getattr__("append"));
747 frame.setlocal(3, frame.getglobal("BufferedReader").__call__(frame.getglobal("InputStreamReader").__call__(frame.getlocal(1))));
748 while (i$27.__nonzero__()) {
749 frame.setlocal(5, frame.getlocal(3).invoke("readLine"));
750 if (frame.getlocal(5)._is(frame.getglobal("None")).__nonzero__()) {
753 frame.getlocal(2).__call__(frame.getlocal(5));
755 return (t$0$PyObject = frame.getlocal(4)).__nonzero__() ? t$0$PyObject : frame.getglobal("None");
758 private static PyObject _formatCmd$39(PyFrame frame) {
759 /* Format a command for execution in a shell. */
760 if (frame.getlocal(0).__getattr__("cmd")._is(frame.getglobal("None")).__nonzero__()) {
761 frame.setlocal(2, s$38);
762 throw Py.makeException(frame.getglobal("OSError").__call__(i$13, frame.getlocal(2)._mod(new PyTuple(new PyObject[] {frame.getglobal("_osType"), frame.getglobal("_envType"), frame.getlocal(1)}))));
764 return frame.getlocal(0).__getattr__("cmd")._add(new PyList(new PyObject[] {frame.getlocal(1)}));
767 private static PyObject _formatEnvironment$40(PyFrame frame) {
768 // Temporary Variables
770 PyObject t$0$PyObject, t$1$PyObject;
773 /* Format enviroment in lines suitable for Runtime.exec */
774 frame.setlocal(2, new PyList(new PyObject[] {}));
776 t$1$PyObject = frame.getlocal(1).invoke("items");
777 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
778 frame.setlocal(3, t$0$PyObject);
779 frame.getlocal(2).invoke("append", s$40._mod(frame.getlocal(3)));
781 return frame.getlocal(2);
784 private static PyObject _getEnvironment$41(PyFrame frame) {
785 // Temporary Variables
787 PyException t$0$PyException;
788 PyObject t$0$PyObject, t$1$PyObject;
791 /* Get the environment variables by spawning a subshell.
792 This allows multi-line variables as long as subsequent lines do
795 frame.setlocal(3, new PyDictionary(new PyObject[] {}));
796 if (frame.getlocal(0).__getattr__("getEnv").__nonzero__()) {
798 frame.setlocal(1, frame.getlocal(0).invoke("execute", frame.getlocal(0).__getattr__("getEnv")));
799 frame.setlocal(7, frame.getlocal(0).invoke("_readLines", frame.getlocal(1).invoke("getInputStream")));
800 if (s$42._notin(frame.getlocal(7).__getitem__(i$13)).__nonzero__()) {
801 Py.println(s$43._mod(new PyTuple(new PyObject[] {frame.getlocal(0).__getattr__("getEnv"), s$33.invoke("join", frame.getlocal(7))})));
802 return frame.getlocal(3);
805 t$1$PyObject = frame.getlocal(7);
806 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
807 frame.setlocal(8, t$0$PyObject);
809 frame.setlocal(2, frame.getlocal(8).invoke("index", s$42));
810 frame.setlocal(6, frame.getlocal(0).invoke("_keyTransform", frame.getlocal(8).__getslice__(null, frame.getlocal(2), null)));
811 frame.setlocal(5, frame.getlocal(8).__getslice__(frame.getlocal(2)._add(i$27), null, null));
813 catch (Throwable x$0) {
814 t$0$PyException = Py.setException(x$0, frame);
815 if (Py.matchException(t$0$PyException, frame.getglobal("ValueError"))) {
816 frame.setlocal(5, s$44._mod(new PyTuple(new PyObject[] {frame.getlocal(5), frame.getlocal(8)})));
818 else throw t$0$PyException;
820 frame.getlocal(3).__setitem__(frame.getlocal(6), frame.getlocal(5));
823 catch (Throwable x$1) {
824 t$0$PyException = Py.setException(x$1, frame);
825 if (Py.matchException(t$0$PyException, frame.getglobal("OSError"))) {
826 frame.setlocal(4, t$0$PyException.value);
828 Py.println(frame.getlocal(4));
830 else throw t$0$PyException;
833 return frame.getlocal(3);
836 private static PyObject _ShellEnv$42(PyFrame frame) {
837 /* Provide environment derived by spawning a subshell and parsing its
838 environment. Also supports system functions and provides empty
839 environment support for platforms with unknown shell
842 frame.setlocal("__init__", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None"), frame.getname("None"), frame.getname("None")}, c$32___init__));
843 frame.setlocal("system", new PyFunction(frame.f_globals, new PyObject[] {}, c$35_system));
844 frame.setlocal("execute", new PyFunction(frame.f_globals, new PyObject[] {}, c$36_execute));
845 frame.setlocal("_readLines", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None")}, c$37__readLines));
846 frame.setlocal("_formatCmd", new PyFunction(frame.f_globals, new PyObject[] {}, c$38__formatCmd));
847 frame.setlocal("_formatEnvironment", new PyFunction(frame.f_globals, new PyObject[] {}, c$39__formatEnvironment));
848 frame.setlocal("_getEnvironment", new PyFunction(frame.f_globals, new PyObject[] {}, c$40__getEnvironment));
849 return frame.getf_locals();
852 private static PyObject _getOsType$43(PyFrame frame) {
853 // Temporary Variables
855 PyObject[] t$0$PyObject__;
856 PyObject t$0$PyObject, t$1$PyObject;
859 /* Select the OS behavior based on os argument, 'python.os' registry
860 setting and 'os.name' Java property.
861 os: explicitly select desired OS. os=None to autodetect, os='None' to
864 frame.setlocal(0, (t$0$PyObject = ((t$1$PyObject = frame.getlocal(0)).__nonzero__() ? t$1$PyObject : frame.getglobal("sys").__getattr__("registry").__getattr__("getProperty").__call__(s$47))).__nonzero__() ? t$0$PyObject : frame.getglobal("java").__getattr__("lang").__getattr__("System").__getattr__("getProperty").__call__(s$48));
865 frame.setlocal(3, new PyTuple(new PyObject[] {new PyTuple(new PyObject[] {s$49, s$50}), new PyTuple(new PyObject[] {s$51, s$52}), new PyTuple(new PyObject[] {s$53, s$54}), new PyTuple(new PyObject[] {s$55, s$56}), new PyTuple(new PyObject[] {s$57, s$58})}));
867 t$1$PyObject = frame.getlocal(3);
868 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
869 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$0$PyObject, 2);
870 frame.setlocal(1, t$0$PyObject__[0]);
871 frame.setlocal(2, t$0$PyObject__[1]);
872 if (frame.getglobal("re").__getattr__("match").__call__(frame.getlocal(2), frame.getlocal(0)).__nonzero__()) {
876 return frame.getlocal(1);
879 private static PyObject _getShellEnv$44(PyFrame frame) {
880 /* Create the desired environment type.
881 envType: 'shell' or None
883 if (frame.getlocal(0)._eq(s$60).__nonzero__()) {
884 return frame.getglobal("_ShellEnv").__call__(frame.getlocal(1), frame.getlocal(2), frame.getlocal(3));
887 return frame.getglobal("_ShellEnv").__call__();
891 private static PyObject _testGetOsType$45(PyFrame frame) {
892 // Temporary Variables
894 PyObject[] t$0$PyObject__;
895 PyObject t$0$PyObject, t$1$PyObject;
898 frame.setlocal(2, new PyDictionary(new PyObject[] {s$71, s$49, s$72, s$51, s$73, s$53, s$74, s$57, s$75, s$57, s$55, s$55}));
899 frame.setlocal(3, s$76);
901 t$1$PyObject = frame.getlocal(2).invoke("items");
902 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
903 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$0$PyObject, 2);
904 frame.setlocal(1, t$0$PyObject__[0]);
905 frame.setlocal(4, t$0$PyObject__[1]);
906 frame.setlocal(0, frame.getglobal("_getOsType").__call__(frame.getlocal(1)));
907 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getlocal(0)._eq(frame.getlocal(4)), frame.getlocal(3)._mod(new PyTuple(new PyObject[] {frame.getlocal(1), frame.getlocal(4), frame.getlocal(0)})));
912 private static PyObject _testCmds$46(PyFrame frame) {
913 // Temporary Variables
915 PyObject[] t$0$PyObject__;
916 PyObject t$0$PyObject, t$1$PyObject;
920 t$1$PyObject = frame.getlocal(1);
921 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
922 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$0$PyObject, 2);
923 frame.setlocal(5, t$0$PyObject__[0]);
924 frame.setlocal(4, t$0$PyObject__[1]);
925 Py.println(s$77._mod(new PyTuple(new PyObject[] {frame.getlocal(5), frame.getlocal(2)})));
926 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getlocal(0).invoke("system", frame.getlocal(5)).__not__(), s$78._mod(new PyTuple(new PyObject[] {frame.getlocal(5), frame.getlocal(2)})));
927 frame.setlocal(3, frame.getlocal(0).invoke("_readLines", frame.getlocal(0).invoke("execute", frame.getlocal(5)).invoke("getInputStream")).__getitem__(i$13));
928 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getglobal("re").__getattr__("match").__call__(frame.getlocal(4), frame.getlocal(3)), s$79._mod(new PyTuple(new PyObject[] {frame.getlocal(4), frame.getlocal(3)})));
933 private static PyObject _testSystem$47(PyFrame frame) {
934 // Temporary Variables
935 PyObject[] t$0$PyObject__;
938 t$0$PyObject__ = org.python.core.Py.unpackSequence(new PyTuple(new PyObject[] {s$80, s$81}), 2);
939 frame.setlocal(3, t$0$PyObject__[0]);
940 frame.setlocal(2, t$0$PyObject__[1]);
941 frame.setlocal(4, frame.getglobal("environ"));
942 frame.setlocal(1, new PyList(new PyObject[] {new PyTuple(new PyObject[] {s$82, s$83}), new PyTuple(new PyObject[] {s$84, s$85}), new PyTuple(new PyObject[] {s$86._mod(new PyTuple(new PyObject[] {frame.getlocal(3), frame.getlocal(3)})), s$87._mod(new PyTuple(new PyObject[] {frame.getlocal(3)}))}), new PyTuple(new PyObject[] {s$88, s$89}), new PyTuple(new PyObject[] {s$90._mod(new PyTuple(new PyObject[] {frame.getlocal(3), frame.getlocal(3)})), s$91._mod(new PyTuple(new PyObject[] {frame.getlocal(3), frame.getlocal(3), frame.getlocal(3), frame.getlocal(3), frame.getlocal(2)}))}), new PyTuple(new PyObject[] {s$92, s$93}), new PyTuple(new PyObject[] {s$94, s$95}), new PyTuple(new PyObject[] {s$96, s$97})}));
943 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getglobal("environ").__getattr__("_populated").__not__(), s$98);
944 frame.getglobal("_testCmds").__call__(frame.getglobal("_shellEnv"), frame.getlocal(1), s$99);
945 frame.getglobal("environ").__setitem__(frame.getlocal(3), frame.getlocal(2));
946 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getglobal("environ").__getattr__("_populated"), s$100);
947 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getlocal(4).invoke("get", frame.getlocal(3), frame.getglobal("None"))._eq(frame.getlocal(2)), s$101._mod(frame.getlocal(3)));
948 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getglobal("environ").invoke("get", frame.getlocal(3), frame.getglobal("None"))._eq(frame.getlocal(2)), s$102._mod(frame.getlocal(3)));
949 frame.getglobal("_testCmds").__call__(frame.getglobal("_shellEnv"), frame.getlocal(1), s$103);
950 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getglobal("environ").invoke("has_key", s$104), s$105);
954 private static PyObject _testBadShell$48(PyFrame frame) {
955 frame.setlocal(0, frame.getglobal("_ShellEnv").__call__(new PyList(new PyObject[] {s$106, s$67}), s$64));
956 frame.getglobal("str").__call__(frame.getlocal(0).__getattr__("environment"));
957 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getlocal(0).__getattr__("environment").invoke("items").__not__(), s$107);
961 private static PyObject _testBadGetEnv$49(PyFrame frame) {
962 frame.setlocal(0, frame.getglobal("_getShellEnv").__call__(new PyObject[] {s$60, frame.getglobal("_shellCmd"), frame.getglobal("_envCmd"), frame.getglobal("_envTransform")}));
963 frame.getlocal(0).__setattr__("getEnv", s$108);
964 frame.getglobal("str").__call__(frame.getlocal(0).__getattr__("environment"));
965 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getlocal(0).__getattr__("environment").invoke("items").__not__(), s$107);
969 private static PyObject _test$50(PyFrame frame) {
970 frame.getglobal("_testGetOsType").__call__();
971 frame.getglobal("_testBadShell").__call__();
972 frame.getglobal("_testBadGetEnv").__call__();
973 frame.getglobal("_testSystem").__call__();
977 private static PyObject main$51(PyFrame frame) {
978 frame.setglobal("__file__", s$109);
982 /* OS routines for Java, with some attempts to support DOS, NT, and
986 - all functions from posix, nt, dos, os2, mac, or ce, e.g. unlink, stat, etc.
987 - os.path is one of the modules posixpath, ntpath, macpath, or dospath
988 - os.name is 'posix', 'nt', 'dos', 'os2', 'mac', 'ce' or 'riscos'
989 - os.curdir is a string representing the current directory ('.' or ':')
990 - os.pardir is a string representing the parent directory ('..' or '::')
991 - os.sep is the (or a most common) pathname separator ('/' or ':' or '\\')
992 - os.altsep is the alternate pathname separator (None or '/')
993 - os.pathsep is the component separator used in $PATH etc
994 - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
995 - os.defpath is the default search path for executables
997 Programs that import and use 'os' stand a better chance of being
998 portable between different platforms. Of course, they must then
999 only use functions that are defined by all platforms (e.g., unlink
1000 and opendir), and leave all pathname manipulation to os.path
1001 (e.g., split and join).
1003 frame.setlocal("__all__", new PyList(new PyObject[] {s$1, s$2, s$3, s$4, s$5, s$6, s$7, s$8}));
1004 frame.setlocal("java", org.python.core.imp.importOne("java", frame));
1005 imp_accu = org.python.core.imp.importFrom("java.io", new String[] {"File", "BufferedReader", "InputStreamReader", "IOException"}, frame);
1006 frame.setlocal("File", imp_accu[0]);
1007 frame.setlocal("BufferedReader", imp_accu[1]);
1008 frame.setlocal("InputStreamReader", imp_accu[2]);
1009 frame.setlocal("IOException", imp_accu[3]);
1011 frame.setlocal("path", org.python.core.imp.importOneAs("javapath", frame));
1012 imp_accu = org.python.core.imp.importFrom("UserDict", new String[] {"UserDict"}, frame);
1013 frame.setlocal("UserDict", imp_accu[0]);
1015 frame.setlocal("string", org.python.core.imp.importOne("string", frame));
1016 frame.setlocal("exceptions", org.python.core.imp.importOne("exceptions", frame));
1017 frame.setlocal("re", org.python.core.imp.importOne("re", frame));
1018 frame.setlocal("sys", org.python.core.imp.importOne("sys", frame));
1019 frame.setlocal("thread", org.python.core.imp.importOne("thread", frame));
1020 frame.setlocal("error", frame.getname("OSError"));
1021 frame.setlocal("name", s$9);
1022 frame.setlocal("curdir", s$10);
1023 frame.setlocal("pardir", s$11);
1024 frame.setlocal("sep", frame.getname("java").__getattr__("io").__getattr__("File").__getattr__("separator"));
1025 frame.setlocal("altsep", frame.getname("None"));
1026 frame.setlocal("pathsep", frame.getname("java").__getattr__("io").__getattr__("File").__getattr__("pathSeparator"));
1027 frame.setlocal("defpath", s$10);
1028 frame.setlocal("linesep", frame.getname("java").__getattr__("lang").__getattr__("System").__getattr__("getProperty").__call__(s$12));
1029 frame.setlocal("_exit", new PyFunction(frame.f_globals, new PyObject[] {i$13}, c$0__exit));
1030 frame.setlocal("getcwd", new PyFunction(frame.f_globals, new PyObject[] {}, c$1_getcwd));
1031 frame.setlocal("chdir", new PyFunction(frame.f_globals, new PyObject[] {}, c$2_chdir));
1032 frame.setlocal("listdir", new PyFunction(frame.f_globals, new PyObject[] {}, c$3_listdir));
1033 frame.setlocal("mkdir", new PyFunction(frame.f_globals, new PyObject[] {s$18}, c$4_mkdir));
1034 frame.setlocal("makedirs", new PyFunction(frame.f_globals, new PyObject[] {s$18}, c$5_makedirs));
1035 frame.setlocal("remove", new PyFunction(frame.f_globals, new PyObject[] {}, c$6_remove));
1036 frame.setlocal("rename", new PyFunction(frame.f_globals, new PyObject[] {}, c$7_rename));
1037 frame.setlocal("rmdir", new PyFunction(frame.f_globals, new PyObject[] {}, c$8_rmdir));
1038 frame.setlocal("unlink", frame.getname("remove"));
1039 frame.setlocal("stat", new PyFunction(frame.f_globals, new PyObject[] {}, c$9_stat));
1040 frame.setlocal("utime", new PyFunction(frame.f_globals, new PyObject[] {}, c$10_utime));
1041 frame.setlocal("LazyDict", Py.makeClass("LazyDict", new PyObject[] {frame.getname("UserDict")}, c$31_LazyDict, null));
1042 frame.setlocal("_ShellEnv", Py.makeClass("_ShellEnv", new PyObject[] {}, c$41__ShellEnv, null));
1043 frame.setlocal("_getOsType", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None")}, c$42__getOsType));
1044 frame.setlocal("_getShellEnv", new PyFunction(frame.f_globals, new PyObject[] {}, c$43__getShellEnv));
1045 frame.setlocal("_osType", frame.getname("_getOsType").__call__());
1046 frame.setlocal("_envType", frame.getname("sys").__getattr__("registry").__getattr__("getProperty").__call__(s$61, s$60));
1047 frame.setlocal("_shellCmd", frame.getname("None"));
1048 frame.setlocal("_envCmd", frame.getname("None"));
1049 frame.setlocal("_envTransform", frame.getname("None"));
1050 if (frame.getname("_osType")._eq(s$49).__nonzero__()) {
1051 frame.setlocal("_shellCmd", new PyList(new PyObject[] {s$62, s$63}));
1052 frame.setlocal("_envCmd", s$64);
1053 frame.setlocal("_envTransform", frame.getname("string").__getattr__("upper"));
1055 else if (frame.getname("_osType")._eq(s$51).__nonzero__()) {
1056 frame.setlocal("_shellCmd", new PyList(new PyObject[] {s$65, s$63}));
1057 frame.setlocal("_envCmd", s$64);
1058 frame.setlocal("_envTransform", frame.getname("string").__getattr__("upper"));
1060 else if (frame.getname("_osType")._eq(s$57).__nonzero__()) {
1061 frame.setlocal("_shellCmd", new PyList(new PyObject[] {s$66, s$67}));
1062 frame.setlocal("_envCmd", s$68);
1064 else if (frame.getname("_osType")._eq(s$53).__nonzero__()) {
1065 frame.setlocal("curdir", s$69);
1066 frame.setlocal("pardir", s$70);
1068 else if (frame.getname("_osType")._eq(s$55).__nonzero__()) {
1071 frame.setlocal("_shellEnv", frame.getname("_getShellEnv").__call__(new PyObject[] {frame.getname("_envType"), frame.getname("_shellCmd"), frame.getname("_envCmd"), frame.getname("_envTransform")}));
1072 frame.setlocal("environ", frame.getname("_shellEnv").__getattr__("environment"));
1073 frame.setlocal("putenv", frame.getname("environ").__getattr__("__setitem__"));
1074 frame.setlocal("getenv", frame.getname("environ").__getattr__("__getitem__"));
1075 frame.setlocal("system", frame.getname("_shellEnv").__getattr__("system"));
1076 frame.setlocal("_testGetOsType", new PyFunction(frame.f_globals, new PyObject[] {}, c$44__testGetOsType));
1077 frame.setlocal("_testCmds", new PyFunction(frame.f_globals, new PyObject[] {}, c$45__testCmds));
1078 frame.setlocal("_testSystem", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("_shellEnv")}, c$46__testSystem));
1079 frame.setlocal("_testBadShell", new PyFunction(frame.f_globals, new PyObject[] {}, c$47__testBadShell));
1080 frame.setlocal("_testBadGetEnv", new PyFunction(frame.f_globals, new PyObject[] {}, c$48__testBadGetEnv));
1081 frame.setlocal("_test", new PyFunction(frame.f_globals, new PyObject[] {}, c$49__test));
1086 public static void moduleDictInit(PyObject dict) {
1087 dict.__setitem__("__name__", new PyString("javaos"));
1088 Py.runCode(new _PyInner().getMain(), dict, dict);
1091 public static void main(String[] args) throws java.lang.Exception {
1092 String[] newargs = new String[args.length+1];
1093 newargs[0] = "javaos";
1094 System.arraycopy(args, 0, newargs, 1, args.length);
1095 Py.runMain(javaos._PyInner.class, newargs, javaos.jpy$packages, javaos.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"});