Update client/ayon_core/lib/path_templates.py

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
__robin__ 2024-08-19 08:08:33 -04:00 committed by GitHub
parent eaa1b503b7
commit 44c417fdb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -462,14 +462,17 @@ class FormattingPart:
@staticmethod
def validate_key_is_matched(key):
"""
Finds out how balanced an expression is.
With a string containing only brackets.
"""Validate that opening has closing at correct place.
Example:
>>> is_matched("[]()()(((([])))")
False
>>> is_matched("[](){{{[]}}}")
True
Returns:
bool: Openings and closinga are valid.
>>> is_matched('[]()()(((([])))')
False
>>> is_matched('[](){{{[]}}}')
True
"""
opening = tuple('({[')
closing = tuple(')}]')