refactor(api/core/app/segments): Support more kinds of Segments. (#6706)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
6b50bb0fe6
commit
c6996a48a4
11 changed files with 147 additions and 96 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import re
|
||||
|
||||
from core.app.segments import SegmentGroup, factory
|
||||
from core.workflow.entities.variable_pool import VariablePool
|
||||
|
||||
from . import SegmentGroup, factory
|
||||
|
||||
VARIABLE_PATTERN = re.compile(r'\{\{#([a-zA-Z0-9_]{1,50}(?:\.[a-zA-Z_][a-zA-Z0-9_]{0,29}){1,10})#\}\}')
|
||||
|
||||
|
||||
|
|
@ -14,4 +15,4 @@ def convert_template(*, template: str, variable_pool: VariablePool):
|
|||
segments.append(value)
|
||||
else:
|
||||
segments.append(factory.build_segment(part))
|
||||
return SegmentGroup(segments=segments)
|
||||
return SegmentGroup(value=segments)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue