Changeset 28f4adb in mainline for tools/checkers/stanse.py


Ignore:
Timestamp:
2010-11-02T11:13:36Z (14 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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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__':
Note: See TracChangeset for help on using the changeset viewer.