Changeset efedee77 in mainline for tools/pack.py


Ignore:
Timestamp:
2010-11-02T22:38:46Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
af894a21
Parents:
aab02fb (diff), e06ef614 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/pack.py

    raab02fb refedee77  
    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")
    115                 comp_data = comp_in.read();
     114                comp_in = open(component, "rb")
     115                comp_data = comp_in.read()
    116116                comp_in.close()
    117117               
     
    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.