(no commit message)
[sfa.git] / server / jpywork / string.java
1 import org.python.core.*;
2
3 public class string 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 i$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 i$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 s$25;
35         private static PyObject s$26;
36         private static PyObject s$27;
37         private static PyObject i$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 i$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 i$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 PyFunctionTable funcTable;
60         private static PyCode c$0_lower;
61         private static PyCode c$1_upper;
62         private static PyCode c$2_swapcase;
63         private static PyCode c$3_strip;
64         private static PyCode c$4_lstrip;
65         private static PyCode c$5_rstrip;
66         private static PyCode c$6_split;
67         private static PyCode c$7_join;
68         private static PyCode c$8_index;
69         private static PyCode c$9_rindex;
70         private static PyCode c$10_count;
71         private static PyCode c$11_find;
72         private static PyCode c$12_rfind;
73         private static PyCode c$13_atof;
74         private static PyCode c$14_atoi;
75         private static PyCode c$15_atol;
76         private static PyCode c$16_ljust;
77         private static PyCode c$17_rjust;
78         private static PyCode c$18_center;
79         private static PyCode c$19_zfill;
80         private static PyCode c$20_expandtabs;
81         private static PyCode c$21_translate;
82         private static PyCode c$22_capitalize;
83         private static PyCode c$23_capwords;
84         private static PyCode c$24_maketrans;
85         private static PyCode c$25_replace;
86         private static PyCode c$26_main;
87         private static void initConstants() {
88             s$0 = Py.newString("Common string manipulations.\012\012Public module variables:\012\012whitespace -- a string containing all characters considered whitespace\012lowercase -- a string containing all characters considered lowercase letters\012uppercase -- a string containing all characters considered uppercase letters\012letters -- a string containing all characters considered letters\012digits -- a string containing all characters considered decimal digits\012hexdigits -- a string containing all characters considered hexadecimal digits\012octdigits -- a string containing all characters considered octal digits\012\012");
89             s$1 = Py.newString(" \011\012\015\013\014");
90             s$2 = Py.newString("abcdefghijklmnopqrstuvwxyz");
91             s$3 = Py.newString("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
92             s$4 = Py.newString("0123456789");
93             s$5 = Py.newString("abcdef");
94             s$6 = Py.newString("ABCDEF");
95             s$7 = Py.newString("01234567");
96             s$8 = Py.newString("");
97             i$9 = Py.newInteger(256);
98             s$10 = Py.newString("lower(s) -> string\012\012    Return a copy of the string s converted to lowercase.\012\012    ");
99             s$11 = Py.newString("upper(s) -> string\012\012    Return a copy of the string s converted to uppercase.\012\012    ");
100             s$12 = Py.newString("swapcase(s) -> string\012\012    Return a copy of the string s with upper case characters\012    converted to lowercase and vice versa.\012\012    ");
101             s$13 = Py.newString("strip(s) -> string\012\012    Return a copy of the string s with leading and trailing\012    whitespace removed.\012\012    ");
102             s$14 = Py.newString("lstrip(s) -> string\012\012    Return a copy of the string s with leading whitespace removed.\012\012    ");
103             s$15 = Py.newString("rstrip(s) -> string\012\012    Return a copy of the string s with trailing whitespace\012    removed.\012\012    ");
104             s$16 = Py.newString("split(str [,sep [,maxsplit]]) -> list of strings\012\012    Return a list of the words in the string s, using sep as the\012    delimiter string.  If maxsplit is nonzero, splits into at most\012    maxsplit words If sep is not specified, any whitespace string\012    is a separator.  Maxsplit defaults to -1.\012\012    (split and splitfields are synonymous)\012\012    ");
105             i$17 = Py.newInteger(1);
106             s$18 = Py.newString("join(list [,sep]) -> string\012\012    Return a string composed of the words in list, with\012    intervening occurences of sep.  The default separator is a\012    single space.\012\012    (joinfields and join are synonymous)\012\012    ");
107             s$19 = Py.newString(" ");
108             s$20 = Py.newString("index(s, sub [,start [,end]]) -> int\012\012    Like find but raises ValueError when the substring is not found.\012\012    ");
109             s$21 = Py.newString("rindex(s, sub [,start [,end]]) -> int\012\012    Like rfind but raises ValueError when the substring is not found.\012\012    ");
110             s$22 = Py.newString("count(s, sub[, start[,end]]) -> int\012\012    Return the number of occurrences of substring sub in string\012    s[start:end].  Optional arguments start and end are\012    interpreted as in slice notation.\012\012    ");
111             s$23 = Py.newString("find(s, sub [,start [,end]]) -> in\012\012    Return the lowest index in s where substring sub is found,\012    such that sub is contained within s[start,end].  Optional\012    arguments start and end are interpreted as in slice notation.\012\012    Return -1 on failure.\012\012    ");
112             s$24 = Py.newString("rfind(s, sub [,start [,end]]) -> int\012\012    Return the highest index in s where substring sub is found,\012    such that sub is contained within s[start,end].  Optional\012    arguments start and end are interpreted as in slice notation.\012\012    Return -1 on failure.\012\012    ");
113             s$25 = Py.newString("atof(s) -> float\012\012    Return the floating point number represented by the string s.\012\012    ");
114             s$26 = Py.newString("argument 1: expected string, %s found");
115             s$27 = Py.newString("atoi(s [,base]) -> int\012\012    Return the integer represented by the string s in the given\012    base, which defaults to 10.  The string s must consist of one\012    or more digits, possibly preceded by a sign.  If base is 0, it\012    is chosen from the leading characters of s, 0 for octal, 0x or\012    0X for hexadecimal.  If base is 16, a preceding 0x or 0X is\012    accepted.\012\012    ");
116             i$28 = Py.newInteger(0);
117             s$29 = Py.newString("function requires at least 1 argument: %d given");
118             s$30 = Py.newString("atol(s [,base]) -> long\012\012    Return the long integer represented by the string s in the\012    given base, which defaults to 10.  The string s must consist\012    of one or more digits, possibly preceded by a sign.  If base\012    is 0, it is chosen from the leading characters of s, 0 for\012    octal, 0x or 0X for hexadecimal.  If base is 16, a preceding\012    0x or 0X is accepted.  A trailing L or l is not accepted,\012    unless base is 0.\012\012    ");
119             s$31 = Py.newString("ljust(s, width) -> string\012\012    Return a left-justified version of s, in a field of the\012    specified width, padded with spaces as needed.  The string is\012    never truncated.\012\012    ");
120             s$32 = Py.newString("rjust(s, width) -> string\012\012    Return a right-justified version of s, in a field of the\012    specified width, padded with spaces as needed.  The string is\012    never truncated.\012\012    ");
121             s$33 = Py.newString("center(s, width) -> string\012\012    Return a center version of s, in a field of the specified\012    width. padded with spaces as needed.  The string is never\012    truncated.\012\012    ");
122             i$34 = Py.newInteger(2);
123             s$35 = Py.newString("zfill(x, width) -> string\012\012    Pad a numeric string x with zeros on the left, to fill a field\012    of the specified width.  The string x is never truncated.\012\012    ");
124             s$36 = Py.newString("-");
125             s$37 = Py.newString("+");
126             s$38 = Py.newString("0");
127             s$39 = Py.newString("expandtabs(s [,tabsize]) -> string\012\012    Return a copy of the string s with all tab characters replaced\012    by the appropriate number of spaces, depending on the current\012    column, and the tabsize (default 8).\012\012    ");
128             s$40 = Py.newString("\011");
129             s$41 = Py.newString("\012");
130             i$42 = Py.newInteger(8);
131             s$43 = Py.newString("translate(s,table [,deletechars]) -> string\012\012    Return a copy of the string s, where all characters occurring\012    in the optional argument deletechars are removed, and the\012    remaining characters have been mapped through the given\012    translation table, which must be a string of length 256.\012\012    ");
132             s$44 = Py.newString("capitalize(s) -> string\012\012    Return a copy of the string s with only its first character\012    capitalized.\012\012    ");
133             s$45 = Py.newString("capwords(s, [sep]) -> string\012\012    Split the argument into words using split, capitalize each\012    word using capitalize, and join the capitalized words using\012    join. Note that this replaces runs of whitespace characters by\012    a single space.\012\012    ");
134             s$46 = Py.newString("maketrans(frm, to) -> string\012\012    Return a translation table (a string of 256 bytes long)\012    suitable for use in string.translate.  The strings frm and to\012    must be of the same length.\012\012    ");
135             s$47 = Py.newString("maketrans arguments must have same length");
136             s$48 = Py.newString("replace (str, old, new[, maxsplit]) -> string\012\012    Return a copy of string str with all occurrences of substring\012    old replaced by new. If the optional argument maxsplit is\012    given, only the first maxsplit occurrences are replaced.\012\012    ");
137             s$49 = Py.newString("/usr/share/jython/Lib/string.py");
138             funcTable = new _PyInner();
139             c$0_lower = Py.newCode(1, new String[] {"s"}, "/usr/share/jython/Lib/string.py", "lower", false, false, funcTable, 0, null, null, 0, 1);
140             c$1_upper = Py.newCode(1, new String[] {"s"}, "/usr/share/jython/Lib/string.py", "upper", false, false, funcTable, 1, null, null, 0, 1);
141             c$2_swapcase = Py.newCode(1, new String[] {"s"}, "/usr/share/jython/Lib/string.py", "swapcase", false, false, funcTable, 2, null, null, 0, 1);
142             c$3_strip = Py.newCode(1, new String[] {"s"}, "/usr/share/jython/Lib/string.py", "strip", false, false, funcTable, 3, null, null, 0, 1);
143             c$4_lstrip = Py.newCode(1, new String[] {"s"}, "/usr/share/jython/Lib/string.py", "lstrip", false, false, funcTable, 4, null, null, 0, 1);
144             c$5_rstrip = Py.newCode(1, new String[] {"s"}, "/usr/share/jython/Lib/string.py", "rstrip", false, false, funcTable, 5, null, null, 0, 1);
145             c$6_split = Py.newCode(3, new String[] {"s", "sep", "maxsplit"}, "/usr/share/jython/Lib/string.py", "split", false, false, funcTable, 6, null, null, 0, 1);
146             c$7_join = Py.newCode(2, new String[] {"words", "sep"}, "/usr/share/jython/Lib/string.py", "join", false, false, funcTable, 7, null, null, 0, 1);
147             c$8_index = Py.newCode(2, new String[] {"s", "args"}, "/usr/share/jython/Lib/string.py", "index", true, false, funcTable, 8, null, null, 0, 1);
148             c$9_rindex = Py.newCode(2, new String[] {"s", "args"}, "/usr/share/jython/Lib/string.py", "rindex", true, false, funcTable, 9, null, null, 0, 1);
149             c$10_count = Py.newCode(2, new String[] {"s", "args"}, "/usr/share/jython/Lib/string.py", "count", true, false, funcTable, 10, null, null, 0, 1);
150             c$11_find = Py.newCode(2, new String[] {"s", "args"}, "/usr/share/jython/Lib/string.py", "find", true, false, funcTable, 11, null, null, 0, 1);
151             c$12_rfind = Py.newCode(2, new String[] {"s", "args"}, "/usr/share/jython/Lib/string.py", "rfind", true, false, funcTable, 12, null, null, 0, 1);
152             c$13_atof = Py.newCode(1, new String[] {"s"}, "/usr/share/jython/Lib/string.py", "atof", false, false, funcTable, 13, null, null, 0, 1);
153             c$14_atoi = Py.newCode(1, new String[] {"args", "s"}, "/usr/share/jython/Lib/string.py", "atoi", true, false, funcTable, 14, null, null, 0, 1);
154             c$15_atol = Py.newCode(1, new String[] {"args", "s"}, "/usr/share/jython/Lib/string.py", "atol", true, false, funcTable, 15, null, null, 0, 1);
155             c$16_ljust = Py.newCode(2, new String[] {"s", "width", "n"}, "/usr/share/jython/Lib/string.py", "ljust", false, false, funcTable, 16, null, null, 0, 1);
156             c$17_rjust = Py.newCode(2, new String[] {"s", "width", "n"}, "/usr/share/jython/Lib/string.py", "rjust", false, false, funcTable, 17, null, null, 0, 1);
157             c$18_center = Py.newCode(2, new String[] {"s", "width", "half", "n"}, "/usr/share/jython/Lib/string.py", "center", false, false, funcTable, 18, null, null, 0, 1);
158             c$19_zfill = Py.newCode(2, new String[] {"x", "width", "sign", "s", "n"}, "/usr/share/jython/Lib/string.py", "zfill", false, false, funcTable, 19, null, null, 0, 1);
159             c$20_expandtabs = Py.newCode(2, new String[] {"s", "tabsize", "line", "res", "c"}, "/usr/share/jython/Lib/string.py", "expandtabs", false, false, funcTable, 20, null, null, 0, 1);
160             c$21_translate = Py.newCode(3, new String[] {"s", "table", "deletions"}, "/usr/share/jython/Lib/string.py", "translate", false, false, funcTable, 21, null, null, 0, 1);
161             c$22_capitalize = Py.newCode(1, new String[] {"s"}, "/usr/share/jython/Lib/string.py", "capitalize", false, false, funcTable, 22, null, null, 0, 1);
162             c$23_capwords = Py.newCode(2, new String[] {"s", "sep"}, "/usr/share/jython/Lib/string.py", "capwords", false, false, funcTable, 23, null, null, 0, 1);
163             c$24_maketrans = Py.newCode(2, new String[] {"fromstr", "tostr", "i", "L"}, "/usr/share/jython/Lib/string.py", "maketrans", false, false, funcTable, 24, null, null, 0, 1);
164             c$25_replace = Py.newCode(4, new String[] {"s", "old", "new", "maxsplit"}, "/usr/share/jython/Lib/string.py", "replace", false, false, funcTable, 25, null, null, 0, 1);
165             c$26_main = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib/string.py", "main", false, false, funcTable, 26, null, null, 0, 0);
166         }
167         
168         
169         public PyCode getMain() {
170             if (c$26_main == null) _PyInner.initConstants();
171             return c$26_main;
172         }
173         
174         public PyObject call_function(int index, PyFrame frame) {
175             switch (index){
176                 case 0:
177                 return _PyInner.lower$1(frame);
178                 case 1:
179                 return _PyInner.upper$2(frame);
180                 case 2:
181                 return _PyInner.swapcase$3(frame);
182                 case 3:
183                 return _PyInner.strip$4(frame);
184                 case 4:
185                 return _PyInner.lstrip$5(frame);
186                 case 5:
187                 return _PyInner.rstrip$6(frame);
188                 case 6:
189                 return _PyInner.split$7(frame);
190                 case 7:
191                 return _PyInner.join$8(frame);
192                 case 8:
193                 return _PyInner.index$9(frame);
194                 case 9:
195                 return _PyInner.rindex$10(frame);
196                 case 10:
197                 return _PyInner.count$11(frame);
198                 case 11:
199                 return _PyInner.find$12(frame);
200                 case 12:
201                 return _PyInner.rfind$13(frame);
202                 case 13:
203                 return _PyInner.atof$14(frame);
204                 case 14:
205                 return _PyInner.atoi$15(frame);
206                 case 15:
207                 return _PyInner.atol$16(frame);
208                 case 16:
209                 return _PyInner.ljust$17(frame);
210                 case 17:
211                 return _PyInner.rjust$18(frame);
212                 case 18:
213                 return _PyInner.center$19(frame);
214                 case 19:
215                 return _PyInner.zfill$20(frame);
216                 case 20:
217                 return _PyInner.expandtabs$21(frame);
218                 case 21:
219                 return _PyInner.translate$22(frame);
220                 case 22:
221                 return _PyInner.capitalize$23(frame);
222                 case 23:
223                 return _PyInner.capwords$24(frame);
224                 case 24:
225                 return _PyInner.maketrans$25(frame);
226                 case 25:
227                 return _PyInner.replace$26(frame);
228                 case 26:
229                 return _PyInner.main$27(frame);
230                 default:
231                 return null;
232             }
233         }
234         
235         private static PyObject lower$1(PyFrame frame) {
236             /* lower(s) -> string
237             
238                 Return a copy of the string s converted to lowercase.
239             
240                  */
241             return frame.getlocal(0).invoke("lower");
242         }
243         
244         private static PyObject upper$2(PyFrame frame) {
245             /* upper(s) -> string
246             
247                 Return a copy of the string s converted to uppercase.
248             
249                  */
250             return frame.getlocal(0).invoke("upper");
251         }
252         
253         private static PyObject swapcase$3(PyFrame frame) {
254             /* swapcase(s) -> string
255             
256                 Return a copy of the string s with upper case characters
257                 converted to lowercase and vice versa.
258             
259                  */
260             return frame.getlocal(0).invoke("swapcase");
261         }
262         
263         private static PyObject strip$4(PyFrame frame) {
264             /* strip(s) -> string
265             
266                 Return a copy of the string s with leading and trailing
267                 whitespace removed.
268             
269                  */
270             return frame.getlocal(0).invoke("strip");
271         }
272         
273         private static PyObject lstrip$5(PyFrame frame) {
274             /* lstrip(s) -> string
275             
276                 Return a copy of the string s with leading whitespace removed.
277             
278                  */
279             return frame.getlocal(0).invoke("lstrip");
280         }
281         
282         private static PyObject rstrip$6(PyFrame frame) {
283             /* rstrip(s) -> string
284             
285                 Return a copy of the string s with trailing whitespace
286                 removed.
287             
288                  */
289             return frame.getlocal(0).invoke("rstrip");
290         }
291         
292         private static PyObject split$7(PyFrame frame) {
293             /* split(str [,sep [,maxsplit]]) -> list of strings
294             
295                 Return a list of the words in the string s, using sep as the
296                 delimiter string.  If maxsplit is nonzero, splits into at most
297                 maxsplit words If sep is not specified, any whitespace string
298                 is a separator.  Maxsplit defaults to -1.
299             
300                 (split and splitfields are synonymous)
301             
302                  */
303             return frame.getlocal(0).invoke("split", frame.getlocal(1), frame.getlocal(2));
304         }
305         
306         private static PyObject join$8(PyFrame frame) {
307             /* join(list [,sep]) -> string
308             
309                 Return a string composed of the words in list, with
310                 intervening occurences of sep.  The default separator is a
311                 single space.
312             
313                 (joinfields and join are synonymous)
314             
315                  */
316             return frame.getlocal(1).invoke("join", frame.getlocal(0));
317         }
318         
319         private static PyObject index$9(PyFrame frame) {
320             /* index(s, sub [,start [,end]]) -> int
321             
322                 Like find but raises ValueError when the substring is not found.
323             
324                  */
325             return frame.getglobal("_apply").__call__(frame.getlocal(0).__getattr__("index"), frame.getlocal(1));
326         }
327         
328         private static PyObject rindex$10(PyFrame frame) {
329             /* rindex(s, sub [,start [,end]]) -> int
330             
331                 Like rfind but raises ValueError when the substring is not found.
332             
333                  */
334             return frame.getglobal("_apply").__call__(frame.getlocal(0).__getattr__("rindex"), frame.getlocal(1));
335         }
336         
337         private static PyObject count$11(PyFrame frame) {
338             /* count(s, sub[, start[,end]]) -> int
339             
340                 Return the number of occurrences of substring sub in string
341                 s[start:end].  Optional arguments start and end are
342                 interpreted as in slice notation.
343             
344                  */
345             return frame.getglobal("_apply").__call__(frame.getlocal(0).__getattr__("count"), frame.getlocal(1));
346         }
347         
348         private static PyObject find$12(PyFrame frame) {
349             /* find(s, sub [,start [,end]]) -> in
350             
351                 Return the lowest index in s where substring sub is found,
352                 such that sub is contained within s[start,end].  Optional
353                 arguments start and end are interpreted as in slice notation.
354             
355                 Return -1 on failure.
356             
357                  */
358             return frame.getglobal("_apply").__call__(frame.getlocal(0).__getattr__("find"), frame.getlocal(1));
359         }
360         
361         private static PyObject rfind$13(PyFrame frame) {
362             /* rfind(s, sub [,start [,end]]) -> int
363             
364                 Return the highest index in s where substring sub is found,
365                 such that sub is contained within s[start,end].  Optional
366                 arguments start and end are interpreted as in slice notation.
367             
368                 Return -1 on failure.
369             
370                  */
371             return frame.getglobal("_apply").__call__(frame.getlocal(0).__getattr__("rfind"), frame.getlocal(1));
372         }
373         
374         private static PyObject atof$14(PyFrame frame) {
375             /* atof(s) -> float
376             
377                 Return the floating point number represented by the string s.
378             
379                  */
380             if (frame.getglobal("type").__call__(frame.getlocal(0))._eq(frame.getglobal("_StringType")).__nonzero__()) {
381                 return frame.getglobal("_float").__call__(frame.getlocal(0));
382             }
383             else {
384                 throw Py.makeException(frame.getglobal("TypeError").__call__(s$26._mod(frame.getglobal("type").__call__(frame.getlocal(0)).__getattr__("__name__"))));
385             }
386         }
387         
388         private static PyObject atoi$15(PyFrame frame) {
389             // Temporary Variables
390             PyException t$0$PyException;
391             
392             // Code
393             /* atoi(s [,base]) -> int
394             
395                 Return the integer represented by the string s in the given
396                 base, which defaults to 10.  The string s must consist of one
397                 or more digits, possibly preceded by a sign.  If base is 0, it
398                 is chosen from the leading characters of s, 0 for octal, 0x or
399                 0X for hexadecimal.  If base is 16, a preceding 0x or 0X is
400                 accepted.
401             
402                  */
403             try {
404                 frame.setlocal(1, frame.getlocal(0).__getitem__(i$28));
405             }
406             catch (Throwable x$0) {
407                 t$0$PyException = Py.setException(x$0, frame);
408                 if (Py.matchException(t$0$PyException, frame.getglobal("IndexError"))) {
409                     throw Py.makeException(frame.getglobal("TypeError").__call__(s$29._mod(frame.getglobal("len").__call__(frame.getlocal(0)))));
410                 }
411                 else throw t$0$PyException;
412             }
413             if (frame.getglobal("type").__call__(frame.getlocal(1))._eq(frame.getglobal("_StringType")).__nonzero__()) {
414                 return frame.getglobal("_apply").__call__(frame.getglobal("_int"), frame.getlocal(0));
415             }
416             else {
417                 throw Py.makeException(frame.getglobal("TypeError").__call__(s$26._mod(frame.getglobal("type").__call__(frame.getlocal(1)).__getattr__("__name__"))));
418             }
419         }
420         
421         private static PyObject atol$16(PyFrame frame) {
422             // Temporary Variables
423             PyException t$0$PyException;
424             
425             // Code
426             /* atol(s [,base]) -> long
427             
428                 Return the long integer represented by the string s in the
429                 given base, which defaults to 10.  The string s must consist
430                 of one or more digits, possibly preceded by a sign.  If base
431                 is 0, it is chosen from the leading characters of s, 0 for
432                 octal, 0x or 0X for hexadecimal.  If base is 16, a preceding
433                 0x or 0X is accepted.  A trailing L or l is not accepted,
434                 unless base is 0.
435             
436                  */
437             try {
438                 frame.setlocal(1, frame.getlocal(0).__getitem__(i$28));
439             }
440             catch (Throwable x$0) {
441                 t$0$PyException = Py.setException(x$0, frame);
442                 if (Py.matchException(t$0$PyException, frame.getglobal("IndexError"))) {
443                     throw Py.makeException(frame.getglobal("TypeError").__call__(s$29._mod(frame.getglobal("len").__call__(frame.getlocal(0)))));
444                 }
445                 else throw t$0$PyException;
446             }
447             if (frame.getglobal("type").__call__(frame.getlocal(1))._eq(frame.getglobal("_StringType")).__nonzero__()) {
448                 return frame.getglobal("_apply").__call__(frame.getglobal("_long"), frame.getlocal(0));
449             }
450             else {
451                 throw Py.makeException(frame.getglobal("TypeError").__call__(s$26._mod(frame.getglobal("type").__call__(frame.getlocal(1)).__getattr__("__name__"))));
452             }
453         }
454         
455         private static PyObject ljust$17(PyFrame frame) {
456             /* ljust(s, width) -> string
457             
458                 Return a left-justified version of s, in a field of the
459                 specified width, padded with spaces as needed.  The string is
460                 never truncated.
461             
462                  */
463             frame.setlocal(2, frame.getlocal(1)._sub(frame.getglobal("len").__call__(frame.getlocal(0))));
464             if (frame.getlocal(2)._le(i$28).__nonzero__()) {
465                 return frame.getlocal(0);
466             }
467             return frame.getlocal(0)._add(s$19._mul(frame.getlocal(2)));
468         }
469         
470         private static PyObject rjust$18(PyFrame frame) {
471             /* rjust(s, width) -> string
472             
473                 Return a right-justified version of s, in a field of the
474                 specified width, padded with spaces as needed.  The string is
475                 never truncated.
476             
477                  */
478             frame.setlocal(2, frame.getlocal(1)._sub(frame.getglobal("len").__call__(frame.getlocal(0))));
479             if (frame.getlocal(2)._le(i$28).__nonzero__()) {
480                 return frame.getlocal(0);
481             }
482             return s$19._mul(frame.getlocal(2))._add(frame.getlocal(0));
483         }
484         
485         private static PyObject center$19(PyFrame frame) {
486             // Temporary Variables
487             PyObject t$0$PyObject;
488             
489             // Code
490             /* center(s, width) -> string
491             
492                 Return a center version of s, in a field of the specified
493                 width. padded with spaces as needed.  The string is never
494                 truncated.
495             
496                  */
497             frame.setlocal(3, frame.getlocal(1)._sub(frame.getglobal("len").__call__(frame.getlocal(0))));
498             if (frame.getlocal(3)._le(i$28).__nonzero__()) {
499                 return frame.getlocal(0);
500             }
501             frame.setlocal(2, frame.getlocal(3)._div(i$34));
502             if (((t$0$PyObject = frame.getlocal(3)._mod(i$34)).__nonzero__() ? frame.getlocal(1)._mod(i$34) : t$0$PyObject).__nonzero__()) {
503                 frame.setlocal(2, frame.getlocal(2)._add(i$17));
504             }
505             return s$19._mul(frame.getlocal(2))._add(frame.getlocal(0))._add(s$19._mul(frame.getlocal(3)._sub(frame.getlocal(2))));
506         }
507         
508         private static PyObject zfill$20(PyFrame frame) {
509             // Temporary Variables
510             PyObject[] t$0$PyObject__;
511             
512             // Code
513             /* zfill(x, width) -> string
514             
515                 Pad a numeric string x with zeros on the left, to fill a field
516                 of the specified width.  The string x is never truncated.
517             
518                  */
519             if (frame.getglobal("type").__call__(frame.getlocal(0))._eq(frame.getglobal("type").__call__(s$8)).__nonzero__()) {
520                 frame.setlocal(3, frame.getlocal(0));
521             }
522             else {
523                 frame.setlocal(3, frame.getlocal(0).__repr__());
524             }
525             frame.setlocal(4, frame.getglobal("len").__call__(frame.getlocal(3)));
526             if (frame.getlocal(4)._ge(frame.getlocal(1)).__nonzero__()) {
527                 return frame.getlocal(3);
528             }
529             frame.setlocal(2, s$8);
530             if (frame.getlocal(3).__getitem__(i$28)._in(new PyTuple(new PyObject[] {s$36, s$37})).__nonzero__()) {
531                 t$0$PyObject__ = org.python.core.Py.unpackSequence(new PyTuple(new PyObject[] {frame.getlocal(3).__getitem__(i$28), frame.getlocal(3).__getslice__(i$17, null, null)}), 2);
532                 frame.setlocal(2, t$0$PyObject__[0]);
533                 frame.setlocal(3, t$0$PyObject__[1]);
534             }
535             return frame.getlocal(2)._add(s$38._mul(frame.getlocal(1)._sub(frame.getlocal(4))))._add(frame.getlocal(3));
536         }
537         
538         private static PyObject expandtabs$21(PyFrame frame) {
539             // Temporary Variables
540             int t$0$int;
541             PyObject t$0$PyObject, t$1$PyObject;
542             
543             // Code
544             /* expandtabs(s [,tabsize]) -> string
545             
546                 Return a copy of the string s with all tab characters replaced
547                 by the appropriate number of spaces, depending on the current
548                 column, and the tabsize (default 8).
549             
550                  */
551             t$0$PyObject = s$8;
552             frame.setlocal(3, t$0$PyObject);
553             frame.setlocal(2, t$0$PyObject);
554             t$0$int = 0;
555             t$1$PyObject = frame.getlocal(0);
556             while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
557                 frame.setlocal(4, t$0$PyObject);
558                 if (frame.getlocal(4)._eq(s$40).__nonzero__()) {
559                     frame.setlocal(4, s$19._mul(frame.getlocal(1)._sub(frame.getglobal("len").__call__(frame.getlocal(2))._mod(frame.getlocal(1)))));
560                 }
561                 frame.setlocal(2, frame.getlocal(2)._add(frame.getlocal(4)));
562                 if (frame.getlocal(4)._eq(s$41).__nonzero__()) {
563                     frame.setlocal(3, frame.getlocal(3)._add(frame.getlocal(2)));
564                     frame.setlocal(2, s$8);
565                 }
566             }
567             return frame.getlocal(3)._add(frame.getlocal(2));
568         }
569         
570         private static PyObject translate$22(PyFrame frame) {
571             /* translate(s,table [,deletechars]) -> string
572             
573                 Return a copy of the string s, where all characters occurring
574                 in the optional argument deletechars are removed, and the
575                 remaining characters have been mapped through the given
576                 translation table, which must be a string of length 256.
577             
578                  */
579             return frame.getlocal(0).invoke("translate", frame.getlocal(1), frame.getlocal(2));
580         }
581         
582         private static PyObject capitalize$23(PyFrame frame) {
583             /* capitalize(s) -> string
584             
585                 Return a copy of the string s with only its first character
586                 capitalized.
587             
588                  */
589             return frame.getlocal(0).invoke("capitalize");
590         }
591         
592         private static PyObject capwords$24(PyFrame frame) {
593             // Temporary Variables
594             PyObject t$0$PyObject;
595             
596             // Code
597             /* capwords(s, [sep]) -> string
598             
599                 Split the argument into words using split, capitalize each
600                 word using capitalize, and join the capitalized words using
601                 join. Note that this replaces runs of whitespace characters by
602                 a single space.
603             
604                  */
605             return frame.getglobal("join").__call__(frame.getglobal("map").__call__(frame.getglobal("capitalize"), frame.getlocal(0).invoke("split", frame.getlocal(1))), (t$0$PyObject = frame.getlocal(1)).__nonzero__() ? t$0$PyObject : s$19);
606         }
607         
608         private static PyObject maketrans$25(PyFrame frame) {
609             // Temporary Variables
610             int t$0$int;
611             PyObject t$0$PyObject, t$1$PyObject;
612             
613             // Code
614             /* maketrans(frm, to) -> string
615             
616                 Return a translation table (a string of 256 bytes long)
617                 suitable for use in string.translate.  The strings frm and to
618                 must be of the same length.
619             
620                  */
621             if (frame.getglobal("len").__call__(frame.getlocal(0))._ne(frame.getglobal("len").__call__(frame.getlocal(1))).__nonzero__()) {
622                 throw Py.makeException(frame.getglobal("ValueError"), s$47);
623             }
624             // global _idmapL
625             if (frame.getglobal("_idmapL").__not__().__nonzero__()) {
626                 frame.setglobal("_idmapL", frame.getglobal("map").__call__(frame.getglobal("None"), frame.getglobal("_idmap")));
627             }
628             frame.setlocal(3, frame.getglobal("_idmapL").__getslice__(null, null, null));
629             frame.setlocal(0, frame.getglobal("map").__call__(frame.getglobal("ord"), frame.getlocal(0)));
630             t$0$int = 0;
631             t$1$PyObject = frame.getglobal("range").__call__(frame.getglobal("len").__call__(frame.getlocal(0)));
632             while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
633                 frame.setlocal(2, t$0$PyObject);
634                 frame.getlocal(3).__setitem__(frame.getlocal(0).__getitem__(frame.getlocal(2)), frame.getlocal(1).__getitem__(frame.getlocal(2)));
635             }
636             return frame.getglobal("joinfields").__call__(frame.getlocal(3), s$8);
637         }
638         
639         private static PyObject replace$26(PyFrame frame) {
640             /* replace (str, old, new[, maxsplit]) -> string
641             
642                 Return a copy of string str with all occurrences of substring
643                 old replaced by new. If the optional argument maxsplit is
644                 given, only the first maxsplit occurrences are replaced.
645             
646                  */
647             return frame.getlocal(0).invoke("replace", new PyObject[] {frame.getlocal(1), frame.getlocal(2), frame.getlocal(3)});
648         }
649         
650         private static PyObject main$27(PyFrame frame) {
651             frame.setglobal("__file__", s$49);
652             
653             PyObject[] imp_accu;
654             // Temporary Variables
655             int t$0$int;
656             PyException t$0$PyException;
657             PyObject t$0$PyObject, t$1$PyObject;
658             
659             // Code
660             /* Common string manipulations.
661             
662             Public module variables:
663             
664             whitespace -- a string containing all characters considered whitespace
665             lowercase -- a string containing all characters considered lowercase letters
666             uppercase -- a string containing all characters considered uppercase letters
667             letters -- a string containing all characters considered letters
668             digits -- a string containing all characters considered decimal digits
669             hexdigits -- a string containing all characters considered hexadecimal digits
670             octdigits -- a string containing all characters considered octal digits
671             
672              */
673             frame.setlocal("whitespace", s$1);
674             frame.setlocal("lowercase", s$2);
675             frame.setlocal("uppercase", s$3);
676             frame.setlocal("letters", frame.getname("lowercase")._add(frame.getname("uppercase")));
677             frame.setlocal("digits", s$4);
678             frame.setlocal("hexdigits", frame.getname("digits")._add(s$5)._add(s$6));
679             frame.setlocal("octdigits", s$7);
680             frame.setlocal("_idmap", s$8);
681             t$0$int = 0;
682             t$1$PyObject = frame.getname("range").__call__(i$9);
683             while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
684                 frame.setlocal("i", t$0$PyObject);
685                 frame.setlocal("_idmap", frame.getname("_idmap")._add(frame.getname("chr").__call__(frame.getname("i"))));
686             }
687             frame.dellocal("i");
688             frame.setlocal("index_error", frame.getname("ValueError"));
689             frame.setlocal("atoi_error", frame.getname("ValueError"));
690             frame.setlocal("atof_error", frame.getname("ValueError"));
691             frame.setlocal("atol_error", frame.getname("ValueError"));
692             frame.setlocal("lower", new PyFunction(frame.f_globals, new PyObject[] {}, c$0_lower));
693             frame.setlocal("upper", new PyFunction(frame.f_globals, new PyObject[] {}, c$1_upper));
694             frame.setlocal("swapcase", new PyFunction(frame.f_globals, new PyObject[] {}, c$2_swapcase));
695             frame.setlocal("strip", new PyFunction(frame.f_globals, new PyObject[] {}, c$3_strip));
696             frame.setlocal("lstrip", new PyFunction(frame.f_globals, new PyObject[] {}, c$4_lstrip));
697             frame.setlocal("rstrip", new PyFunction(frame.f_globals, new PyObject[] {}, c$5_rstrip));
698             frame.setlocal("split", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None"), i$17.__neg__()}, c$6_split));
699             frame.setlocal("splitfields", frame.getname("split"));
700             frame.setlocal("join", new PyFunction(frame.f_globals, new PyObject[] {s$19}, c$7_join));
701             frame.setlocal("joinfields", frame.getname("join"));
702             frame.setlocal("_apply", frame.getname("apply"));
703             frame.setlocal("index", new PyFunction(frame.f_globals, new PyObject[] {}, c$8_index));
704             frame.setlocal("rindex", new PyFunction(frame.f_globals, new PyObject[] {}, c$9_rindex));
705             frame.setlocal("count", new PyFunction(frame.f_globals, new PyObject[] {}, c$10_count));
706             frame.setlocal("find", new PyFunction(frame.f_globals, new PyObject[] {}, c$11_find));
707             frame.setlocal("rfind", new PyFunction(frame.f_globals, new PyObject[] {}, c$12_rfind));
708             frame.setlocal("_float", frame.getname("float"));
709             frame.setlocal("_int", frame.getname("int"));
710             frame.setlocal("_long", frame.getname("long"));
711             frame.setlocal("_StringType", frame.getname("type").__call__(s$8));
712             frame.setlocal("atof", new PyFunction(frame.f_globals, new PyObject[] {}, c$13_atof));
713             frame.setlocal("atoi", new PyFunction(frame.f_globals, new PyObject[] {}, c$14_atoi));
714             frame.setlocal("atol", new PyFunction(frame.f_globals, new PyObject[] {}, c$15_atol));
715             frame.setlocal("ljust", new PyFunction(frame.f_globals, new PyObject[] {}, c$16_ljust));
716             frame.setlocal("rjust", new PyFunction(frame.f_globals, new PyObject[] {}, c$17_rjust));
717             frame.setlocal("center", new PyFunction(frame.f_globals, new PyObject[] {}, c$18_center));
718             frame.setlocal("zfill", new PyFunction(frame.f_globals, new PyObject[] {}, c$19_zfill));
719             frame.setlocal("expandtabs", new PyFunction(frame.f_globals, new PyObject[] {i$42}, c$20_expandtabs));
720             frame.setlocal("translate", new PyFunction(frame.f_globals, new PyObject[] {s$8}, c$21_translate));
721             frame.setlocal("capitalize", new PyFunction(frame.f_globals, new PyObject[] {}, c$22_capitalize));
722             frame.setlocal("capwords", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None")}, c$23_capwords));
723             frame.setlocal("_idmapL", frame.getname("None"));
724             frame.setlocal("maketrans", new PyFunction(frame.f_globals, new PyObject[] {}, c$24_maketrans));
725             frame.setlocal("replace", new PyFunction(frame.f_globals, new PyObject[] {i$17.__neg__()}, c$25_replace));
726             try {
727                 imp_accu = org.python.core.imp.importFrom("strop", new String[] {"maketrans", "lowercase", "uppercase", "whitespace"}, frame);
728                 frame.setlocal("maketrans", imp_accu[0]);
729                 frame.setlocal("lowercase", imp_accu[1]);
730                 frame.setlocal("uppercase", imp_accu[2]);
731                 frame.setlocal("whitespace", imp_accu[3]);
732                 imp_accu = null;
733                 frame.setlocal("letters", frame.getname("lowercase")._add(frame.getname("uppercase")));
734             }
735             catch (Throwable x$0) {
736                 t$0$PyException = Py.setException(x$0, frame);
737                 if (Py.matchException(t$0$PyException, frame.getname("ImportError"))) {
738                     // pass
739                 }
740                 else throw t$0$PyException;
741             }
742             return Py.None;
743         }
744         
745     }
746     public static void moduleDictInit(PyObject dict) {
747         dict.__setitem__("__name__", new PyString("string"));
748         Py.runCode(new _PyInner().getMain(), dict, dict);
749     }
750     
751     public static void main(String[] args) throws java.lang.Exception {
752         String[] newargs = new String[args.length+1];
753         newargs[0] = "string";
754         System.arraycopy(args, 0, newargs, 1, args.length);
755         Py.runMain(string._PyInner.class, newargs, string.jpy$packages, string.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"});
756     }
757     
758 }