[Bf-blender-cvs] [e288e392a8c] master: Cleanup: line length in Python scripts
Campbell Barton
noreply at git.blender.org
Sun Oct 24 13:41:43 CEST 2021
Commit: e288e392a8c3100cb60f6b7659323905e47c72b8
Author: Campbell Barton
Date: Sun Oct 24 19:12:34 2021 +1100
Branches: master
https://developer.blender.org/rBe288e392a8c3100cb60f6b7659323905e47c72b8
Cleanup: line length in Python scripts
===================================================================
M release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
M release/scripts/modules/bl_previews_utils/bl_previews_render.py
M release/scripts/startup/bl_operators/wm.py
M release/scripts/startup/bl_ui/properties_physics_fluid.py
M release/scripts/startup/bl_ui/properties_physics_rigidbody.py
M release/scripts/startup/bl_ui/space_filebrowser.py
M release/scripts/startup/bl_ui/space_node.py
===================================================================
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
index 6c9c212387e..49dbac1d502 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
@@ -743,7 +743,9 @@ def dump_src_messages(msgs, reports, settings):
def clean_str(s):
# The encode/decode to/from 'raw_unicode_escape' allows to transform the C-type unicode hexadecimal escapes
# (like '\u2715' for the '×' symbol) back into a proper unicode character.
- return "".join(m.group("clean") for m in _clean_str(s)).encode('raw_unicode_escape').decode('raw_unicode_escape')
+ return "".join(
+ m.group("clean") for m in _clean_str(s)
+ ).encode('raw_unicode_escape').decode('raw_unicode_escape')
def dump_src_file(path, rel_path, msgs, reports, settings):
def process_entry(_msgctxt, _msgid):
@@ -870,7 +872,10 @@ def dump_messages(do_messages, do_checks, settings):
dump_src_messages(msgs, reports, settings)
# Get strings from addons' categories.
- for uid, label, tip in bpy.types.WindowManager.addon_filter.keywords['items'](bpy.context.window_manager, bpy.context):
+ for uid, label, tip in bpy.types.WindowManager.addon_filter.keywords['items'](
+ bpy.context.window_manager,
+ bpy.context,
+ ):
process_msg(msgs, settings.DEFAULT_CONTEXT, label, "Add-ons' categories", reports, None, settings)
if tip:
process_msg(msgs, settings.DEFAULT_CONTEXT, tip, "Add-ons' categories", reports, None, settings)
diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
index fa3355bd6d5..0b3b3a4e406 100644
--- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py
+++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
@@ -483,19 +483,44 @@ def main():
argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
parser = argparse.ArgumentParser(
- description="Use Blender to generate previews for currently open Blender file's items.")
- parser.add_argument('--clear', default=False, action="store_true",
- help="Clear previews instead of generating them.")
- parser.add_argument('--no_backups', default=False, action="store_true",
- help="Do not generate a backup .blend1 file when saving processed ones.")
- parser.add_argument('--no_scenes', default=True, action="store_false",
- help="Do not generate/clear previews for scene IDs.")
- parser.add_argument('--no_collections', default=True, action="store_false",
- help="Do not generate/clear previews for collection IDs.")
- parser.add_argument('--no_objects', default=True, action="store_false",
- help="Do not generate/clear previews for object IDs.")
- parser.add_argument('--no_data_intern', default=True, action="store_false",
- help="Do not generate/clear previews for mat/tex/image/etc. IDs (those handled by core Blender code).")
+ description="Use Blender to generate previews for currently open Blender file's items.",
+ )
+ parser.add_argument(
+ '--clear',
+ default=False,
+ action="store_true",
+ help="Clear previews instead of generating them.",
+ )
+ parser.add_argument(
+ '--no_backups',
+ default=False,
+ action="store_true",
+ help="Do not generate a backup .blend1 file when saving processed ones.",
+ )
+ parser.add_argument(
+ '--no_scenes',
+ default=True,
+ action="store_false",
+ help="Do not generate/clear previews for scene IDs.",
+ )
+ parser.add_argument(
+ '--no_collections',
+ default=True,
+ action="store_false",
+ help="Do not generate/clear previews for collection IDs.",
+ )
+ parser.add_argument(
+ '--no_objects',
+ default=True,
+ action="store_false",
+ help="Do not generate/clear previews for object IDs.",
+ )
+ parser.add_argument(
+ '--no_data_intern',
+ default=True,
+ action="store_false",
+ help="Do not generate/clear previews for mat/tex/image/etc. IDs (those handled by core Blender code).",
+ )
args = parser.parse_args(argv)
orig_save_version = bpy.context.preferences.filepaths.save_version
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index b011711d133..170b9f3ae44 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1327,7 +1327,10 @@ class WM_OT_properties_edit(Operator):
use_soft_limits: BoolProperty(
name="Use Soft Limits",
- description="Limits the Property Value slider to a range, values outside the range must be inputted numerically",
+ description=(
+ "Limits the Property Value slider to a range, "
+ "values outside the range must be inputted numerically"
+ ),
)
array_length: IntProperty(
name="Array Length",
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 6408d4096fe..47f0b399b66 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -227,7 +227,12 @@ class PHYSICS_PT_settings(PhysicButtonsPanel, Panel):
split.enabled = note_flag and ob.mode == 'OBJECT'
bake_incomplete = (domain.cache_frame_pause_data < domain.cache_frame_end)
- if domain.cache_resumable and domain.has_cache_baked_data and not domain.is_cache_baking_data and bake_incomplete:
+ if (
+ domain.cache_resumable and
+ domain.has_cache_baked_data and
+ not domain.is_cache_baking_data and
+ bake_incomplete
+ ):
col = split.column()
col.operator("fluid.bake_data", text="Resume")
col = split.column()
@@ -1249,7 +1254,12 @@ class PHYSICS_PT_cache(PhysicButtonsPanel, Panel):
split.enabled = ob.mode == 'OBJECT'
bake_incomplete = (domain.cache_frame_pause_data < domain.cache_frame_end)
- if domain.cache_resumable and domain.has_cache_baked_data and not domain.is_cache_baking_data and bake_incomplete:
+ if (
+ domain.cache_resumable and
+ domain.has_cache_baked_data and
+ not domain.is_cache_baking_data and
+ bake_incomplete
+ ):
col = split.column()
col.operator("fluid.bake_all", text="Resume")
col = split.column()
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
index a55bd89ca18..26fe215b17d 100644
--- a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
@@ -109,7 +109,11 @@ class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
@classmethod
def poll(cls, context):
obj = context.object
- if obj.parent is not None and obj.parent.rigid_body is not None and not obj.parent.rigid_body.collision_shape == 'COMPOUND':
+ if (
+ (obj.parent is not None) and
+ (obj.parent.rigid_body is not None) and
+ (not obj.parent.rigid_body.collision_shape == 'COMPOUND')
+ ):
return False
return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES))
@@ -124,7 +128,11 @@ class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
layout.prop(rbo, "collision_shape", text="Shape")
if rbo.collision_shape == 'COMPOUND':
- if parent is not None and parent.rigid_body is not None and parent.rigid_body.collision_shape == 'COMPOUND':
+ if (
+ (parent is not None) and
+ (parent.rigid_body is not None) and
+ (parent.rigid_body.collision_shape == 'COMPOUND')
+ ):
rigid_body_warning(layout, "Sub compound shapes are not allowed")
else:
found = False
@@ -179,7 +187,11 @@ class PHYSICS_PT_rigid_body_collisions_sensitivity(PHYSICS_PT_rigidbody_panel, P
@classmethod
def poll(cls, context):
obj = context.object
- if obj.parent is not None and obj.parent.rigid_body is not None and not obj.parent.rigid_body.collision_shape == 'COMPOUND':
+ if (
+ (obj.parent is not None) and
+ (obj.parent.rigid_body is not None) and
+ (not obj.parent.rigid_body.collision_shape == 'COMPOUND')
+ ):
return False
return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES))
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index 62a9343f644..927a30f0ae0 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -614,7 +614,10 @@ class ASSETBROWSER_PT_filter(asset_utils.AssetBrowserPanel, Panel):
filter_id = params.filter_asset_id
for identifier in dir(filter_id):
- if identifier.startswith("filter_") or (identifier.startswith("experimental_filter_") and use_extended_browser):
+ if (
+ identifier.startswith("filter_") or
+ (identifier.startswith("experimental_filter_") and use_extended_browser)
+ ):
row = col.row()
row.label(icon=filter_id.bl_rna.properties[identifier].icon)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list