[nodes] Use raw strings for parameters that contain regular expressions

Regular expressions in regular strings generate deprecation warnings
with Python 3 ("invalid escape sequence \x"). To fix these warnings,
the regex must be contained within a raw string. For nodes that have
parameters whose description and/or value contain regex, the strings
are transformed into raw strings. In the case of descriptions, which are
generally written across several lines, regular strings are concatenated
with regular strings to preserve line returns (with "\n", which becomes
uneffective in raw strings).
This commit is contained in:
Candice Bentéjac 2022-12-05 16:52:54 +01:00
parent 8bef398bed
commit 189cb6be5b
3 changed files with 11 additions and 11 deletions

View file

@ -57,10 +57,10 @@ The alignment can be based on:
description='Matching regular expression for the "from_cameras_filepath" method. '
'You should capture specific parts of the filepath with parenthesis to define matching elements.\n'
'Some examples of patterns:\n'
' - Match the filename without extension (default value): ".*\/(.*?)\.\w{3}"\n'
' - Match the filename suffix after "_": ".*\/.*(_.*?\.\w{3})"\n'
' - Match the filename prefix before "_": ".*\/(.*?)_.*\.\w{3}"\n',
value='.*\/(.*?)\.\w{3}',
r' - Match the filename without extension (default value): ".*\/(.*?)\.\w{3}"' + '\n' +
r' - Match the filename suffix after "_": ".*\/.*(_.*?\.\w{3})"' + '\n' +
r' - Match the filename prefix before "_": ".*\/(.*?)_.*\.\w{3}"',
value=r'.*\/(.*?)\.\w{3}',
uid=[0],
),
desc.ListAttribute(