Event key passed as CLI argument and use live project

This commit is contained in:
Christian Colglazier 2020-02-14 15:49:38 -05:00
parent 4968769ba7
commit 2a6adc46d1
2 changed files with 13 additions and 2 deletions

View File

@ -9,3 +9,13 @@ Run the following command to install
```sh
cd ~ && git clone git@github.com:AquaMorph/dotfiles.git && sh ~/dotfiles/scripts/install.sh
```
## Scripts
### frc-photo-checklist.py
Python script to generate a Todoist checklist for taking photos at an FRC event.
```sh
python frc-photo-checklist.py [Event Key]
```

View File

@ -7,6 +7,7 @@ import datetime as dt
import re
import operator
import os
import sys
import tbapy
import todoist
@ -105,12 +106,12 @@ todoistToken = configParser.get('Settings', 'TodoistToken')
# Setup Todoist
api = todoist.TodoistAPI(todoistToken)
api.sync()
projectID = getProjectID(api, 'Test01')
projectID = getProjectID(api, '🤖 Robotics')
items = api.state['items']
# Setup the Blue Alliance
tba = tbapy.TBA(tbaKey)
eventKey = '2020ncpem'
eventKey = sys.argv[1]
event = tba.event(eventKey)
setupDay = event['start_date']
day1 = (dt.datetime.strptime(setupDay, '%Y-%m-%d') + dt.timedelta(days=1)).strftime('%Y-%m-%d')