diff --git a/.github/workflows/main_runner.yml b/.github/workflows/main_runner.yml new file mode 100644 index 0000000..ac6bcb6 --- /dev/null +++ b/.github/workflows/main_runner.yml @@ -0,0 +1,62 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install Dependancies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: python3-pip python3-pyaudio ffmpeg curl git + version: 1.0 + - name: Install Python Requirements + run: | + if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi + python3 -m pip install flake8 + - name: Install SAMEDEC Decoder + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y --profile default + git clone https://github.com/cbs228/sameold.git + cd sameold + cargo install --path crates/samedec + source $HOME/.cargo/env + cd .. + rm -rf sameold + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + python3 -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + python3 -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + # TODO: Wrtie Pytest files + # - name: Test with pytest + # run: | + # pytest + - name: Check ASMARA Version + run: python3 asmara.py -V + # TODO: Make a new config exit after startup due to no inputs/outputs + # - name: Run ASMARA + # run: python3 asmara.py -d + - name: 'Cleanup build folder' + run: | + ls -la ./ + rm -rf ./* || true + rm -rf ./.??* || true + ls -la ./ diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..c6cc0f7 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @A-c0rN diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..75bf367 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# Contributing Guidelines + +Thank you for considering contributing to our project! We appreciate your efforts to improve our codebase. Please follow these guidelines to ensure smooth collaboration and efficient handling of pull requests. + +## Pull Request Process + +1. **Fork the Repository**: If you haven't already, fork the repository to your GitHub account. + +2. **Create a Branch**: Create a new branch for your feature or bug fix. Use a descriptive name that reflects the purpose of your changes. + +3. **Make Changes**: Make your changes to the codebase. Ensure that your modifications adhere to the project's coding standards and guidelines. + +4. **Test Your Changes**: Before submitting a pull request, test your changes locally to ensure they function as expected. If applicable, write tests to cover your code changes. + +5. **Commit Your Changes**: Commit your changes with clear and concise commit messages. Include details about what you have changed and why, Include in-depth documentation on changes both in the commits and in the pull requests, including any relevant context or reasoning. + + ```bash + git add . + git commit -m "Descriptive commit message" + ``` +6. **Push Your Changes**: Once you are satisfied with your changes, push your branch to your forked repository. + ```bash + git push origin + ``` +7. **Submit a Pull Request**: Go to the original repository (upstream) and create a pull request from your forked branch. Include in-depth documentation on changes both in the commits and in the pull requests, including any relevant context or reasoning. +8. **Review Process**: After submitting your pull request, a project maintainer will review your changes. Be responsive to any feedback or requests for revisions. +9. **Address Feedback**: If requested changes are needed, make the necessary updates to your branch and push the changes. Your pull request will be re-evaluated after the updates. +10. Merge: Once your pull request is approved and all checks pass, it will be merged into the main branch, Congratulations on your contribution! diff --git a/asmara.py b/asmara.py index 7390981..f5d8f8b 100644 --- a/asmara.py +++ b/asmara.py @@ -243,21 +243,13 @@ def __decoder__(self): sev=severity.trace, ) try: - if ( - "samedec 0.2." + if not ( + "samedec 0.1." in Popen(["samedec", "-V"], stdout=PIPE) .communicate()[0] .decode("UTF-8") .strip() ): - self.__decode__ = Popen( - ["samedec", "-r", "24000"], - stdout=PIPE, - stdin=PIPE, - stderr=PIPE, - bufsize=1, - ) - else: utilities.autoPrint( text=f"SAMEDEC is not version 0.2 or higher! Recommended version is 0.2.3.", classType="DECODER", @@ -265,6 +257,14 @@ def __decoder__(self): ) AS_MAN.killAsmara() exit(1) + else: + self.__decode__ = Popen( + ["samedec", "-r", "24000"], + stdout=PIPE, + stdin=PIPE, + stderr=PIPE, + bufsize=1, + ) except FileNotFoundError: utilities.autoPrint( text=f"Samedec is not installed on the computer. Please install SAMEDEC 0.2.3 or higher.",