Changeset 28f4adb in mainline for tools/pack.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/pack.py

    r458619f7 r28f4adb  
    4343def usage(prname):
    4444        "Print usage syntax"
    45         print "%s <OBJCOPY> <FORMAT> <ARCH> <ARCH_PATH> [COMPONENTS ...]" % prname
     45        print("%s <OBJCOPY> <FORMAT> <ARCH> <ARCH_PATH> [COMPONENTS ...]" % prname)
    4646
    4747def deflate(data):
     
    110110                symbol = "_binary_%s" % basename.replace(".", "_")
    111111               
    112                 print "%s -> %s" % (component, obj)
     112                print("%s -> %s" % (component, obj))
    113113               
    114                 comp_in = file(component, "rb")
     114                comp_in = open(component, "rb")
    115115                comp_data = comp_in.read()
    116116                comp_in.close()
     
    121121               
    122122                try:
    123                         comp_out = file(basename, "wb")
     123                        comp_out = open(basename, "wb")
    124124                        comp_out.write(comp_deflate)
    125125                        comp_out.close()
     
    151151                cnt += 1
    152152       
    153         header = file(os.path.join(arch_path, "include", "%s.h" % COMPONENTS), "w")
     153        header = open(os.path.join(arch_path, "include", "%s.h" % COMPONENTS), "w")
    154154       
    155155        header.write('/***************************************\n')
     
    173173        header.close()
    174174       
    175         data = file(os.path.join(arch_path, "src", "%s.c" % COMPONENTS), "w")
     175        data = open(os.path.join(arch_path, "src", "%s.c" % COMPONENTS), "w")
    176176       
    177177        data.write('/***************************************\n')
     
    187187        data.close()
    188188       
    189         link_in = file(os.path.join(arch_path, "%s.in" % LINK), "r")
     189        link_in = open(os.path.join(arch_path, "%s.in" % LINK), "r")
    190190        template = link_in.read()
    191191        link_in.close()
    192192       
    193         link_out = file(os.path.join(arch_path, "%s.comp" % LINK), "w")
     193        link_out = open(os.path.join(arch_path, "%s.comp" % LINK), "w")
    194194        link_out.write(template.replace("[[COMPONENTS]]", "\n".join(link_ctx)))
    195195        link_out.close()
Note: See TracChangeset for help on using the changeset viewer.