Changes in tools/pack.py [28f4adb:f4660690] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/pack.py

    r28f4adb rf4660690  
    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 = open(component, "rb")
    115                 comp_data = comp_in.read()
     114                comp_in = file(component, "rb")
     115                comp_data = comp_in.read();
    116116                comp_in.close()
    117117               
     
    121121               
    122122                try:
    123                         comp_out = open(basename, "wb")
     123                        comp_out = file(basename, "wb")
    124124                        comp_out.write(comp_deflate)
    125125                        comp_out.close()
     
    151151                cnt += 1
    152152       
    153         header = open(os.path.join(arch_path, "include", "%s.h" % COMPONENTS), "w")
     153        header = file(os.path.join(arch_path, "include", "%s.h" % COMPONENTS), "w")
    154154       
    155155        header.write('/***************************************\n')
     
    173173        header.close()
    174174       
    175         data = open(os.path.join(arch_path, "src", "%s.c" % COMPONENTS), "w")
     175        data = file(os.path.join(arch_path, "src", "%s.c" % COMPONENTS), "w")
    176176       
    177177        data.write('/***************************************\n')
     
    187187        data.close()
    188188       
    189         link_in = open(os.path.join(arch_path, "%s.in" % LINK), "r")
     189        link_in = file(os.path.join(arch_path, "%s.in" % LINK), "r")
    190190        template = link_in.read()
    191191        link_in.close()
    192192       
    193         link_out = open(os.path.join(arch_path, "%s.comp" % LINK), "w")
     193        link_out = file(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.