Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
FS-3629: Ignore python directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tferns committed Nov 23, 2023
1 parent d14f851 commit 666ff4e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/anchore-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- main
- master
paths-ignore:
- "python/**"

env:
IMAGE_NAME_STUB: "digital-form-builder-dluhc-"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/branch--lint-unit-and-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths-ignore:
- "docs/**"
- "**/README.md"
- "python/**"
workflow_dispatch:
jobs:
lint-and-test:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dluhc-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
".github/workflows/dluhc-build-and-deploy-with-forms.yml",
".github/workflows/increment-version.yml",
"version",
"python/**"
]

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-and-tag-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
python -m venv .venv
source .venv/bin/activate && python -m pip install --upgrade pip && pip install -r python/requirements.txt
pytest python/tests
pytest -m python/tests
create-release:
runs-on: ubuntu-latest
Expand Down
16 changes: 9 additions & 7 deletions python/answer_displayers/MultiInputField.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,39 @@ def _legacy_parsed_answer(self) -> str:
)

@property
def _parse_multi_input_component(self) -> dict[str, AnswerDisplayer]:
def _parse_multi_input_component(self) -> list[dict[str, AnswerDisplayer]]:
from python.dictionaries import (
EXISTING_KEY_TO_TYPE_DICT,
FIELD_TO_DISPLAYER_DICT_MULTI_INPUT,
)

raw_answer: list[dict[str, Any]] = self.raw_answer
answer_displayers: dict[str, AnswerDisplayer] = {}
answer_displayers_dict_list: list[dict[str, AnswerDisplayer]] = []
for answer_tuple in raw_answer:
answer_displayer_dict = {}
for key, answer in answer_tuple.items():
answer_type = EXISTING_KEY_TO_TYPE_DICT[key]
displayer = FIELD_TO_DISPLAYER_DICT_MULTI_INPUT[answer_type](answer)
answer_displayers[key] = displayer
return answer_displayers
answer_displayer_dict[key] = displayer
answer_displayers_dict_list.append(answer_displayer_dict)
return answer_displayers_dict_list

@property
def as_csv(self) -> str | dict[str, AnswerDisplayer]:
def as_csv(self) -> str | list[dict[str, AnswerDisplayer]]:
if self.legacy:
return self._legacy_parsed_answer
else:
return self._parse_multi_input_component

@property
def as_txt(self) -> str | dict[str, AnswerDisplayer]:
def as_txt(self) -> str | list[dict[str, AnswerDisplayer]]:
if self.legacy:
return self._legacy_parsed_answer
else:
return self._parse_multi_input_component

@property
def as_pdf(self) -> str | dict[str, AnswerDisplayer]:
def as_pdf(self) -> str | list[dict[str, AnswerDisplayer]]:
if self.legacy:
return self._legacy_parsed_answer
else:
Expand Down

0 comments on commit 666ff4e

Please sign in to comment.