mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
moved compile_list_of_regexes to profiles_filtering and moved it's import in openpype.lib earlier
This commit is contained in:
parent
0631a7d9b9
commit
95424cdfc7
3 changed files with 26 additions and 25 deletions
|
|
@ -59,6 +59,11 @@ from .python_module_tools import (
|
||||||
import_module_from_dirpath
|
import_module_from_dirpath
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from .profiles_filtering import (
|
||||||
|
compile_list_of_regexes,
|
||||||
|
filter_profiles
|
||||||
|
)
|
||||||
|
|
||||||
from .avalon_context import (
|
from .avalon_context import (
|
||||||
CURRENT_DOC_SCHEMAS,
|
CURRENT_DOC_SCHEMAS,
|
||||||
PROJECT_NAME_ALLOWED_SYMBOLS,
|
PROJECT_NAME_ALLOWED_SYMBOLS,
|
||||||
|
|
@ -118,13 +123,9 @@ from .applications import (
|
||||||
prepare_host_environments,
|
prepare_host_environments,
|
||||||
prepare_context_environments,
|
prepare_context_environments,
|
||||||
get_app_environments_for_context,
|
get_app_environments_for_context,
|
||||||
apply_project_environments_value,
|
apply_project_environments_value
|
||||||
|
|
||||||
compile_list_of_regexes
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from .profiles_filtering import filter_profiles
|
|
||||||
|
|
||||||
from .plugin_tools import (
|
from .plugin_tools import (
|
||||||
TaskNotSetError,
|
TaskNotSetError,
|
||||||
get_subset_name,
|
get_subset_name,
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ from . import (
|
||||||
PypeLogger,
|
PypeLogger,
|
||||||
Anatomy
|
Anatomy
|
||||||
)
|
)
|
||||||
|
from .profiles_filtering import compile_list_of_regexes
|
||||||
from .local_settings import get_openpype_username
|
from .local_settings import get_openpype_username
|
||||||
from .avalon_context import (
|
from .avalon_context import (
|
||||||
get_workdir_data,
|
get_workdir_data,
|
||||||
|
|
@ -1495,22 +1496,3 @@ def should_workfile_tool_start(
|
||||||
|
|
||||||
return get_option_from_settings(
|
return get_option_from_settings(
|
||||||
startup_presets, host_name, task_name, default_output)
|
startup_presets, host_name, task_name, default_output)
|
||||||
|
|
||||||
|
|
||||||
def compile_list_of_regexes(in_list):
|
|
||||||
"""Convert strings in entered list to compiled regex objects."""
|
|
||||||
regexes = list()
|
|
||||||
if not in_list:
|
|
||||||
return regexes
|
|
||||||
|
|
||||||
for item in in_list:
|
|
||||||
if not item:
|
|
||||||
continue
|
|
||||||
try:
|
|
||||||
regexes.append(re.compile(item))
|
|
||||||
except TypeError:
|
|
||||||
print((
|
|
||||||
"Invalid type \"{}\" value \"{}\"."
|
|
||||||
" Expected string based object. Skipping."
|
|
||||||
).format(str(type(item)), str(item)))
|
|
||||||
return regexes
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,28 @@
|
||||||
import re
|
import re
|
||||||
import logging
|
import logging
|
||||||
from .applications import compile_list_of_regexes
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def compile_list_of_regexes(in_list):
|
||||||
|
"""Convert strings in entered list to compiled regex objects."""
|
||||||
|
regexes = list()
|
||||||
|
if not in_list:
|
||||||
|
return regexes
|
||||||
|
|
||||||
|
for item in in_list:
|
||||||
|
if not item:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
regexes.append(re.compile(item))
|
||||||
|
except TypeError:
|
||||||
|
print((
|
||||||
|
"Invalid type \"{}\" value \"{}\"."
|
||||||
|
" Expected string based object. Skipping."
|
||||||
|
).format(str(type(item)), str(item)))
|
||||||
|
return regexes
|
||||||
|
|
||||||
|
|
||||||
def _profile_exclusion(matching_profiles, logger):
|
def _profile_exclusion(matching_profiles, logger):
|
||||||
"""Find out most matching profile byt host, task and family match.
|
"""Find out most matching profile byt host, task and family match.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue