From 41d2d6da0c96d351b47acb64d3e0decdba16cb16 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 2 Oct 2020 10:15:51 +1000 Subject: Cleanup: pep8 (indentation, spacing, long lines) --- source/blender/datatoc/datatoc_icon.py | 5 ++++- source/blender/datatoc/datatoc_icon_split_to_png.py | 5 ++++- source/blender/makesrna/rna_cleanup/rna_cleaner.py | 3 ++- source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/datatoc/datatoc_icon.py b/source/blender/datatoc/datatoc_icon.py index 6d8b24924f1..875e5359079 100755 --- a/source/blender/datatoc/datatoc_icon.py +++ b/source/blender/datatoc/datatoc_icon.py @@ -26,7 +26,10 @@ def write_png(buf, width, height): import struct # reverse the vertical line order and add null bytes at the start width_byte_4 = width * 4 - raw_data = b"".join(b'\x00' + buf[span:span + width_byte_4] for span in range((height - 1) * width * 4, -1, - width_byte_4)) + raw_data = b"".join( + b'\x00' + buf[span:span + width_byte_4] + for span in range((height - 1) * width * 4, -1, - width_byte_4) + ) def png_pack(png_tag, data): chunk_head = png_tag + data diff --git a/source/blender/datatoc/datatoc_icon_split_to_png.py b/source/blender/datatoc/datatoc_icon_split_to_png.py index b583b10b9ff..f8ddcdd216f 100755 --- a/source/blender/datatoc/datatoc_icon_split_to_png.py +++ b/source/blender/datatoc/datatoc_icon_split_to_png.py @@ -26,7 +26,10 @@ def write_png(buf, width, height): import struct # reverse the vertical line order and add null bytes at the start width_byte_4 = width * 4 - raw_data = b"".join(b'\x00' + buf[span:span + width_byte_4] for span in range((height - 1) * width * 4, -1, - width_byte_4)) + raw_data = b"".join( + b'\x00' + buf[span:span + width_byte_4] + for span in range((height - 1) * width * 4, -1, - width_byte_4) + ) def png_pack(png_tag, data): chunk_head = png_tag + data diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py index f107b5aee63..eaeca562e47 100755 --- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py +++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py @@ -277,7 +277,8 @@ def write_files(basename, props_list, props_length_max): indent = '# ' else: indent = ' ' - rna += indent + '("%s", "%s", "%s", "%s", "%s"),\n' % tuple(props[2:5] + props[6:]) # description is already string formatted + # Description is already string formatted. + rna += indent + '("%s", "%s", "%s", "%s", "%s"),\n' % tuple(props[2:5] + props[6:]) # py blanks = [' ' * (x[0] - x[1]) for x in zip(props_length_max, list(map(len, props)))] props = [('"%s"%s' if props[-1] != x[0] else "%s%s") % (x[0], x[1]) for x in zip(props, blanks)] diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py b/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py index 236313f1f5c..8d1ec0b324b 100755 --- a/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py +++ b/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py @@ -56,7 +56,10 @@ def main(): if mod_from_dict: file_path = sys.argv[-2][:-3] + "_lost.py" write_work_file(file_path, list(mod_from_dict.values())) - print("Warning '%s' contains lost %d items from module %s.py" % (file_path, len(mod_from_dict), mod_from.__name__)) + print( + "Warning '%s' contains lost %d items from module %s.py" % + (file_path, len(mod_from_dict), mod_from.__name__) + ) if __name__ == "__main__": -- cgit v1.2.3