Cleanup: Silence warnings from 1254fee589

Introduced in 1254fee589

Also remove translation from CLOG statements.

Pull Request: https://projects.blender.org/blender/blender/pulls/116836
This commit is contained in:
Guillermo Venegas 2024-01-06 06:53:42 +01:00 committed by Jesse Yurkovich
parent 75c71b78ba
commit 5b104fb3fa
4 changed files with 11 additions and 9 deletions

View File

@ -1,6 +1,6 @@
"""
Basic FileHandler for Operator that imports just one file
-----------------
---------------------------------------------------------
When creating a ``Operator`` that imports files, you may want to
add them 'drag-and-drop' support, File Handlers helps to define
@ -14,6 +14,7 @@ required a set of properties, when the ``Operator`` can import just one
file per execution it needs to define the following property:
.. code-block:: python
filepath: bpy.props.StringProperty(subtype='FILE_PATH')
This ``filepath`` property now will be used by the ``FileHandler`` to
@ -55,7 +56,7 @@ class CurveTextImport(bpy.types.Operator):
By default the file handler invokes the operator with the filepath property set.
In this example if this property is set the operator is executed, if not the
file select window is invoked.
This depends on setting 'options={'SKIP_SAVE'}' to the property options to avoid
This depends on setting ``options={'SKIP_SAVE'}`` to the property options to avoid
to reuse filepath data between operator calls.
"""

View File

@ -1,11 +1,12 @@
"""
Basic FileHandler for Operator that imports multiple files
-----------------
----------------------------------------------------------
Also operators can be invoked with multiple files from 'drag-and-drop',
but for this it is require to define the following properties:
.. code-block:: python
directory: StringProperty(subtype='FILE_PATH')
files: CollectionProperty(type=bpy.types.OperatorFileListElement)
@ -64,7 +65,7 @@ class ShaderScriptImport(bpy.types.Operator):
By default the file handler invokes the operator with the directory and files properties set.
In this example if this properties are set the operator is executed, if not the
file select window is invoked.
This depends on setting 'options={'SKIP_SAVE'}' to the properties options to avoid
This depends on setting ``options={'SKIP_SAVE'}`` to the properties options to avoid
to reuse filepath data between operator calls.
"""

View File

@ -114,7 +114,7 @@ static PointerRNA file_handler_import_operator_create_ptr(
const char *message =
"Expected operator properties filepath or files and directory not found. Refer to "
"FileHandler documentation for details.";
CLOG_WARN(&LOG, TIP_(message));
CLOG_WARN(&LOG, "%s", message);
}
return props;
}
@ -195,7 +195,7 @@ void WM_OT_drop_import_file(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
void drop_import_file_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
static void drop_import_file_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
{
const auto paths = WM_drag_get_paths(drag);

View File

@ -819,7 +819,7 @@ PropertyRNA *RNA_struct_find_property_check(PointerRNA &props,
return prop;
}
CLOG_WARN(&LOG,
TIP_("'%s : %s()' expected, got '%s : %s()'"),
"'%s : %s()' expected, got '%s : %s()'",
name,
rna_property_type_identifier(property_type_check),
name,
@ -844,7 +844,7 @@ PropertyRNA *RNA_struct_find_collection_property_check(PointerRNA &props,
if (prop_type != PROP_COLLECTION) {
CLOG_WARN(&LOG,
TIP_("'%s : %s(type = %s)' expected, got '%s : %s()'"),
"'%s : %s(type = %s)' expected, got '%s : %s()'",
name,
rna_property_type_identifier(PROP_COLLECTION),
RNA_struct_identifier(struct_type_check),
@ -854,7 +854,7 @@ PropertyRNA *RNA_struct_find_collection_property_check(PointerRNA &props,
}
CLOG_WARN(&LOG,
TIP_("'%s : %s(type = %s)' expected, got '%s : %s(type = %s)'."),
"'%s : %s(type = %s)' expected, got '%s : %s(type = %s)'.",
name,
rna_property_type_identifier(PROP_COLLECTION),
RNA_struct_identifier(struct_type_check),