X-Git-Url: https://git.cworth.org/git?p=turbot;a=blobdiff_plain;f=turbot%2Fsheets.py;h=df2e4e9b10828068048f752b1b57bf3ed9912c63;hp=37bd363ac8a85270d90df6d16b4415b47dd72bf2;hb=4271515e50671c4fdc9b4cc4b437c7c0a4937aa3;hpb=44e11ccfc17eae11753a029673ff1bd198f853ad diff --git a/turbot/sheets.py b/turbot/sheets.py index 37bd363..df2e4e9 100644 --- a/turbot/sheets.py +++ b/turbot/sheets.py @@ -66,9 +66,12 @@ def sheets_create_for_puzzle(turb, puzzle): body={ "destinationSpreadsheetId": spreadsheet_id }).execute() - # Rename each copied sheet to match original name - rename_sheet(turb, spreadsheet_id, res['sheetId'], - sheet["properties"]["title"]) + # Rename each copied sheet to match the name from the template + sheet_name = sheet["properties"]["title"] + # Except for "Text" which we rename to the puzzle name + if sheet_name == "Text": + sheet_name = puzzle['name'] + rename_sheet(turb, spreadsheet_id, res['sheetId'], sheet_name) # Next, delete the blank sheet that's was created before the template sheet_id = spreadsheet['sheets'][0]['properties']['sheetId']