def createEmptySpreadsheet(self, number): resp, content = httplib2.Http().request('http://galdoge.kaseorg.com/cgi-bin/suchbot-new-channel.cgi?' + urllib.urlencode({'id': number})) assert resp.status == 200 http = oauth_decorator.http() body = { 'title': '2015.'+number, 'mimeType': 'application/vnd.google-apps.spreadsheet', 'parents': [{'id': HUNT_2015_FOLDER_ID}] } file = drive_service.files().insert(body=body).execute(http=http) return (file['id'], file['alternateLink'])
def trashFile(self, file_id): http = oauth_decorator.http() drive_service.files().trash(fileId=file_id).execute(http=http)