]> granicus.if.org Git - esp-idf/commitdiff
parttool: remove exemption from style check
authorRenz Christian Bagaporo <renz@espressif.com>
Fri, 30 Nov 2018 08:39:55 +0000 (16:39 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Fri, 30 Nov 2018 08:39:55 +0000 (16:39 +0800)
.flake8
components/partition_table/parttool.py

diff --git a/.flake8 b/.flake8
index fd3fec31bb17ff2ab83c2ddb1ac47a47bdd25f4e..3099ce275f32ff1e2240eec88d50417229c75844 100644 (file)
--- a/.flake8
+++ b/.flake8
@@ -156,7 +156,6 @@ exclude =
         components/espcoredump/test/test_espcoredump.py,
         components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py,
         components/partition_table/gen_esp32part.py,
-        components/partition_table/parttool.py,
         components/partition_table/test_gen_esp32part_host/gen_esp32part_tests.py,
         components/protocomm/python/constants_pb2.py,
         components/protocomm/python/sec0_pb2.py,
index 7153018edbc5932abe80d9a7e090e57439c999e9..1155e136f1dd3377f566ed3a48f2ba2a8653f4e2 100755 (executable)
@@ -32,6 +32,7 @@ ESPTOOL_PY = os.path.join(IDF_COMPONENTS_PATH, "esptool_py", "esptool", "esptool
 
 quiet = False
 
+
 def status(msg):
     """ Print status message to stderr """
     if not quiet:
@@ -92,7 +93,7 @@ def _get_partition(args):
     elif args.partition_type and args.partition_subtype:
         partition = partition_table.find_by_type(args.partition_type, args.partition_subtype)
     elif args.partition_boot_default:
-        search = [ "factory" ] + [ "ota_{}".format(d) for d in range(16) ]
+        search = ["factory"] + ["ota_{}".format(d) for d in range(16)]
         for subtype in search:
             partition = partition_table.find_by_type("app", subtype)
             if partition is not None:
@@ -154,7 +155,7 @@ def get_partition_info(args):
     partition = None
 
     if args.table:
-        partition_table =  _get_partition_table(args)
+        partition_table = _get_partition_table(args)
 
         if args.table.endswith(".csv"):
             partition_table = partition_table.to_csv()
@@ -169,7 +170,7 @@ def get_partition_info(args):
 
         if partition:
             info_dict = {
-                "offset" : '0x{:x}'.format(partition.offset),
+                "offset": '0x{:x}'.format(partition.offset),
                 "size": '0x{:x}'.format(partition.size)
             }
 
@@ -181,7 +182,7 @@ def get_partition_info(args):
             except KeyError:
                 raise RuntimeError("Request for unknown partition info {}".format(info))
 
-            status("Requested partition information [{}]:".format( ", ".join(args.info)))
+            status("Requested partition information [{}]:".format(", ".join(args.info)))
             print(" ".join(infos))
         else:
             status("Partition not found")
@@ -192,7 +193,7 @@ def generate_blank_partition_file(args):
     stdout_binary = None
 
     partition = _get_and_check_partition(args)
-    output =  b"\xFF" * partition.size
+    output = b"\xFF" * partition.size
 
     try:
         stdout_binary = sys.stdout.buffer  # Python 3
@@ -226,8 +227,8 @@ def main():
 
     partition_selection_args.add_argument("--partition-name", "-n", help="name of the partition")
     partition_selection_args.add_argument("--partition-type", "-t", help="type of the partition")
-    partition_selection_args.add_argument('--partition-boot-default', "-d", help='select the default boot partition, '+
-                             'using the same fallback logic as the IDF bootloader', action="store_true")
+    partition_selection_args.add_argument('--partition-boot-default', "-d", help='select the default boot partition \
+                                           using the same fallback logic as the IDF bootloader', action="store_true")
 
     parser.add_argument("--partition-subtype", "-s", help="subtype of the partition")
 
@@ -247,7 +248,8 @@ def main():
     print_partition_info_subparser_info_type.add_argument("--info", help="type of partition information to get", nargs="+")
     print_partition_info_subparser_info_type.add_argument("--table", help="dump the partition table to a file")
 
-    generate_blank_subparser = subparsers.add_parser("generate_blank_partition_file", help="generate a blank (all 0xFF) partition file of the specified partition that can be flashed to the device")
+    generate_blank_subparser = subparsers.add_parser("generate_blank_partition_file", help="generate a blank (all 0xFF) partition file of \
+                                                     the specified partition that can be flashed to the device")
     generate_blank_subparser.add_argument("--output", help="blank partition file filename")
 
     args = parser.parse_args()
@@ -274,4 +276,4 @@ def main():
 
 
 if __name__ == '__main__':
-    main()
\ No newline at end of file
+    main()