|
@@ -13,7 +13,6 @@ import timeout_decorator
|
|
|
|
|
|
_spreadsheetKey = "12Zv95ZMJ008KXC5ytVnBusjX9wUnpOg0TOLwmxMNOTQ"
|
|
_spreadsheetKey = "12Zv95ZMJ008KXC5ytVnBusjX9wUnpOg0TOLwmxMNOTQ"
|
|
|
|
|
|
-####### GET SHEETS AND NUM PARTICIPANTS #######
|
|
|
|
|
|
|
|
def _getStatsSheet(_key):
|
|
def _getStatsSheet(_key):
|
|
scope = ['https://spreadsheets.google.com/feeds',
|
|
scope = ['https://spreadsheets.google.com/feeds',
|
|
@@ -33,14 +32,22 @@ def _getStatsSheet(_key):
|
|
# count participants
|
|
# count participants
|
|
_numParticipants = _leaderSheet.row_count - 1
|
|
_numParticipants = _leaderSheet.row_count - 1
|
|
|
|
|
|
- return _statsSheet, _numParticipants
|
|
|
|
|
|
+ return _statsSheet, _leaderSheet
|
|
|
|
|
|
|
|
+
|
|
|
|
+def _getNumParticipants(_leaderSheet):
|
|
|
|
|
|
-def _getRowsFromDate(_statsSheet, _numParticipants):
|
|
|
|
|
|
+ _numParticipants = _leaderSheet.row_count - 1
|
|
|
|
+
|
|
|
|
+ return _numParticipants
|
|
|
|
|
|
|
|
+
|
|
|
|
+def _getRowsFromDate(_statsSheet, _numParticipants):
|
|
|
|
+
|
|
# get today
|
|
# get today
|
|
_today = datetime.date.today()
|
|
_today = datetime.date.today()
|
|
- #_today = datetime.date(2018, 5, 2)
|
|
|
|
|
|
+ # else manually set the date
|
|
|
|
+ #_today = datetime.date(2018, 5, 16)
|
|
|
|
|
|
_urlDate = _today.strftime('%m/%d/%Y')
|
|
_urlDate = _today.strftime('%m/%d/%Y')
|
|
|
|
|
|
@@ -88,6 +95,7 @@ def _getPlayerFirstNameLastName(_player):
|
|
_firstName = _firstNamelastName[0]
|
|
_firstName = _firstNamelastName[0]
|
|
_firstName = _firstName.replace('.', '')
|
|
_firstName = _firstName.replace('.', '')
|
|
_lastName = _firstNamelastName[1]
|
|
_lastName = _firstNamelastName[1]
|
|
|
|
+
|
|
return _firstName, _lastName
|
|
return _firstName, _lastName
|
|
|
|
|
|
|
|
|
|
@@ -144,7 +152,8 @@ def _badName(_statsSheet, _playerCell):
|
|
while True:
|
|
while True:
|
|
|
|
|
|
try:
|
|
try:
|
|
- _statsSheet, _numParticipants = _getStatsSheet(_spreadsheetKey)
|
|
|
|
|
|
+ _statsSheet, _leaderSheet = _getStatsSheet(_spreadsheetKey)
|
|
|
|
+ _numParticipants = _getNumParticipants(_leaderSheet)
|
|
_startRow, _lastRow, _urlDate = _getRowsFromDate(_statsSheet, _numParticipants)
|
|
_startRow, _lastRow, _urlDate = _getRowsFromDate(_statsSheet, _numParticipants)
|
|
if _startRow == 0:
|
|
if _startRow == 0:
|
|
print("No games today! Pausing for 1000s")
|
|
print("No games today! Pausing for 1000s")
|