Skip to content

Commit

Permalink
Merge branch 'dev' into use-teams.py-names
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian authored Nov 5, 2024
2 parents 4d91b86 + 66ce2a8 commit a18e58f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 41 deletions.
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,26 +135,29 @@ It will also install the following python libraries that are required for certai
* [MLB-StatsAPI](https://pypi.org/project/MLB-StatsAPI/): The main library that fetches and parses all of the actual MLB data being displayed
* [RGBMatrixEmulator](https://github.com/ty-porter/RGBMatrixEmulator): The emulation library for the matrix display. Useful for running on MacOS or Linux, or for development.

#### Installation on Non-Raspberry Pi Hardware
#### Customizing the Installation

The installation script is designed for physical hardware. When attempting to install it on other platforms, you should not use `sudo` to install the dependencies. In addition, you can pass the `--emulator-only` argument to skip installation steps that aren't required.
Additional flags are available for customizing your install:

```
sh install.sh --emulator-only
```
-a, --skip-all Skip all dependencies and config installation (equivalent to -c -p -m).
-c, --skip-config Skip updating JSON configuration files.
-m, --skip-matrix Skip building matrix driver dependency. Video display will default to emulator mode.
-p, --skip-python Skip Python 3 installation. Requires manual Python 3 setup if not already installed.
Additional flags are available for customizing your install:
-v, --no-venv Do not create a virtual environment for the dependencies.
-e, --emulator-only Do not install dependencies under sudo. Skips building matrix dependencies (equivalent to -m)
-d, --driver Specify a branch name or commit SHA for the rpi-rgb-led-matrix library. (Optional. Defaults may change.)
-h, --help Display this help message
```
-p, --skip-python Skips Python 3 installation. You will need to install it via your platform's appropriate package manager.
-m, --skip-matrix Skips RPI-specific matrix driver installation and build.
-c, --skip-config Skips default config overwrite without prompting.

-a, --skip-all Performs all above skips.
--no-venv Do not create a virtual environment for the dependencies.
--emulator-only Do not install dependencies under sudo. Skips building matrix dependencies.
#### Installation on Non-Raspberry Pi Hardware

The installation script is designed for physical hardware. When attempting to install it on other platforms, you should not use `sudo` to install the dependencies. In addition, you can pass the `--emulator-only` argument to skip installation steps that aren't required.

-h, --help Displays help
```
sh install.sh --emulator-only
```

#### Updating
Expand Down
5 changes: 1 addition & 4 deletions data/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ def is_offday_for_preferred_team(self):
return True

def is_offday(self):
if self.config.standings_no_games:
return not len(self.__all_games) # care about all MLB
else: # only care if we can't rotate a game
return not len(self._games)
return not len(self.__all_games) # care about all MLB

def games_live(self):
return any(status.is_fresh(g["status"]) or (status.is_live(g["status"])) for g in self._games)
Expand Down
2 changes: 1 addition & 1 deletion data/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Can be customized, but will require changing in colors/teams.json as well
TEAM_ID_ABBR = {
133: "OAK",
133: "ATH",
134: "PIT",
135: "SD",
136: "SEA",
Expand Down
55 changes: 32 additions & 23 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,58 +1,65 @@
#!/bin/bash

SKIP_PYTHON=false
SKIP_CONFIG=false
SKIP_MATRIX=false
NO_SUDO=false
SKIP_VENV=false
DRIVER_SHA=14ab2ff

usage() {
cat <<USAGE
Usage: $0 [-a] [-c] [-m] [-p]
Usage: $0 [-acmpve] [-d / --driver string]
Options:
-c, --skip-config: Skip updating JSON configuration files.
-m, --skip-matrix: Skip building matrix driver dependency. Video display will default to emulator mode.
-p, --skip-python: Skip Python 3 installation. Requires manual Python 3 setup if not already installed.
-a, --skip-all Skip all dependencies and config installation (equivalent to -c -p -m).
-c, --skip-config Skip updating JSON configuration files.
-m, --skip-matrix Skip building matrix driver dependency. Video display will default to emulator mode.
-p, --skip-python Skip Python 3 installation. Requires manual Python 3 setup if not already installed.
-a, --skip-all: Skip all dependencies and config installation (equivalent to -c -p -m).
--no-venv Do not create a virtual environment for the dependencies.
--emulator-only: Do not install dependencies under sudo. Skips building matrix dependencies (equivalent to -m)
-v, --no-venv Do not create a virtual environment for the dependencies.
-e, --emulator-only Do not install dependencies under sudo. Skips building matrix dependencies (equivalent to -m)
-d, --driver Specify a branch name or commit SHA for the rpi-rgb-led-matrix library. (Defaults to "$DRIVER_SHA")
-h, --help Display this help message
USAGE
exit 1
}

SKIP_PYTHON=false
SKIP_CONFIG=false
SKIP_MATRIX=false
NO_SUDO=false
SKIP_VENV=false

for arg in "$@"; do
case $arg in
while [ $# -gt 0 ]; do
case "$1" in
-p | --skip-python)
SKIP_PYTHON=true
shift # Remove -p / --skip-python from `$@`
shift
;;
-c | --skip-config)
SKIP_CONFIG=true
shift # Remove -c / --skip-config from `$@`
shift
;;
-m | --skip-matrix)
SKIP_MATRIX=true
shift # Remove -m / --skip-matrix from `$@`
shift
;;
-a | --skip-all)
SKIP_CONFIG=true
SKIP_MATRIX=true
SKIP_PYTHON=true
SKIP_VENV=true
shift # Remove -a / --skip-all from `$@`
shift
;;
--emulator-only)
-e | --emulator-only)
SKIP_MATRIX=true
NO_SUDO=true
shift # remove --emulator-only from `$@`
shift
;;
--no-venv)
-v | --no-venv)
SKIP_VENV=true
shift # remove --no-venv from `$@`
shift
;;
-d | --driver)
DRIVER="$2"
shift 2
;;
-h | --help)
usage # run usage function on help
Expand Down Expand Up @@ -134,6 +141,8 @@ if [ "$SKIP_MATRIX" = false ]; then
cd submodules
git clone https://github.com/hzeller/rpi-rgb-led-matrix.git matrix
cd matrix
# Checkout the branch or commit specified for rpi-rgb-led-matrix
git checkout $DRIVER_SHA
git pull
make build-python PYTHON="$PYTHON"
sudo make install-python PYTHON="$PYTHON"
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SCRIPT_NAME = "MLB LED Scoreboard"
SCRIPT_VERSION = "8.0.2"
SCRIPT_VERSION = "8.1.0"


if __name__ == "__main__":
Expand Down

0 comments on commit a18e58f

Please sign in to comment.