Cleanup: wrap Python lines exceeding 120

This commit is contained in:
Campbell Barton
2025-02-13 10:01:03 +11:00
parent bbe4bb38a0
commit e2fc2d96f8
3 changed files with 24 additions and 19 deletions

View File

@@ -8,7 +8,7 @@ This script is used to help cleaning RNA api.
Typical line in the input file (elements in [] are optional).
[comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean [Align rotation with the snapping target]
[comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean [Align description]
Geterate output format from blender run this:
./blender.bin --background --python ./scripts/modules/rna_info.py 2> source/blender/makesrna/rna_cleanup/out.txt
@@ -31,10 +31,11 @@ def usage():
import sys
scriptname = sys.argv[0]
sort_choices_string = '|'.join(sort_choices)
message = "\nUSAGE:"
message += "\n%s input-file (.txt|.py) order-priority (%s).\n" % (font_bold(scriptname), sort_choices_string)
message += "%s -h for help\n" % font_bold(scriptname)
print(message)
print("".join((
"USAGE:\n",
"{:s} input-file (.txt|.py) order-priority ({:s}).\n".format(font_bold(scriptname), sort_choices_string),
"{:s} -h for help\n".format(font_bold(scriptname)),
)))
exit()
@@ -42,14 +43,16 @@ def help():
"""
Prints script' help.
"""
message = '\nHELP:'
message += '\nRun this script to re-format the edits you make in the input file.\n'
message += 'Do quick modification to important fields like \'to\' and don\'t care about fields like \'changed\' or \'description\' and save.\n'
message += 'The script outputs 3 files:\n'
message += ' 1) *_clean.txt: is formatted same as the .txt input, can be edited by user.\n'
message += ' 2) *_clean.py: is formatted same as the .py input, can be edited by user.\n'
message += ' 3) rna_api.py is not formatted for readability and go under complete check. Can be used for rna cleanup.\n'
print(message)
print("".join((
'HELP:\n'
'Run this script to re-format the edits you make in the input file.\n'
'Do quick modification to important fields like \'to\' and don\'t care about ',
'fields like \'changed\' or \'description\' and save.\n'
'The script outputs 3 files:\n'
' 1) *_clean.txt: is formatted same as the .txt input, can be edited by user.\n'
' 2) *_clean.py: is formatted same as the .py input, can be edited by user.\n'
' 3) rna_api.py is not formatted for readability and go under complete check. Can be used for rna cleanup.\n',
)))
usage()
@@ -260,7 +263,7 @@ def write_files(basename, props_list, props_length_max):
f_py = open(basename + '_work.py', 'w')
# reminder: props=[comment, changed, bclass, bfrom, bto, kwcheck, btype, description]
# [comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean [Align rotation with the snapping target]
# [comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean [Align description]
rna = py = txt = ''
props_list = [['NOTE', 'CHANGED', 'CLASS', 'FROM', 'TO', 'KEYWORD-CHECK', 'TYPE', 'DESCRIPTION']] + props_list
for props in props_list:

View File

@@ -548,7 +548,9 @@ class BlendFileBlock:
yield (k, "<%s>" % dna_type.dna_type_id.decode('ascii'))
########################################################################################################################
# -----------------------------------------------------------------------------
# Low Level Blend File Access
# Way more basic access to blend-file data, without any DNA handling.
class BlendFileRaw:

View File

@@ -12,20 +12,20 @@ Useful for reviewing revisions to back-port to stable builds.
Note that, if any of the data files generated already exist, they will be extended
with new revisions, not overwritten.
Note that, for the most complex 'wiki-ready' file generated by `--accept-releaselog`,
Note that, for the most complex 'wiki-ready' file generated by `--accept-releaselog`,
proof-reading after this tool has ran is heavily suggested!
Example usage:
./git_log_review_commits_advanced.py --source ../../.. --range HEAD~40..HEAD --filter 'BUGFIX' --accept-pretty --accept-releaselog --blender-rev 2.79
./git_log_review_commits_advanced.py --source ../../.. --range HEAD~40..HEAD --filter 'BUGFIX' --accept-pretty --accept-releaselog --blender-rev 2.79
To add list of fixes between RC2 and RC3, and list both RC2 and RC3 fixes also in their own sections:
./git_log_review_commits_advanced.py --source ../../.. --range <RC2 revision>..<RC3 revision> --filter 'BUGFIX' --accept-pretty --accept-releaselog --blender-rev 2.79 --blender-rstate=RC3 --blender-rstate-list="RC2,RC3"
./git_log_review_commits_advanced.py --source ../../.. --range <RC2 revision>..<RC3 revision> --filter 'BUGFIX' --accept-pretty --accept-releaselog --blender-rev 2.79 --blender-rstate=RC3 --blender-rstate-list="RC2,RC3"
To exclude all commits from some given files, by sha1 or by commit message (from previously generated release logs) - much handy when going over commits which were partially cherry-picked into a previous release branch e.g.:
./git_log_review_commits_advanced.py --source ../../.. --range HEAD~40..HEAD --filter 'BUGFIX' --filter-exclude-sha1-fromfiles "review_accept.txt" "review_reject.txt" --filter-exclude-fromreleaselogs "review_accept_release_log.txt" --accept-pretty --accept-releaselog --blender-rev 2.75
./git_log_review_commits_advanced.py --source ../../.. --range HEAD~40..HEAD --filter 'BUGFIX' --filter-exclude-sha1-fromfiles "review_accept.txt" "review_reject.txt" --filter-exclude-fromreleaselogs "review_accept_release_log.txt" --accept-pretty --accept-releaselog --blender-rev 2.75
"""