forked from toddrob99/redball
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
10k post limit #17
Draft
jspayne
wants to merge
7
commits into
lemmy
Choose a base branch
from
10k_post_limit
base: lemmy
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
10k post limit #17
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7655b49
Add options to disable the scoring play and highlight tables.
jspayne 484cf15
Put linescore back in the post game thread
jspayne 219e22d
Put linescore back in the post game thread
jspayne 6624a71
* Move Highlight thread submit to before the game thread.
jspayne 7c418a2
* Run black layout on __init__.py
jspayne 99c8d7b
Merge remote-tracking branch 'origin/lemmy' into 10k_post_limit
jspayne ab16385
* Unsticky Highlight thread
jspayne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
16 changes: 16 additions & 0 deletions
16
bots/lemmy_mlb_game_threads/templates/highlight_thread.mako
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,16 @@ | ||
<% | ||
from datetime import datetime | ||
import pytz | ||
%>\ | ||
## Header: Team names with links to team subs and matchup image, followed by game date | ||
${'# '}<%include file="matchup.mako" args="dateFormat='%a, %b %d'" /> | ||
|
||
## If game status is final, or live and not warmup, include boxscore, scoring plays, highlights, and linescore | ||
% if (data[gamePk]['schedule']['status']['abstractGameCode'] == 'L' and data[gamePk]['schedule']['status']['statusCode'] != 'PW') or data[gamePk]['schedule']['status']['abstractGameCode'] == 'F': | ||
<%include file="scoring_plays.mako" /> | ||
|
||
<%include file="highlights.mako" /> | ||
% endif | ||
|
||
## configurable footer text | ||
${settings.get('Highlight Thread',{}).get('FOOTER','')} |
25 changes: 25 additions & 0 deletions
25
bots/lemmy_mlb_game_threads/templates/highlight_title.mako
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,25 @@ | ||
<% | ||
from datetime import datetime | ||
prefix = settings.get("Highlight Thread", {}).get("TITLE_PREFIX","Highlight Thread:") | ||
dateFormat = settings.get("Highlight Thread", {}).get("DATE_FORMAT","%a, %b %d @ %I:%M %p %Z") | ||
dhDateFormat = settings.get("Highlight Thread", {}).get("DATE_FORMAT_DH","%a, %b %d") | ||
%>\ | ||
${prefix + (" " if len(prefix) and not prefix.endswith(" ") else "")}\ | ||
%if data[gamePk]['schedule'].get('seriesDescription') and data[gamePk]['schedule'].get('gameType') not in ['R','I','S','E']: | ||
${data[gamePk]['schedule']['seriesDescription'] + ' '}\ | ||
${'Game ' + str(data[gamePk]['schedule']['seriesGameNumber']) + ' - ' if data[gamePk]['schedule'].get('seriesGameNumber') and data[gamePk]['schedule'].get('gamesInSeries',1) > 1 else '- '}\ | ||
%endif | ||
%if data[0]["myTeam"].get("allStarStatus"): | ||
${data[gamePk]['schedule']['teams']['away']['team']['teamName']} @ ${data[gamePk]['schedule']['teams']['home']['team']['teamName']}\ | ||
%else: | ||
${data[gamePk]['schedule']['teams']['away']['team']['teamName']} (${data[gamePk]['schedule']['teams']['away']['leagueRecord']['wins']}-${data[gamePk]['schedule']['teams']['away']['leagueRecord']['losses']})\ | ||
@ ${data[gamePk]['schedule']['teams']['home']['team']['teamName']} (${data[gamePk]['schedule']['teams']['home']['leagueRecord']['wins']}-${data[gamePk]['schedule']['teams']['home']['leagueRecord']['losses']})\ | ||
%endif | ||
%if data[gamePk]['schedule']['doubleHeader'] == 'Y' and data[gamePk]['schedule']['gameNumber'] == 2: | ||
- ${data[gamePk]['gameTime']['myTeam'].strftime(dhDateFormat)} - Doubleheader Game 2 | ||
%else: | ||
- ${data[gamePk]['gameTime']['myTeam'].strftime(dateFormat)} | ||
%endif | ||
%if data[gamePk]['schedule']['doubleHeader'] == 'S': | ||
- Doubleheader Game ${data[gamePk]['schedule']['gameNumber']} | ||
%endif |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good but what do you think about splitting the highlight thread code into it's own function or file + function? Use it as sort of a template for future refactoring?