Changes in tools/pack.py [f4660690:28f4adb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/pack.py
rf4660690 r28f4adb 43 43 def usage(prname): 44 44 "Print usage syntax" 45 print "%s <OBJCOPY> <FORMAT> <ARCH> <ARCH_PATH> [COMPONENTS ...]" % prname45 print("%s <OBJCOPY> <FORMAT> <ARCH> <ARCH_PATH> [COMPONENTS ...]" % prname) 46 46 47 47 def deflate(data): … … 110 110 symbol = "_binary_%s" % basename.replace(".", "_") 111 111 112 print "%s -> %s" % (component, obj)112 print("%s -> %s" % (component, obj)) 113 113 114 comp_in = file(component, "rb")115 comp_data = comp_in.read() ;114 comp_in = open(component, "rb") 115 comp_data = comp_in.read() 116 116 comp_in.close() 117 117 … … 121 121 122 122 try: 123 comp_out = file(basename, "wb")123 comp_out = open(basename, "wb") 124 124 comp_out.write(comp_deflate) 125 125 comp_out.close() … … 151 151 cnt += 1 152 152 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") 154 154 155 155 header.write('/***************************************\n') … … 173 173 header.close() 174 174 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") 176 176 177 177 data.write('/***************************************\n') … … 187 187 data.close() 188 188 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") 190 190 template = link_in.read() 191 191 link_in.close() 192 192 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") 194 194 link_out.write(template.replace("[[COMPONENTS]]", "\n".join(link_ctx))) 195 195 link_out.close()
Note:
See TracChangeset
for help on using the changeset viewer.