Skip to content

Commit

Permalink
Merge pull request #206 from MLB-LED-Scoreboard/dev
Browse files Browse the repository at this point in the history
Release 2.2.0
  • Loading branch information
ajbowler authored Dec 4, 2018
2 parents 7be00fb + 2462cfe commit 49f4ad8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ A default `config.json.example` file is included for reference. Copy this file t
"full_team_names" Bool If true and on a 64-wide board, displays the full team name on the scoreboard instead of their abbreviation. This config option is ignored on 32-wide boards. Defaults to true when on a 64-wide board.
"scrolling_speed" Integer Supports an integer between 0 and 4. Sets how fast the scrolling text scrolls.
"debug" Bool Game and other debug data is written to your console.
"demo_date" String A date in the format YYYY-MM-DD from which to pull data to demonstrate the scoreboard. A value of `false` will disable demo mode.
```

### Flags
Expand Down
3 changes: 2 additions & 1 deletion config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"end_of_day": "00:00",
"full_team_names": true,
"scrolling_speed": 2,
"debug": false
"debug": false,
"demo_date": false
}
5 changes: 4 additions & 1 deletion data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def __init__(self, config):
# Date

def __parse_today(self):
today = datetime.today()
if self.config.demo_date:
today = datetime.strptime(self.config.demo_date, '%Y-%m-%d')
else:
today = datetime.today()
end_of_day = datetime.strptime(self.config.end_of_day, "%H:%M").replace(year=today.year, month=today.month, day=today.day)
if end_of_day > datetime.now():
today -= timedelta(days=1)
Expand Down
1 change: 1 addition & 0 deletions data/scoreboard_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self, filename_base, width, height):
self.end_of_day = json["end_of_day"]
self.full_team_names = json["full_team_names"]
self.debug = json["debug"]
self.demo_date = json["demo_date"]

# Make sure the scrolling speed setting is in range so we don't crash
try:
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import debug

SCRIPT_NAME = "MLB LED Scoreboard"
SCRIPT_VERSION = "2.1.0"
SCRIPT_VERSION = "2.2.0"

# Get supplied command line arguments
args = args()
Expand Down

0 comments on commit 49f4ad8

Please sign in to comment.