Skip to content

Commit

Permalink
Removed explicit choice of font. Added Skout.spec for pyinstaller.
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverKlemenschits committed Nov 29, 2021
1 parent a0ce611 commit 68e35a4
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tagged_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
pip install -r requirements.txt
- name: Build with pyinstaller
run: |
pyinstaller --onefile Skout.py
pyinstaller --onefile Skout.spec
- name: Compress
shell: bash
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
__pycache__
*.pdf
!TeamA_v_TeamB-01_01_2021.pdf
Skout.spec
build*
dist*
Data
Expand Down
40 changes: 40 additions & 0 deletions Skout.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(['Skout.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='Skout',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )
62 changes: 13 additions & 49 deletions SkoutPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def makeRouteArrow(self, origin, nodes, arrowLength=15):

def drawPlay(self, x0, y0, x1, y1, index):
# draw play Number
self.d.setFont(self.boldFont, 30)
# self.d.setFont(self.boldFont, 30)
self.d.setStrokeColor('black')
self.d.setFillColor('black')
self.d.drawString(x0, y1, '#' + str(index + 1))
Expand Down Expand Up @@ -171,43 +171,6 @@ def drawPlay(self, x0, y0, x1, y1, index):
LOSPositions[i][1] + y * yard2Pixels] for [x, y] in routePoints]

self.makeRouteArrow(LOSPositions[i], routePoints, 15)
# p = self.d.beginPath()
# p.moveTo(*LOSPositions[i])

# for j in range(len(routePoints)):
# xCoord = LOSPositions[i][0] + routePoints[j][0] * yard2Pixels
# yCoord = LOSPositions[i][1] + routePoints[j][1] * yard2Pixels
# if(i == 0 or i == 1): # invert x for A and C Receiver
# xCoord = LOSPositions[i][0] - routePoints[j][0] * yard2Pixels
# p.lineTo(xCoord, yCoord)

# self.d.drawPath(p)

# # draw shape at the end
# j = len(routePoints)-1
# xCoord = LOSPositions[i][0] + routePoints[j][0] * yard2Pixels
# yCoord = LOSPositions[i][1] + routePoints[j][1] * yard2Pixels
# if(i == 0 or i == 1): # invert x for A and C Receiver
# xCoord = LOSPositions[i][0] - routePoints[j][0] * yard2Pixels
# p.circle(xCoord, yCoord, 15)

# arrow = copy.deepcopy(self.arrowHead)
# arrow.append(draw.Lines(-0.1, -0.5, -0.1, 0.5, 0.9, 0, fill=routeColors[i], close=True))
# # make path with arrowHead at the end
# p = draw.Path(stroke=routeColors[i], stroke_width=routeStrokeWidth, fill='none',
# marker_end=arrow)
# # move to start position of player
# p.M(*LOSPositions[i])
# # lines according to route
# for j in range(len(routePoints)):
# xCoord = LOSPositions[i][0] + routePoints[j][0] * yard2Pixels
# yCoord = LOSPositions[i][1] + routePoints[j][1] * yard2Pixels
# if(i == 0 or i == 1): # invert x for A and C Receiver
# xCoord = LOSPositions[i][0] - routePoints[j][0] * yard2Pixels
# # move path by making line
# p.L(xCoord, yCoord)
# # add path
# self.d.append(p)

# draw the player
self.d.setStrokeColor('black')
Expand Down Expand Up @@ -243,37 +206,38 @@ def drawTile(self, x0, y0, x1, y1, index):
statsBegin = (x0 + statsBorder, y1 - drawArea[1] - statsBorder)
statsTextSize = 30
statsTop = statsBegin[1] - statsTextSize / 1.5
self.d.setFontSize(statsTextSize)

# down counters
downCountX = statsBegin[0] + 80
downCountersText = ("1st:", "2nd:", "3rd:", "4th:", "PAT:")

for i in range(len(downCountersText)):
self.d.setFont(self.boldFont, statsTextSize)
# self.d.setFont(self.boldFont, statsTextSize)
self.d.drawString(statsBegin[0], statsTop - i * statsTextSize, downCountersText[i])
if (index < numberOfPlays):
self.d.setFont(self.font, statsTextSize)
# self.d.setFont(self.font, statsTextSize)
self.d.drawString(downCountX, statsTop - i * statsTextSize, str(self.stats.downStats[index][i]))

# 2nd stats column: total and strong sides
column2X = downCountX + 80
column2ValueX = column2X + 160
#total
self.d.setFont(self.boldFont, statsTextSize)
# self.d.setFont(self.boldFont, statsTextSize)
self.d.drawString(column2X, statsTop, "Total:")
if (index < numberOfPlays):
self.d.setFont(self.font, statsTextSize)
# self.d.setFont(self.font, statsTextSize)
self.d.drawString(column2ValueX, statsTop, str(self.stats.occurences[index]))

# strongsides and clipnumbers
self.d.setFont(self.boldFont, statsTextSize)
# self.d.setFont(self.boldFont, statsTextSize)
self.d.drawString(column2X, statsTop - statsTextSize, "SS left:")
self.d.drawString(column2X, statsTop - 2 * statsTextSize, "SS right:")

self.d.drawString(column2X, statsTop - 4 * statsTextSize, "vid#:")

if (index < numberOfPlays):
self.d.setFont(self.font, statsTextSize)
# self.d.setFont(self.font, statsTextSize)
self.d.drawString(column2ValueX, statsTop - statsTextSize, str(self.stats.strongSides[index][0]))
self.d.drawString(column2ValueX, statsTop - 2 * statsTextSize, str(self.stats.strongSides[index][1]))
self.d.drawString(column2X + 3 * statsTextSize, statsTop - 4 * statsTextSize, self.listAsComma(self.stats.clipNumbers[index]))
Expand All @@ -282,22 +246,22 @@ def drawTile(self, x0, y0, x1, y1, index):
column3X = column2ValueX + 50
column3ValueX = column3X + 70
# distance
self.d.setFont(self.boldFont, statsTextSize)
# self.d.setFont(self.boldFont, statsTextSize)
self.d.drawString(column3X, statsTop, "Dist:")
self.d.drawString(column3X, statsTop - statsTextSize, "Yds:")
self.d.drawString(column3X, statsTop - 2 * statsTextSize, "Rec:")
if (index < numberOfPlays):
self.d.setFont(self.font, statsTextSize)
# self.d.setFont(self.font, statsTextSize)
self.d.drawString(column3ValueX, statsTop, self.listAsComma(self.stats.distances[index]))
self.d.drawString(column3ValueX, statsTop - statsTextSize, self.listAsComma(self.stats.progressions[index]))
self.d.drawString(column3ValueX, statsTop - 2 * statsTextSize, self.listAsComma(self.stats.intRecs[index]))

# formations
formationsY = statsBegin[1] + 2*statsBorder
self.d.setFont(self.boldFont, statsTextSize)
# self.d.setFont(self.boldFont, statsTextSize)
self.d.drawString(statsBegin[0], formationsY, "Form.:")
if (index < numberOfPlays):
self.d.setFont(self.font, statsTextSize)
# self.d.setFont(self.font, statsTextSize)
self.d.drawString(statsBegin[0] + 3.5 * statsTextSize, formationsY, self.listAsComma(self.stats.formations[index]))

# draw the play itself
Expand All @@ -321,7 +285,7 @@ def drawTile(self, x0, y0, x1, y1, index):

halfFontSize = self.getTextBounds('5', statsTextSize)[1] / 2.
distanceMarkerPadding = 1.5 * statsTextSize
self.d.setFont(self.font, statsTextSize)
# self.d.setFont(self.font, statsTextSize)
self.d.setFillColor('gray')
self.d.drawRightString(topCorner[0] + distanceMarkerPadding, lowCorner[1] + fiveYards - halfFontSize, '5')
self.d.drawRightString(topCorner[0] + distanceMarkerPadding, lowCorner[1] + tenYards - halfFontSize, '10')
Expand Down
Binary file modified TeamA_v_TeamB-01_01_2021.pdf
Binary file not shown.

0 comments on commit 68e35a4

Please sign in to comment.