Skip to content

Commit d85290f

Browse files
committed
fix pr feedback
1 parent 291ba9a commit d85290f

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

events/next18/README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,32 @@ commandline tool that:
1313
## Getting started
1414

1515
* Follow the [Sheets API python quickstart](https://developers.google.com/sheets/api/quickstart/python)
16-
* Make sure to save the `client-secrets.json` file in your working directory
16+
* Make sure to save the `credentials.json` file in your working directory
1717
* Enable the Google Slides API, Google Drive API and Google Sheets API in your
1818
developer project
1919
* Run the tool with no arguments to complete the OAuth consent flow:
2020

21-
<pre>
22-
$ python qbr_tool.py
23-
</pre>
21+
```bash
22+
$ python qbr_tool.py
23+
```
2424

2525
* Run the tool:
2626

27-
<pre>
28-
// Create the spreadsheet from the Google Slides template.
29-
// For example, 13My9SxkotWssCc2F5yaXp2fzGrzoYV6maytr3qAT9GQ
30-
$ python qbr_tool.py create_sheet --template_id &lt;your template id&gt;
31-
32-
// Add data from the stub customer service
33-
$ python qbr_tool.py add_customers \
34-
--spreadsheet_id &lt;your spreadsheet id&gt; \
35-
--customer_id jupiter
36-
37-
// Generate the filled in presentation
38-
$ python qbr_tool.py create_presentations
39-
--spreadsheet_id &lt;your spreadsheet id&gt; \
40-
--customer_id jupiter
41-
</pre>
27+
```bash
28+
# Create the spreadsheet from the Google Slides template.
29+
# For example, 13My9SxkotWssCc2F5yaXp2fzGrzoYV6maytr3qAT9GQ
30+
$ python qbr_tool.py create_sheet --template_id <your template id>;
31+
Spreadsheet URL: https://docs.google.com/spreadsheets/d/<spreadsheet id>
32+
33+
# Add data from the stub customer service
34+
$ python qbr_tool.py add_customers \
35+
--spreadsheet_id <spreadsheet id> \
36+
--customer_id jupiter
37+
38+
# Generate the filled in presentation
39+
$ python qbr_tool.py create_presentations
40+
--spreadsheet_id <spreadsheet id> \
41+
--customer_id jupiter
42+
jupiter: https://docs.google.com/presentations/d/<filled in presentation id>
43+
```
44+

events/next18/customer_spreadsheet_reader.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ def ReadColumnData(self, column_id):
3838
def ExecuteRead(self):
3939
filters = list(self._data_filters.values())
4040
get_body = {'dataFilters': filters}
41-
read_fields = ('sheets.properties.sheetId,sheets.data.rowData.' +
42-
'values.formattedValue,developerMetadata.metadataValue')
41+
read_fields = ','.join([
42+
'sheets.properties.sheetId',
43+
'sheets.data.rowData.values.formattedValue',
44+
'developerMetadata.metadataValue'])
4345
spreadsheet = self._sheets_service.spreadsheets().getByDataFilter(
4446
spreadsheetId=self._spreadsheet_id, body=get_body,
4547
fields=read_fields).execute()
@@ -66,9 +68,7 @@ def GetTemplateId(self):
6668
def GetColumnData(self, column_id):
6769
index = list(self._data_filters.keys()).index(column_id)
6870
data = self._spreadsheet.get('sheets')[0].get('data')[index]
69-
values = []
70-
for row in data.get('rowData'):
71-
value = row.get('values')[0].get('formattedValue')
72-
values.append(value)
71+
values = [row.get('values')[0].get('formattedValue')
72+
for row in data.get('rowData')]
7373
# Remove the first value which is just the label
7474
return values[1:]

events/next18/spreadsheet_writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def InsertColumn(self, sheet_id, column_index):
6262
'endIndex': column_index + 1,
6363
},
6464
}
65-
}
66-
self._requests.append(request)
65+
}
66+
self._requests.append(request)
6767

6868
def PopulateColumn(self, sheet_id, column_index, column_id, values):
6969
# Include the column ID in the column values

0 commit comments

Comments
 (0)