Changeset 79

Show
Ignore:
Timestamp:
11/08/06 12:38:41 (2 years ago)
Author:
Jan-Klaas Kollhof
Message:

changed def -> publ

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/jsolait/lib/codecs.js

    r77 r79  
    3333    @return  An array of encoder names. 
    3434**/ 
    35 def listEncoders(){ 
     35publ listEncoders(){ 
    3636    var c=[]; 
    3737    for(var attr in String.prototype){ 
     
    4646    @return  An array of decoder names. 
    4747**/ 
    48 def listDecoders(){ 
     48publ listDecoders(){ 
    4949    var c=[]; 
    5050    for(var attr in String.prototype){ 
  • branches/experimental/jsolait/lib/crypto.js

    r77 r79  
    3232    @return  An array of encrypters names. 
    3333**/ 
    34 def listEncrypters(){ 
     34publ listEncrypters(){ 
    3535    var c=[]; 
    3636    for(var attr in String.prototype){ 
     
    4545    @return  An array of decrypters names. 
    4646**/ 
    47 def listDecrypters(){ 
     47publ listDecrypters(){ 
    4848    var c=[]; 
    4949    for(var attr in String.prototype){ 
  • branches/experimental/jsolait/lib/forms.js

    r77 r79  
    190190}) ;    
    191191 
    192 def __main__(){ 
     192publ __main__(){ 
    193193    var fm = new Form("http://localhost/echoform.py", "get"); 
    194194    print("testing all sorts of chars, that should be encoded."); 
  • branches/experimental/jsolait/lib/itertools.js

    r77 r79  
    185185    @param step=1 The steps between each Item. 
    186186**/ 
    187 def range(start, end, step){ 
     187publ range(start, end, step){ 
    188188    var r=new Range(Class); 
    189189    r.__init__.apply(r, arguments); 
     
    285285    @return                      An iterator object or the return value returned by the callback. 
    286286**/ 
    287 def iter(iterable, thisObj, cb){ 
     287publ iter(iterable, thisObj, cb){ 
    288288    var iterator; 
    289289    if(iterable.__iter__ !==undefined){ 
     
    312312    @param iteration The Iteration object handling the iteration. 
    313313**/ 
    314 def IterationCallback(item, iteration){}; 
     314publ IterationCallback(item, iteration){}; 
    315315 
    316316/** 
     
    322322    @return                      A list containing all elements that were filtered. 
    323323**/ 
    324 def filter(iterable, thisObj,cb){ 
     324publ filter(iterable, thisObj,cb){ 
    325325    var iterator = iter(iterable); 
    326326    if(cb == null){ 
     
    339339    @return                      A list containing new elements. 
    340340**/         
    341 def map(iterable, thisObj, cb){ 
     341publ map(iterable, thisObj, cb){ 
    342342    var iterator  = iter(iterable); 
    343343    if(cb == null){ 
     
    355355    @return                      A list containing all elements. 
    356356**/     
    357 def list(iterable){ 
     357publ list(iterable){ 
    358358    return iter(iterable).__list__(); 
    359359}; 
     
    390390    @return a Zipper iterator. 
    391391**/ 
    392 def zip(iterable){ 
     392publ zip(iterable){ 
    393393    var iterators =[]; 
    394394    for(var i=0;i<arguments.length;i++){ 
  • branches/experimental/jsolait/lib/jsonrpc.js

    r77 r79  
    8787    @return         An xml representation of the object. 
    8888**/ 
    89 def marshall(obj){ 
     89publ marshall(obj){ 
    9090    if(obj == null){ 
    9191        return "null"; 
     
    108108    @return         The JavaScript object created. 
    109109**/ 
    110 def unmarshall(source){ 
     110publ unmarshall(source){ 
    111111    try { 
    112112        var obj; 
  • branches/experimental/jsolait/lib/logging.js

    r77 r79  
    1818 
    1919 
    20 def getLevelName(lvl){ 
     20publ getLevelName(lvl){ 
    2121    return levelNames[lvl]; 
    2222}; 
    23 def setLevelName(lvl, name){ 
     23publ setLevelName(lvl, name){ 
    2424    levelNames[lvl]=name; 
    2525}; 
    2626  
    27 def debug(msg){ 
     27publ debug(msg){ 
    2828    if(rootLogger.handlers.length==0){ 
    2929        basicConfig(0); 
     
    3232}; 
    3333 
    34 def info(msg){ 
     34publ info(msg){ 
    3535    if(rootLogger.handlers.length==0){ 
    3636        basicConfig(0); 
     
    3939}; 
    4040 
    41 def warning(msg){ 
     41publ warning(msg){ 
    4242    if(rootLogger.handlers.length==0){ 
    4343        basicConfig(0); 
     
    4646}; 
    4747 
    48 def error(msg, args){ 
     48publ error(msg, args){ 
    4949    if(rootLogger.handlers.length==0){ 
    5050        basicConfig(0); 
     
    5353}; 
    5454 
    55 def critical(msg, args){ 
     55publ critical(msg, args){ 
    5656    if(rootLogger.handlers.length==0){ 
    5757        basicConfig(0); 
     
    6060}; 
    6161 
    62 def log(level, msg, args){ 
     62publ log(level, msg, args){ 
    6363    if(rootLogger.handlers.length==0){ 
    6464        basicConfig(0); 
     
    264264     
    265265 
    266 def basicConfig(level, format){ 
     266publ basicConfig(level, format){ 
    267267       
    268268    if(rootLogger.handlers.length == 0){  
     
    281281var loggers={}; 
    282282 
    283 def getLogger(name){ 
     283publ getLogger(name){ 
    284284    if(name==undefined){ 
    285285        l=rootLogger; 
     
    301301}; 
    302302 
    303 def getLoggerClass(){ 
     303publ getLoggerClass(){ 
    304304    return loggerClass; 
    305305}; 
    306306 
    307 def setLoggerClass(lc){ 
     307publ setLoggerClass(lc){ 
    308308    loggerClass=lc; 
    309309}; 
  • branches/experimental/jsolait/lib/operators.js

    r77 r79  
    2929__version__= "$Revision: 20 $"; 
    3030 
    31 def lt(a, b){ 
     31publ lt(a, b){ 
    3232    if((a!=null) && (a.__lt__!==undefined)){ 
    3333        return a.__lt__(b); 
     
    3939}; 
    4040 
    41 def le(a, b){ 
     41publ le(a, b){ 
    4242    if((a!=null) && (a.__le__!==undefined)){ 
    4343        return a.__le__(b); 
     
    4949}; 
    5050 
    51 def eq(a, b){ 
     51publ eq(a, b){ 
    5252    if((a!=null) && (a.__eq__!==undefined)){ 
    5353        return a.__eq__(b); 
     
    5959}; 
    6060 
    61 def ne(a, b){ 
     61publ ne(a, b){ 
    6262    if((a!=null) && (a.__ne__!==undefined)){ 
    6363        return a.__ne__(b); 
     
    6969}; 
    7070 
    71 def is(a,b){ 
     71publ is(a,b){ 
    7272    if((a!=null) && (a.__is__!==undefined)){ 
    7373        return a.__is__(b); 
     
    7979}; 
    8080 
    81 def isnot(a,b){ 
     81publ isnot(a,b){ 
    8282    if((a!=null) && (a.__isnot__!==undefined)){ 
    8383        return a.__isnot__(b); 
     
    8989}; 
    9090 
    91 def ge(a, b){ 
     91publ ge(a, b){ 
    9292    if((a!=null) && (a.__ge__!==undefined)){ 
    9393        return a.__ge__(b); 
     
    9999}; 
    100100 
    101 def gt(a, b){ 
     101publ gt(a, b){ 
    102102    if((a!=null) && (a.__gt__!==undefined)){ 
    103103        return a.__gt__(b); 
     
    109109}; 
    110110 
    111 def not(a){ 
     111publ not(a){ 
    112112    if((a!=null) && (a.__not__!==undefined)){ 
    113113        return a.__not__(); 
  • branches/experimental/jsolait/lib/strings.js

    r77 r79  
    3535}); 
    3636 
    37 def naturalCompare(a, b){ 
     37publ naturalCompare(a, b){ 
    3838    var asplitter=new WordNumberStringSplitter(a); 
    3939    var bsplitter=new WordNumberStringSplitter(b); 
  • branches/experimental/jsolait/lib/testing.js

    r77 r79  
    3939    @param ...         The rest of the parameters are sent to the function as arguments. 
    4040*/ 
    41 def timeExec(repeat, fn){ 
     41publ timeExec(repeat, fn){ 
    4242    var args = []; 
    4343    for(var i=2;i<arguments.length;i++){ 
     
    5858    @return                                  The time it took to run the function a single time. The time is averaged by the total time/repetitions 
    5959**/ 
    60 def profile(min,fn){ 
     60publ profile(min,fn){ 
    6161    if(arguments.length==1){ 
    6262        fn=min; 
     
    134134    @param testScope  A function to test. 
    135135**/ 
    136 def test(name, testScope){ 
     136publ test(name, testScope){ 
    137137    if(arguments.length == 1){ 
    138138        testScope = name; 
     
    147147    Tests a module by running each of the modules test_ methods; 
    148148**/ 
    149 def testModule(modObj){ 
     149publ testModule(modObj){ 
    150150     
    151151    for(var key in modObj){ 
     
    173173    @param failMsg=''     A message to pass to the AssertFailed constructor in case the assertion fails. 
    174174**/ 
    175 def assert(comment, value, failMsg){ 
     175publ assert(comment, value, failMsg){ 
    176176    if(typeof comment == 'boolean'){ 
    177177        failMsg=value; 
     
    190190    @param value          A boolean to test. 
    191191**/ 
    192 def assertTrue(comment, value){ 
     192publ assertTrue(comment, value){ 
    193193    if(arguments.length==1){ 
    194194        value = comment; 
     
    203203    @param value          A boolean to test. 
    204204**/ 
    205 def assertFalse(comment, value){ 
     205publ assertFalse(comment, value){ 
    206206    if(arguments.length==1){ 
    207207        value = comment; 
     
    216216    @param value          A boolean to test. 
    217217**/ 
    218 def assertEquals(comment, value1, value2){ 
     218publ assertEquals(comment, value1, value2){ 
    219219    if(arguments.length==2){ 
    220220        value2=value1; 
     
    225225}; 
    226226     
    227 def assertNotEquals(comment, value1, value2){ 
     227publ assertNotEquals(comment, value1, value2){ 
    228228    if(arguments.length==2){ 
    229229        value2=value1; 
     
    234234}; 
    235235 
    236 def assertIs(comment, value1, value2){ 
     236publ assertIs(comment, value1, value2){ 
    237237    if(arguments.length==2){ 
    238238        value2=value1; 
     
    243243}; 
    244244     
    245 def assertIsNot(comment, value1, value2){ 
     245publ assertIsNot(comment, value1, value2){ 
    246246    if(arguments.length==2){ 
    247247        value2=value1; 
     
    252252}; 
    253253 
    254 def assertNull(comment, value){ 
     254publ assertNull(comment, value){ 
    255255    if(arguments.length==1){ 
    256256        value = comment; 
     
    260260}; 
    261261 
    262 def assertNotNull(comment, value){ 
     262publ assertNotNull(comment, value){ 
    263263    if(arguments.length==1){ 
    264264        value = comment; 
     
    268268}; 
    269269 
    270 def assertUndefined(comment, value){ 
     270publ assertUndefined(comment, value){ 
    271271    if(arguments.length==1){ 
    272272        value = comment; 
     
    276276}; 
    277277 
    278 def assertNotUndefined(comment, value){ 
     278publ assertNotUndefined(comment, value){ 
    279279    if(arguments.length==1){ 
    280280        value = comment; 
     
    284284}; 
    285285 
    286 def assertNaN(comment, value){ 
     286publ assertNaN(comment, value){ 
    287287    if(arguments.length==1){ 
    288288        value = comment; 
     
    292292}; 
    293293 
    294 def assertNotNaN(comment, value){ 
     294publ assertNotNaN(comment, value){ 
    295295    if(arguments.length==1){ 
    296296        value = comment; 
     
    300300}; 
    301301 
    302 def fail(comment){ 
     302publ fail(comment){ 
    303303    throw new AssertFailed(comment, "Fail was called"); 
    304304}; 
    305305 
    306 def objectKeys(obj){ 
     306publ objectKeys(obj){ 
    307307    var keys=[]; 
    308308    for(var n in obj){ 
  • branches/experimental/jsolait/lib/urllib.js

    r77 r79  
    144144    @return  HTTP request object. 
    145145*/ 
    146 def getHTTP() { 
     146publ getHTTP() { 
    147147    var obj; 
    148148    try{ //to get the mozilla httprequest object 
     
    199199    @return                     HTTP request object. 
    200200*/ 
    201 def sendRequest(type, url, user, pass, data, headers, callback){ 
     201publ sendRequest(type, url, user, pass, data, headers, callback){ 
    202202    var async=false; 
    203203    //check if the last argument is a function and treat it as callback; 
     
    293293    @return                     HTTP request object. 
    294294*/ 
    295 def getURL(url, user, pass, headers, callback) { 
     295publ getURL(url, user, pass, headers, callback) { 
    296296    var a=["GET"]; 
    297297    for(var i=0;i<arguments.length;i++){ 
     
    312312    @return                     HTTP request object. 
    313313*/ 
    314 def postURL(url, user, pass, data, headers, callback) { 
     314publ postURL(url, user, pass, data, headers, callback) { 
    315315    var a= ["POST"]; 
    316316    for(var i=0;i<arguments.length;i++){ 
     
    325325    @return True if the module can make HTTP requests, false otherwise. 
    326326**/ 
    327 def isUsable(){ 
     327publ isUsable(){ 
    328328    try{ 
    329329        getHTTP(); 
  • branches/experimental/jsolait/lib/xml.js

    r77 r79  
    6767    @return          A DOM of the xml document. 
    6868*/ 
    69 def parseXML(xml){ 
     69publ parseXML(xml){ 
    7070    var obj=null; 
    7171    var isMoz=false; 
     
    125125    @return                      The imported Node. 
    126126*/ 
    127 def importNode(importedNode, deep){ 
     127publ importNode(importedNode, deep){ 
    128128    deep = (deep==null) ? true : deep; 
    129129    //constants from doom2 
     
    225225    @return           A string containing the text for the XML. 
    226226*/ 
    227 def node2XML(node, nsPrefixMap, attrParent){ 
     227publ node2XML(node, nsPrefixMap, attrParent){ 
    228228    nsPrefixMap = (nsPrefixMap == null)?{}:nsPrefixMap; 
    229229    var ELEMENT_NODE = 1; 
  • branches/experimental/jsolait/lib/xmlrpc.js

    r77 r79  
    9494    @return         An xml representation of the object. 
    9595*/ 
    96 def marshall(obj){ 
     96publ marshall(obj){ 
    9797    if(obj.toXmlRpc!=null){ 
    9898        return obj.toXmlRpc(); 
     
    115115    @return         The JavaScript object created from the XML. 
    116116*/ 
    117 def unmarshall(xml){ 
     117publ unmarshall(xml){ 
    118118    try {//try to parse xml ... this will throw an Exception if failed 
    119119        var doc = parseXML(xml); 
     
    132132    @return         The JavaScript object created from the XML. 
    133133*/ 
    134 def unmarshallDoc(doc, xml){ 
     134publ unmarshallDoc(doc, xml){ 
    135135    try{ 
    136136        var node = doc.documentElement; 
     
    815815 
    816816 
    817 def __main__(){ 
     817publ __main__(){ 
    818818    var s = new ServiceProxy("http://jsolait.net/test.py",['echo']); 
    819819    print("creating ServiceProxy object using introspection for method construction...\n");