Skip to content

Commit

Permalink
feat(parameterised): job needs have parameterised names
Browse files Browse the repository at this point in the history
apply parameterised name cleansing to job needs
  • Loading branch information
gigamac committed Aug 30, 2024
1 parent a89a021 commit 7bb737e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mermaid_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
pipeline_objects = Pipeline('mermaid-pipeline',openFile.open_file(args.input_file))
mermaid_flow_objects = MermaidFlowChartObjects().build(pipeline_objects)
mermaid_flowchart = FlowChart(mermaid_flow_objects, Orient.top2bottom)
document = iter(write_document(mermaid_flowchart, Orient.top2bottom))
document = write_document(mermaid_flowchart, Orient.top2bottom)
# document = iter(document)
output_file_name = args.input_file.split('/')[-1].split('.')[0]

i = 1
Expand Down
5 changes: 3 additions & 2 deletions yaml_objects/job/JobNeed.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import re
from file_functions.tryNext import tryNext
from match_functions.identify_line import identify_line
from match_functions.special_characters import Specials
from pipeline.Parsers import ParserFunction


class JobNeeds:
job_needs = []
current_line = ''
PATTERN_JOB_SPEC = '^ {{{}}} {{0,}}- job: ([a-z,\-,0-9]*)'
PATTERN_JOB_SPEC = '^ {{{}}} {{0,}}- job: ([",\[,\],\$,a-z,\-,\_,\.,0-9, ]{{1,}})'
PATTERN_JOB = '^ {{{}}} {{1,}}- ([a-z,\-,0-9]*)[^:]{{0,1}}'
PATTERN_JOB_ARTIFACT_TF = '^ {{{}}} {{1,}}artifacts: ([a-z]*)$'
PATTERN_JOB_OPTIONAL_TF = '^ {{{}}} {{1,}}optional: ([a-z]*)$'
pattern_job_needs_regex = []
job_needs_parsers = []

def job_spec(self,matching_rule, job_need, current_line):
job_name = re.search(matching_rule,current_line).group(1)
job_name = Specials().cleanse_special_characters(re.search(matching_rule,current_line).group(1))
print(job_name)
job_done = None
if job_need.needed_job != '':
Expand Down

0 comments on commit 7bb737e

Please sign in to comment.