diff --git a/tools/esptool.py b/tools/esptool.py index 944a59b728..6e10a20fdb 100755 --- a/tools/esptool.py +++ b/tools/esptool.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # # ESP8266 ROM Bootloader Utility # https://github.com/themadinventor/esptool @@ -8,8 +8,8 @@ # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT +# +# This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # @@ -286,7 +286,7 @@ def flash_erase(self): # It it on the other hand unlikely to fail. class ESPFirmwareImage: - + def __init__(self, filename = None): self.segments = [] self.entrypoint = 0 @@ -296,11 +296,11 @@ def __init__(self, filename = None): if filename is not None: f = file(filename, 'rb') (magic, segments, self.flash_mode, self.flash_size_freq, self.entrypoint) = struct.unpack(' 16: raise Exception('Invalid firmware image') - + for i in xrange(segments): (offset, size) = struct.unpack(' 0x40200000 or offset < 0x3ffe0000 or size > 65536: @@ -458,8 +458,8 @@ def arg_auto_int(x): 'make_image', help = 'Create an application image from binary files') parser_make_image.add_argument('output', help = 'Output image file') - parser_make_image.add_argument('--segfile', '-f', action = 'append', help = 'Segment input file') - parser_make_image.add_argument('--segaddr', '-a', action = 'append', help = 'Segment base address', type = arg_auto_int) + parser_make_image.add_argument('--segfile', '-f', action = 'append', help = 'Segment input file') + parser_make_image.add_argument('--segaddr', '-a', action = 'append', help = 'Segment base address', type = arg_auto_int) parser_make_image.add_argument('--entrypoint', '-e', help = 'Address of entry point', type = arg_auto_int, default = 0) parser_elf2image = subparsers.add_parser(