X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=turbot%2Fsheets.py;h=76515ca09547c660a94466fd6d223259211b7f44;hb=HEAD;hp=c042b4daf28e1358ac161142c16bf6b3472bc196;hpb=375bba612d7f18369301f2e75529c07a9cc81bf8;p=turbot diff --git a/turbot/sheets.py b/turbot/sheets.py index c042b4d..76515ca 100644 --- a/turbot/sheets.py +++ b/turbot/sheets.py @@ -2,7 +2,7 @@ PUZZLE_TEMPLATE_ID = "1drSoyrE4gM3JaGweDkOybwXWdKPIDTfUmB1gQCYS3Uw" PUZZLE_TEMPLATE_SHEETS = ["Text", "Square grid", "Hex Grid", "Formula reference: indexing"] -def sheets_create_folder(turb, folder_name): +def sheets_create_folder(turb, folder_name, parents = None): """Create a new folder within Google Drive Returns the id of the created folder.""" @@ -12,6 +12,9 @@ def sheets_create_folder(turb, folder_name): "mimeType": "application/vnd.google-apps.folder" } + if parents: + body["parents"] = parents + folder = turb.files.create(body=body, fields='id').execute() return folder.get('id')