1- // PythonScript Runtime - regenerated on: Thu Nov 7 21:54:00 2013
1+ // PythonScript Runtime - regenerated on: Sat Nov 9 21:41:45 2013
2+ __NULL_OBJECT__ = Object . create ( null ) ;
23var jsrange = function ( num ) {
34"Emulates Python's range function" ;
45var i , r ;
@@ -677,7 +678,7 @@ return true;
677678bases = C . __bases__ ;
678679i = 0 ;
679680while ( i < get_attribute ( bases , "length" ) ) {
680- if ( get_attribute ( issubclass , "__call__" ) ( [ get_attribute ( bases , "__getitem__" ) ( [ i ] , Object ( ) ) , B ] , Object ( ) ) ) {
681+ if ( issubclass ( [ get_attribute ( bases , "__getitem__" ) ( [ i ] , Object ( ) ) , B ] , __NULL_OBJECT__ ) ) {
681682return true ;
682683}
683684
@@ -713,7 +714,7 @@ if(ob_class === undefined) {
713714return false ;
714715}
715716else {
716- return get_attribute ( issubclass , "__call__" ) ( [ ob_class , klass ] , Object ( ) ) ;
717+ return issubclass ( [ ob_class , klass ] , __NULL_OBJECT__ ) ;
717718}
718719
719720}
@@ -1017,7 +1018,7 @@ _setup_str_prototype.args_signature = [];
10171018_setup_str_prototype . kwargs_signature = { } ;
10181019_setup_str_prototype . types_signature = { } ;
10191020_setup_str_prototype . pythonscript_function = true ;
1020- get_attribute ( _setup_str_prototype , "__call__" ) ( create_array ( ) , Object ( ) ) ;
1021+ _setup_str_prototype ( ) ;
10211022var _setup_array_prototype = function ( args , kwargs ) {
10221023var func = function ( a ) {
10231024if ( this . indexOf ( a ) == - 1 ) {
@@ -1069,7 +1070,7 @@ _setup_array_prototype.args_signature = [];
10691070_setup_array_prototype . kwargs_signature = { } ;
10701071_setup_array_prototype . types_signature = { } ;
10711072_setup_array_prototype . pythonscript_function = true ;
1072- get_attribute ( _setup_array_prototype , "__call__" ) ( create_array ( ) , Object ( ) ) ;
1073+ _setup_array_prototype ( ) ;
10731074var range = function ( args , kwargs ) {
10741075var i , r ;
10751076if ( args instanceof Array && { } . toString . call ( kwargs ) === '[object Object]' && arguments . length == 2 ) {
@@ -1088,7 +1089,7 @@ var num = arguments['num'];
10881089"Emulates Python's range function" ;
10891090var i , r ;
10901091i = 0 ;
1091- r = get_attribute ( list , "__call__" ) ( create_array ( ) , Object ( ) ) ;
1092+ r = get_attribute ( list , "__call__" ) ( ) ;
10921093while ( i < num ) {
10931094get_attribute ( get_attribute ( r , "append" ) , "__call__" ) ( [ i ] , Object ( ) ) ;
10941095i += 1
@@ -1121,7 +1122,7 @@ signature = {"kwargs": Object(), "args": create_array("obj")};
11211122signature [ "function_name" ] = "len" ;
11221123arguments = get_arguments ( signature , args , kwargs ) ;
11231124var obj = arguments [ 'obj' ] ;
1124- return get_attribute ( get_attribute ( obj , "__len__" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
1125+ return get_attribute ( get_attribute ( obj , "__len__" ) , "__call__" ) ( ) ;
11251126}
11261127window [ "len" ] = len
11271128
@@ -1144,7 +1145,7 @@ signature = {"kwargs": Object(), "args": create_array("obj")};
11441145signature [ "function_name" ] = "next" ;
11451146arguments = get_arguments ( signature , args , kwargs ) ;
11461147var obj = arguments [ 'obj' ] ;
1147- return get_attribute ( get_attribute ( obj , "next" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
1148+ return get_attribute ( get_attribute ( obj , "next" ) , "__call__" ) ( ) ;
11481149}
11491150window [ "next" ] = next
11501151
@@ -1169,8 +1170,8 @@ signature["function_name"] = "map";
11691170arguments = get_arguments ( signature , args , kwargs ) ;
11701171var func = arguments [ 'func' ] ;
11711172var objs = arguments [ 'objs' ] ;
1172- out = get_attribute ( list , "__call__" ) ( create_array ( ) , Object ( ) ) ;
1173- set_attribute ( out , "js_object" , get_attribute ( map , "__call__" ) ( [ func , get_attribute ( objs , "js_object" ) ] , Object ( ) ) ) ;
1173+ out = get_attribute ( list , "__call__" ) ( ) ;
1174+ set_attribute ( out , "js_object" , map ( [ func , get_attribute ( objs , "js_object" ) ] , __NULL_OBJECT__ ) ) ;
11741175return out ;
11751176}
11761177window [ "map" ] = map
@@ -1355,7 +1356,7 @@ var obj = arguments['obj'];
13551356var index = arguments [ 'index' ] ;
13561357self [ "__dict__" ] [ "obj" ] = obj ;
13571358self [ "__dict__" ] [ "index" ] = index ;
1358- self [ "__dict__" ] [ "length" ] = get_attribute ( len , "__call__" ) ( [ obj ] , Object ( ) ) ;
1359+ self [ "__dict__" ] [ "length" ] = len ( [ obj ] , __NULL_OBJECT__ ) ;
13591360self [ "__dict__" ] [ "obj_get" ] = get_attribute ( obj , "get" ) ;
13601361}
13611362window [ "__Iterator___init__" ] = __Iterator___init__
@@ -1382,7 +1383,7 @@ signature["function_name"] = "__Iterator_next";
13821383arguments = get_arguments ( signature , args , kwargs ) ;
13831384var self = arguments [ 'self' ] ;
13841385index = self [ "__dict__" ] [ "index" ] ;
1385- length = get_attribute ( len , "__call__" ) ( [ self [ "__dict__" ] [ "obj" ] ] , Object ( ) ) ;
1386+ length = len ( [ self [ "__dict__" ] [ "obj" ] ] , __NULL_OBJECT__ ) ;
13861387if ( index == length ) {
13871388throw StopIteration ;
13881389}
@@ -1459,15 +1460,15 @@ i += 1
14591460}
14601461else {
14611462if ( js_object ) {
1462- if ( get_attribute ( isinstance , "__call__" ) ( [ js_object , list ] , Object ( ) ) ) {
1463+ if ( isinstance ( [ js_object , list ] , __NULL_OBJECT__ ) ) {
14631464self [ "__dict__" ] [ "js_object" ] = get_attribute ( get_attribute ( get_attribute ( js_object , "js_object" ) , "slice" ) , "__call__" ) ( [ 0 ] , Object ( ) ) ;
14641465}
14651466else {
1466- if ( get_attribute ( isinstance , "__call__" ) ( [ js_object , tuple ] , Object ( ) ) ) {
1467+ if ( isinstance ( [ js_object , tuple ] , __NULL_OBJECT__ ) ) {
14671468self [ "__dict__" ] [ "js_object" ] = get_attribute ( get_attribute ( get_attribute ( js_object , "js_object" ) , "slice" ) , "__call__" ) ( [ 0 ] , Object ( ) ) ;
14681469}
14691470else {
1470- if ( get_attribute ( isinstance , "__call__" ) ( [ js_object , array ] , Object ( ) ) ) {
1471+ if ( isinstance ( [ js_object , array ] , __NULL_OBJECT__ ) ) {
14711472arr = create_array ( ) ;
14721473var __iterator__ , v ;
14731474__iterator__ = get_attribute ( get_attribute ( js_object , "__iter__" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
@@ -1736,7 +1737,7 @@ if(js_object instanceof Array) {
17361737set_attribute ( self , "js_object" , js_object ) ;
17371738}
17381739else {
1739- if ( get_attribute ( isinstance , "__call__" ) ( [ js_object , list ] , Object ( ) ) || get_attribute ( isinstance , "__call__" ) ( [ js_object , tuple ] , Object ( ) ) || get_attribute ( isinstance , "__call__" ) ( [ js_object , array ] , Object ( ) ) ) {
1740+ if ( isinstance ( [ js_object , list ] , __NULL_OBJECT__ ) || isinstance ( [ js_object , tuple ] , __NULL_OBJECT__ ) || isinstance ( [ js_object , array ] , __NULL_OBJECT__ ) ) {
17401741set_attribute ( self , "js_object" , create_array ( ) ) ;
17411742var __iterator__ , v ;
17421743__iterator__ = get_attribute ( get_attribute ( js_object , "__iter__" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
@@ -2623,7 +2624,7 @@ arguments = get_arguments(signature, args, kwargs);
26232624var self = arguments [ 'self' ] ;
26242625__dict = get_attribute ( self , "js_object" ) ;
26252626__keys = Object . keys ( __dict ) ;
2626- out = get_attribute ( list , "__call__" ) ( create_array ( ) , Object ( ) ) ;
2627+ out = get_attribute ( list , "__call__" ) ( ) ;
26272628i = 0 ;
26282629while ( i < get_attribute ( __keys , "length" ) ) {
26292630get_attribute ( get_attribute ( out , "append" ) , "__call__" ) ( [ __dict [ __keys [ i ] ] ] , Object ( ) ) ;
@@ -2693,7 +2694,7 @@ signature = {"kwargs": Object(), "args": create_array("self")};
26932694signature [ "function_name" ] = "__dict___iter__" ;
26942695arguments = get_arguments ( signature , args , kwargs ) ;
26952696var self = arguments [ 'self' ] ;
2696- return get_attribute ( Iterator , "__call__" ) ( [ get_attribute ( get_attribute ( self , "keys" ) , "__call__" ) ( create_array ( ) , Object ( ) ) , 0 ] , Object ( ) ) ;
2697+ return get_attribute ( Iterator , "__call__" ) ( [ get_attribute ( get_attribute ( self , "keys" ) , "__call__" ) ( ) , 0 ] , Object ( ) ) ;
26972698}
26982699window [ "__dict___iter__" ] = __dict___iter__
26992700
@@ -2735,16 +2736,16 @@ self["__dict__"]["typecode"] = typecode;
27352736self [ "__dict__" ] [ "itemsize" ] = get_attribute ( get_attribute ( self , "typecodes" ) , "__getitem__" ) ( [ typecode ] , Object ( ) ) ;
27362737self [ "__dict__" ] [ "little_endian" ] = little_endian ;
27372738if ( initializer ) {
2738- self [ "__dict__" ] [ "length" ] = get_attribute ( len , "__call__" ) ( [ initializer ] , Object ( ) ) ;
2739+ self [ "__dict__" ] [ "length" ] = len ( [ initializer ] , __NULL_OBJECT__ ) ;
27392740self [ "__dict__" ] [ "bytes" ] = self [ "__dict__" ] [ "length" ] * self [ "__dict__" ] [ "itemsize" ] ;
27402741if ( self [ "__dict__" ] [ "typecode" ] == "float8" ) {
2741- self [ "__dict__" ] [ "_scale" ] = get_attribute ( max , "__call__" ) ( [ get_attribute ( list , "__call__" ) ( [ ] , { "js_object" : [ get_attribute ( abs , "__call__" ) ( [ get_attribute ( min , "__call__" ) ( [ initializer ] , Object ( ) ) ] , Object ( ) ) , get_attribute ( max , "__call__" ) ( [ initializer ] , Object ( ) ) ] } ) ] , Object ( ) ) ;
2742+ self [ "__dict__" ] [ "_scale" ] = max ( [ get_attribute ( list , "__call__" ) ( [ ] , { "js_object" : [ abs ( [ min ( [ initializer ] , __NULL_OBJECT__ ) ] , __NULL_OBJECT__ ) , max ( [ initializer ] , __NULL_OBJECT__ ) ] } ) ] , __NULL_OBJECT__ ) ;
27422743self [ "__dict__" ] [ "_norm_get" ] = self [ "__dict__" ] [ "_scale" ] / 127 ;
27432744self [ "__dict__" ] [ "_norm_set" ] = 1.0 / self [ "__dict__" ] [ "_norm_get" ] ;
27442745}
27452746else {
27462747if ( self [ "__dict__" ] [ "typecode" ] == "float16" ) {
2747- self [ "__dict__" ] [ "_scale" ] = get_attribute ( max , "__call__" ) ( [ get_attribute ( list , "__call__" ) ( [ ] , { "js_object" : [ get_attribute ( abs , "__call__" ) ( [ get_attribute ( min , "__call__" ) ( [ initializer ] , Object ( ) ) ] , Object ( ) ) , get_attribute ( max , "__call__" ) ( [ initializer ] , Object ( ) ) ] } ) ] , Object ( ) ) ;
2748+ self [ "__dict__" ] [ "_scale" ] = max ( [ get_attribute ( list , "__call__" ) ( [ ] , { "js_object" : [ abs ( [ min ( [ initializer ] , __NULL_OBJECT__ ) ] , __NULL_OBJECT__ ) , max ( [ initializer ] , __NULL_OBJECT__ ) ] } ) ] , __NULL_OBJECT__ ) ;
27482749self [ "__dict__" ] [ "_norm_get" ] = self [ "__dict__" ] [ "_scale" ] / 32767 ;
27492750self [ "__dict__" ] [ "_norm_set" ] = 1.0 / self [ "__dict__" ] [ "_norm_get" ] ;
27502751}
@@ -2811,7 +2812,7 @@ signature["function_name"] = "__array___contains__";
28112812arguments = get_arguments ( signature , args , kwargs ) ;
28122813var self = arguments [ 'self' ] ;
28132814var value = arguments [ 'value' ] ;
2814- arr = get_attribute ( get_attribute ( self , "to_array" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
2815+ arr = get_attribute ( get_attribute ( self , "to_array" ) , "__call__" ) ( ) ;
28152816if ( arr . indexOf ( value ) == - 1 ) {
28162817return false ;
28172818}
@@ -2994,7 +2995,7 @@ signature["function_name"] = "__array_fromlist";
29942995arguments = get_arguments ( signature , args , kwargs ) ;
29952996var self = arguments [ 'self' ] ;
29962997var lst = arguments [ 'lst' ] ;
2997- length = get_attribute ( len , "__call__" ) ( [ lst ] , Object ( ) ) ;
2998+ length = len ( [ lst ] , __NULL_OBJECT__ ) ;
29982999step = self [ "__dict__" ] [ "itemsize" ] ;
29993000typecode = self [ "__dict__" ] [ "typecode" ] ;
30003001size = length * step ;
@@ -3176,8 +3177,8 @@ signature = {"kwargs": Object(), "args": create_array("self")};
31763177signature [ "function_name" ] = "__array_to_list" ;
31773178arguments = get_arguments ( signature , args , kwargs ) ;
31783179var self = arguments [ 'self' ] ;
3179- lst = get_attribute ( list , "__call__" ) ( create_array ( ) , Object ( ) ) ;
3180- set_attribute ( lst , "js_object" , get_attribute ( get_attribute ( self , "to_array" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ) ;
3180+ lst = get_attribute ( list , "__call__" ) ( ) ;
3181+ set_attribute ( lst , "js_object" , get_attribute ( get_attribute ( self , "to_array" ) , "__call__" ) ( ) ) ;
31813182return lst ;
31823183}
31833184window [ "__array_to_list" ] = __array_to_list
@@ -3204,7 +3205,7 @@ signature["function_name"] = "__array_to_ascii";
32043205arguments = get_arguments ( signature , args , kwargs ) ;
32053206var self = arguments [ 'self' ] ;
32063207string = "" ;
3207- arr = get_attribute ( get_attribute ( self , "to_array" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
3208+ arr = get_attribute ( get_attribute ( self , "to_array" ) , "__call__" ) ( ) ;
32083209i = 0 ;
32093210length = get_attribute ( arr , "length" ) ;
32103211while ( i < length ) {
@@ -3250,8 +3251,8 @@ return json;
32503251}
32513252
32523253if ( Object . prototype . toString . call ( json ) === '[object Array]' ) {
3253- output = get_attribute ( list , "__call__" ) ( create_array ( ) , Object ( ) ) ;
3254- raw = get_attribute ( list , "__call__" ) ( create_array ( ) , Object ( ) ) ;
3254+ output = get_attribute ( list , "__call__" ) ( ) ;
3255+ raw = get_attribute ( list , "__call__" ) ( ) ;
32553256set_attribute ( raw , "js_object" , json ) ;
32563257var append ;
32573258append = get_attribute ( output , "append" ) ;
@@ -3261,23 +3262,23 @@ var __next__;
32613262__next__ = get_attribute ( __iterator__ , "next_fast" ) ;
32623263while ( __iterator__ . __dict__ . index < __iterator__ . __dict__ . length ) {
32633264item = __next__ ( ) ;
3264- get_attribute ( append , "__call__" ) ( [ get_attribute ( _to_pythonjs , "__call__" ) ( [ item ] , Object ( ) ) ] , Object ( ) ) ;
3265+ get_attribute ( append , "__call__" ) ( [ _to_pythonjs ( [ item ] , __NULL_OBJECT__ ) ] , Object ( ) ) ;
32653266}
32663267return output ;
32673268}
32683269
3269- output = get_attribute ( dict , "__call__" ) ( create_array ( ) , Object ( ) ) ;
3270+ output = get_attribute ( dict , "__call__" ) ( ) ;
32703271var set ;
32713272set = get_attribute ( output , "set" ) ;
3272- keys = get_attribute ( list , "__call__" ) ( create_array ( ) , Object ( ) ) ;
3273+ keys = get_attribute ( list , "__call__" ) ( ) ;
32733274set_attribute ( keys , "js_object" , Object . keys ( json ) ) ;
32743275var __iterator__ , key ;
32753276__iterator__ = get_attribute ( get_attribute ( keys , "__iter__" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
32763277var __next__ ;
32773278__next__ = get_attribute ( __iterator__ , "next_fast" ) ;
32783279while ( __iterator__ . __dict__ . index < __iterator__ . __dict__ . length ) {
32793280key = __next__ ( ) ;
3280- get_attribute ( set , "__call__" ) ( [ key , get_attribute ( _to_pythonjs , "__call__" ) ( [ json [ key ] ] , Object ( ) ) ] , Object ( ) ) ;
3281+ get_attribute ( set , "__call__" ) ( [ key , _to_pythonjs ( [ json [ key ] ] , __NULL_OBJECT__ ) ] , Object ( ) ) ;
32813282}
32823283return output ;
32833284}
@@ -3302,7 +3303,7 @@ signature = {"kwargs": Object(), "args": create_array("json")};
33023303signature [ "function_name" ] = "json_to_pythonjs" ;
33033304arguments = get_arguments ( signature , args , kwargs ) ;
33043305var json = arguments [ 'json' ] ;
3305- return get_attribute ( _to_pythonjs , "__call__" ) ( [ get_attribute ( get_attribute ( JSON , "parse" ) , "__call__" ) ( [ json ] , Object ( ) ) ] , Object ( ) ) ;
3306+ return _to_pythonjs ( [ get_attribute ( get_attribute ( JSON , "parse" ) , "__call__" ) ( [ json ] , Object ( ) ) ] , __NULL_OBJECT__ ) ;
33063307}
33073308window [ "json_to_pythonjs" ] = json_to_pythonjs
33083309
@@ -3326,29 +3327,29 @@ signature = {"kwargs": Object(), "args": create_array("pythonjs")};
33263327signature [ "function_name" ] = "_to_json" ;
33273328arguments = get_arguments ( signature , args , kwargs ) ;
33283329var pythonjs = arguments [ 'pythonjs' ] ;
3329- if ( get_attribute ( isinstance , "__call__" ) ( [ pythonjs , list ] , Object ( ) ) ) {
3330+ if ( isinstance ( [ pythonjs , list ] , __NULL_OBJECT__ ) ) {
33303331r = create_array ( ) ;
33313332var __iterator__ , i ;
33323333__iterator__ = get_attribute ( get_attribute ( pythonjs , "__iter__" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
33333334var __next__ ;
33343335__next__ = get_attribute ( __iterator__ , "next_fast" ) ;
33353336while ( __iterator__ . __dict__ . index < __iterator__ . __dict__ . length ) {
33363337i = __next__ ( ) ;
3337- get_attribute ( get_attribute ( r , "push" ) , "__call__" ) ( [ get_attribute ( _to_json , "__call__" ) ( [ i ] , Object ( ) ) ] , Object ( ) ) ;
3338+ get_attribute ( get_attribute ( r , "push" ) , "__call__" ) ( [ _to_json ( [ i ] , __NULL_OBJECT__ ) ] , Object ( ) ) ;
33383339}
33393340}
33403341else {
3341- if ( get_attribute ( isinstance , "__call__" ) ( [ pythonjs , dict ] , Object ( ) ) ) {
3342+ if ( isinstance ( [ pythonjs , dict ] , __NULL_OBJECT__ ) ) {
33423343var r ;
33433344r = Object ( ) ;
33443345var __iterator__ , key ;
3345- __iterator__ = get_attribute ( get_attribute ( get_attribute ( get_attribute ( pythonjs , "keys" ) , "__call__" ) ( create_array ( ) , Object ( ) ) , "__iter__" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
3346+ __iterator__ = get_attribute ( get_attribute ( get_attribute ( get_attribute ( pythonjs , "keys" ) , "__call__" ) ( ) , "__iter__" ) , "__call__" ) ( create_array ( ) , Object ( ) ) ;
33463347var __next__ ;
33473348__next__ = get_attribute ( __iterator__ , "next_fast" ) ;
33483349while ( __iterator__ . __dict__ . index < __iterator__ . __dict__ . length ) {
33493350key = __next__ ( ) ;
3350- value = get_attribute ( _to_json , "__call__" ) ( [ get_attribute ( get_attribute ( pythonjs , "get" ) , "__call__" ) ( [ key ] , Object ( ) ) ] , Object ( ) ) ;
3351- key = get_attribute ( _to_json , "__call__" ) ( [ key ] , Object ( ) ) ;
3351+ value = _to_json ( [ get_attribute ( get_attribute ( pythonjs , "get" ) , "__call__" ) ( [ key ] , Object ( ) ) ] , __NULL_OBJECT__ ) ;
3352+ key = _to_json ( [ key ] , __NULL_OBJECT__ ) ;
33523353r [ key ] = value ;
33533354}
33543355}
@@ -3381,7 +3382,7 @@ signature = {"kwargs": Object(), "args": create_array("pythonjs")};
33813382signature [ "function_name" ] = "pythonjs_to_json" ;
33823383arguments = get_arguments ( signature , args , kwargs ) ;
33833384var pythonjs = arguments [ 'pythonjs' ] ;
3384- return get_attribute ( get_attribute ( JSON , "stringify" ) , "__call__" ) ( [ get_attribute ( _to_json , "__call__" ) ( [ pythonjs ] , Object ( ) ) ] , Object ( ) ) ;
3385+ return get_attribute ( get_attribute ( JSON , "stringify" ) , "__call__" ) ( [ _to_json ( [ pythonjs ] , __NULL_OBJECT__ ) ] , Object ( ) ) ;
33853386}
33863387window [ "pythonjs_to_json" ] = pythonjs_to_json
33873388
0 commit comments