Esempio n. 1
0
 def action():
     get_service(credentials).files().update(
         fileId=file['id'],
         body={
             'modifiedTime':
             datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S" + 'Z')
         }).execute()
Esempio n. 2
0
 def action():
     folder = get_service(credentials).files().create(
         body={
             'name': name,
             'parents': [parent['id']],
             'mimeType': 'application/vnd.google-apps.folder'
         },
         fields='id').execute()
     folder['path'] = path
     folder['name'] = name
     return folder
Esempio n. 3
0
 def load_page():
     if name_filter:
         q = "'{0}' in parents and name = '{1}'".format(folder['id'], name_filter)
     else:
         q = "'{0}' in parents".format(folder['id'])
     request = get_service(credentials).files().list(
         q=q,
         fields="nextPageToken, files(id, name, size, mimeType, modifiedTime)",
         pageSize=PAGE_SIZE,
         pageToken=acc.get('nextPageToken')
     )
     return request.execute()
Esempio n. 4
0
 def create_downloader():
     request = get_service(credentials).files().get_media(
         fileId=f['id'])
     return MediaIoBaseDownload(fd=destination_file,
                                request=request,
                                chunksize=CHUNK_SIZE)
Esempio n. 5
0
 def action():
     get_service(credentials).files().delete(fileId=file['id']).execute()