From 14f4bb0f9dfe9738beed8523d58013bf7611ce2e Mon Sep 17 00:00:00 2001 From: Augustin Cisterne-Kaas Date: Tue, 17 Oct 2023 14:35:16 +0800 Subject: [PATCH] fix: listen to audio display + ci (#62) --- .github/workflows/ci.yml | 15 --------------- .github/workflows/pypi.yml | 23 +++++++++++++++++++++++ hebikani/hebikani.py | 4 ++-- 3 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5bac2d..704c015 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,18 +73,3 @@ jobs: uses: python-semantic-release/python-semantic-release@master with: github_token: ${{ secrets.GITHUB_TOKEN }} - pypi: - needs: Release - if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):') - concurrency: release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - run: python3 -m pip install --upgrade build && python3 -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..68554b0 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,23 @@ +name: Build PyPi + +# Only trigger, when the build workflow succeeded +on: + workflow_run: + workflows: ["CI"] + types: + - completed + +jobs: + pypi: + concurrency: release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: python3 -m pip install --upgrade build && python3 -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/hebikani/hebikani.py b/hebikani/hebikani.py index 3fefd2d..a644c67 100755 --- a/hebikani/hebikani.py +++ b/hebikani/hebikani.py @@ -1303,7 +1303,7 @@ def process_answer(self, question: Question, answer_type: AnswerType): elif answer_type == AnswerType.INEXACT: print( "\nTry again. We are looking for the", - f"{question.primary.type}.", + f"{question.primary.type}.\n", ) # If the user answers incorrectly, we show the correct answer else: @@ -1414,7 +1414,7 @@ def ask_audio(self, question: Question): and question.question_type == QuestionType.READING and ( self.client.options.autoplay - or input("Would you like to hear the audio? [y/N] ") in ["y", "Y"] + or input("\nWould you like to hear the audio? [y/N] ") in ["y", "Y"] ) ): audio = self.select_audio(question.subject.audios)