-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from UniversityRadioYork/dev
This is BAPS3 (3.0.0 Release)
- Loading branch information
Showing
101 changed files
with
4,441 additions
and
73,394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,83 @@ | ||
name: Python package | ||
|
||
name: Package | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
build-macos: | ||
|
||
runs-on: ubuntu-latest | ||
runs-on: macos-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.7, 3.8] | ||
python-version: [3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
- name: Build .app | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Install bapsicle as module | ||
run: | | ||
pip install -e . | ||
- name: Lint with flake8 | ||
npm run presenter-make | ||
build/build-macos.sh | ||
zip -r build/output/BAPSicle.zip build/output/BAPSicle.app | ||
- name: Archive Build | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Package - MacOS | ||
path: | | ||
build/output/BAPSicle.zip | ||
build-ubuntu: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Build executable | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with unittest | ||
npm run presenter-make | ||
build/build-linux.sh | ||
- name: Archive Build | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Package - Ubuntu | ||
path: | | ||
build/output/BAPSicle | ||
build-windows: | ||
|
||
runs-on: windows-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Build .exe | ||
run: | | ||
python -m unittest | ||
npm run presenter-make | ||
build/build-windows.bat no-venv | ||
- name: Archive Build | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Package - Windows | ||
path: | | ||
build/output/BAPSicle.exe | ||
install/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Python test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test-macos: | ||
|
||
runs-on: macos-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
pip install -r build/requirements.txt | ||
pip install -r build/requirements-macos.txt | ||
- name: Install bapsicle as module | ||
run: | | ||
pip install -e . | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --ignore=E402,E226,E24,W50,W690 --max-complexity=20 --max-line-length=127 --statistics | ||
- name: Test with unittest | ||
if: ${{ always() }} | ||
timeout-minutes: 10 | ||
run: | | ||
python -m sounddevice | ||
python -m unittest | ||
- name: Archive test logs | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Logs - Python ${{ matrix.python-version }} | ||
path: | | ||
logs/* | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
|
||
|
||
.vscode/settings.json | ||
|
||
__pycache__/ | ||
|
||
state/ | ||
|
||
*.egg-info/ | ||
*.pyo | ||
venv/ | ||
|
||
build/build-exe-config.json | ||
build/build-exe-pyinstaller-command.bat | ||
build/build-exe-pyinstaller-command.sh | ||
build/BAPSicle.platypus | ||
build/build/BAPSicle/ | ||
build/output/ | ||
*.spec | ||
|
||
install/*.exe | ||
install/nssm | ||
|
||
*.pyo | ||
|
||
*.spec | ||
build.py | ||
|
||
build/build-exe-pyinstaller-command.bat | ||
dev/welcome.mp3 | ||
|
||
build/build/BAPSicle/ | ||
music-tmp/ | ||
|
||
build/output/ | ||
|
||
build/build-exe-pyinstaller-command.sh | ||
presenter-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "presenter"] | ||
path = presenter | ||
url = https://github.com/michael-grace/WebStudio.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# see | ||
import logging | ||
|
||
logging.getLogger(__name__).addHandler(logging.NullHandler()) | ||
logging.basicConfig(filename='bapsicle_log.log', level=logging.INFO) | ||
logging.info('Started Logging') | ||
logging.basicConfig(filename="bapsicle_log.log", level=logging.INFO) | ||
logging.info("Started Logging") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import json | ||
from typing import Dict, Literal, Optional, Union | ||
|
||
POSITIONS = ["start", "mid", "end"] | ||
PARAMS = ["name", "time", "position", "section"] | ||
|
||
|
||
class Marker: | ||
marker: Dict | ||
|
||
def __init__(self, new_marker: Union[str, dict]): | ||
marker: dict | ||
try: | ||
if isinstance(new_marker, str): | ||
marker = json.loads(new_marker) | ||
else: | ||
marker = new_marker | ||
except Exception as e: | ||
raise ValueError("Failed to decode JSON for marker: {}".format(e)) | ||
|
||
for key in marker.keys(): | ||
if key not in PARAMS: | ||
raise ValueError("Key {} is not a valid marker parameter.".format(key)) | ||
|
||
if not isinstance(marker["name"], str): | ||
raise ValueError("Name is not str.") | ||
|
||
if not (isinstance(marker["time"], int) or isinstance(marker["time"], float)): | ||
raise ValueError("Time is not a float or int") | ||
|
||
if marker["position"] not in POSITIONS: | ||
raise ValueError("Position is not in allowed values.") | ||
|
||
if not (marker["section"] is None or isinstance(marker["section"], str)): | ||
raise ValueError("Section name is not str or None.") | ||
|
||
marker["time"] = float(marker["time"]) | ||
# If everything checks out, let's save it. | ||
self.marker = marker | ||
|
||
@property | ||
def __str__(self) -> str: | ||
return json.dumps(self.marker) | ||
|
||
@property | ||
def __dict__(self) -> dict: | ||
return self.marker | ||
|
||
@property | ||
def name(self) -> str: | ||
return self.marker["name"] | ||
|
||
@property | ||
def time(self) -> float: | ||
return float(self.marker["time"]) | ||
|
||
@property | ||
def position(self) -> str: | ||
return self.marker["position"] | ||
|
||
@property | ||
def section(self) -> Optional[str]: | ||
return self.marker["section"] | ||
|
||
def same_type(self, o: object) -> bool: | ||
if not isinstance(o, Marker): | ||
return False | ||
return o.position == self.position and o.section == self.section |
Oops, something went wrong.