Changeset 28f4adb in mainline for tools/checkers


Ignore:
Timestamp:
2010-11-02T11:13:36Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4687a26c, e06ef614
Parents:
458619f7
git-author:
Vojtech Horky <> (2010-11-02 11:13:36)
git-committer:
Martin Decky <martin@…> (2010-11-02 11:13:36)
Message:

update scripts for compatibility with Python 3 (thx Vojtech Horky and Martin Sucha)

Location:
tools/checkers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tools/checkers/clang.py

    r458619f7 r28f4adb  
    4242def usage(prname):
    4343        "Print usage syntax"
    44         print prname + " <ROOT>"
     44        print(prname + " <ROOT>")
    4545
    4646def clang(root, job):
     
    5050       
    5151        if (not os.path.isfile(inname)):
    52                 print "Unable to open %s" % inname
    53                 print "Did you run \"make precheck\" on the source tree?"
     52                print("Unable to open %s" % inname)
     53                print("Did you run \"make precheck\" on the source tree?")
    5454                return False
    5555       
    56         inf = file(inname, "r")
     56        inf = open(inname, "r")
    5757        records = inf.read().splitlines()
    5858        inf.close()
     
    6464               
    6565                if (len(arg) < 6):
    66                         print "Not enought jobfile record arguments"
     66                        print("Not enought jobfile record arguments")
    6767                        return False
    6868               
     
    7676                srcfqname = os.path.join(base, srcfname)
    7777                if (not os.path.isfile(srcfqname)):
    78                         print "Source %s not found" % srcfqname
     78                        print("Source %s not found" % srcfqname)
    7979                        return False
    8080               
     
    108108       
    109109        if (not os.path.isfile(config)):
    110                 print "%s not found." % config
    111                 print "Please specify the path to HelenOS build tree root as the first argument."
     110                print("%s not found." % config)
     111                print("Please specify the path to HelenOS build tree root as the first argument.")
    112112                return
    113113       
     
    115115                if (not clang(rootdir, job)):
    116116                        print
    117                         print "Failed job: %s" % job
     117                        print("Failed job: %s" % job)
    118118                        return
    119119       
    120120        print
    121         print "All jobs passed"
     121        print("All jobs passed")
    122122
    123123if __name__ == '__main__':
  • tools/checkers/jobfile.py

    r458619f7 r28f4adb  
    5454                                nil = True
    5555                        else:
    56                                 print "Unexpected '%s'" % record[i]
     56                                print("Unexpected '%s'" % record[i])
    5757                                return False
    5858               
  • tools/checkers/stanse.py

    r458619f7 r28f4adb  
    4343def usage(prname):
    4444        "Print usage syntax"
    45         print prname + " <ROOT>"
     45        print(prname + " <ROOT>")
    4646
    4747def stanse(root, job):
     
    5454       
    5555        if (not os.path.isfile(inname)):
    56                 print "Unable to open %s" % inname
    57                 print "Did you run \"make precheck\" on the source tree?"
     56                print("Unable to open %s" % inname)
     57                print("Did you run \"make precheck\" on the source tree?")
    5858                return False
    5959       
    60         inf = file(inname, "r")
     60        inf = open(inname, "r")
    6161        records = inf.read().splitlines()
    6262        inf.close()
     
    6969               
    7070                if (len(arg) < 6):
    71                         print "Not enought jobfile record arguments"
     71                        print("Not enought jobfile record arguments")
    7272                        return False
    7373               
     
    8181                srcfqname = os.path.join(base, srcfname)
    8282                if (not os.path.isfile(srcfqname)):
    83                         print "Source %s not found" % srcfqname
     83                        print("Source %s not found" % srcfqname)
    8484                        return False
    8585               
     
    9090                output.append([srcfname, tgtfname, base, options])
    9191       
    92         outf = file(outname, "w")
     92        outf = open(outname, "w")
    9393        for record in output:
    9494                outf.write("{%s},{%s},{%s},{%s}\n" % (record[0], record[1], record[2], record[3]))
     
    121121       
    122122        if (not os.path.isfile(config)):
    123                 print "%s not found." % config
    124                 print "Please specify the path to HelenOS build tree root as the first argument."
     123                print("%s not found." % config)
     124                print("Please specify the path to HelenOS build tree root as the first argument.")
    125125                return
    126126       
     
    128128                if (not stanse(rootdir, job)):
    129129                        print
    130                         print "Failed job: %s" % job
     130                        print("Failed job: %s" % job)
    131131                        return
    132132       
    133133        print
    134         print "All jobs passed"
     134        print("All jobs passed")
    135135
    136136if __name__ == '__main__':
  • tools/checkers/vcc.py

    r458619f7 r28f4adb  
    4949def usage(prname):
    5050        "Print usage syntax"
    51         print prname + " <ROOT> [VCC_PATH]"
     51        print(prname + " <ROOT> [VCC_PATH]")
    5252
    5353def cygpath(upath):
     
    7272        preproc = subprocess.Popen(args, stdout = subprocess.PIPE).communicate()[0]
    7373       
    74         tmpf = file(tmpfname, "w")
     74        tmpf = open(tmpfname, "w")
    7575        tmpf.write(specification)
    7676       
     
    108108       
    109109        if (not os.path.isfile(inname)):
    110                 print "Unable to open %s" % inname
    111                 print "Did you run \"make precheck\" on the source tree?"
     110                print("Unable to open %s" % inname)
     111                print("Did you run \"make precheck\" on the source tree?")
    112112                return False
    113113       
    114         inf = file(inname, "r")
     114        inf = open(inname, "r")
    115115        records = inf.read().splitlines()
    116116        inf.close()
     
    122122               
    123123                if (len(arg) < 6):
    124                         print "Not enought jobfile record arguments"
     124                        print("Not enought jobfile record arguments")
    125125                        return False
    126126               
     
    134134                srcfqname = os.path.join(base, srcfname)
    135135                if (not os.path.isfile(srcfqname)):
    136                         print "Source %s not found" % srcfqname
     136                        print("Source %s not found" % srcfqname)
    137137                        return False
    138138               
     
    153153               
    154154                # Run Vcc
    155                 print " -- %s --" % srcfname           
     155                print(" -- %s --" % srcfname)
    156156                retval = subprocess.Popen([vcc_path, '/pointersize:32', '/newsyntax', cygpath(tmpfqname)]).wait()
    157157               
     
    182182       
    183183        if (not os.path.isfile(vcc_path)):
    184                 print "%s is not a binary." % vcc_path
    185                 print "Please supply the full Cygwin path to Vcc as the second argument."
     184                print("%s is not a binary." % vcc_path)
     185                print("Please supply the full Cygwin path to Vcc as the second argument.")
    186186                return
    187187       
     
    189189       
    190190        if (not os.path.isfile(config)):
    191                 print "%s not found." % config
    192                 print "Please specify the path to HelenOS build tree root as the first argument."
     191                print("%s not found." % config)
     192                print("Please specify the path to HelenOS build tree root as the first argument.")
    193193                return
    194194       
    195195        specpath = os.path.join(rootdir, "tools/checkers/vcc.h")
    196196        if (not os.path.isfile(specpath)):
    197                 print "%s not found." % config
     197                print("%s not found." % config)
    198198                return
    199199       
     
    205205                if (not vcc(vcc_path, rootdir, job)):
    206206                        print
    207                         print "Failed job: %s" % job
     207                        print("Failed job: %s" % job)
    208208                        return
    209209       
    210210        print
    211         print "All jobs passed"
     211        print("All jobs passed")
    212212
    213213if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.