Exemplo n.º 1
0
    def createFile(self, name, folder=None, mimeType=None):
        folder = utils.firstNonNone(folder, False)

        file = {'name': name}
        if mimeType is None:
            if folder:
                file['mimeType'] = remotefile.MIME_FOLDER
        else:
            file['mimeType'] = mimeType

        file['parents'] = [self.file.delegate.get('id')]

        return remotefile.fromParent(self.file, file)
Exemplo n.º 2
0
    def createFile(self, name, folder = None, mimeType = None):
        folder = utils.firstNonNone(folder, False)

        file = {'title': name}
        if mimeType is None:
            if folder:
                file['mimeType'] = remotefile.MIME_FOLDER
        else:
            file['mimeType'] = mimeType

        file['parents'] = [{'id': self.file.delegate.get('id')}]

        return remotefile.fromParent(self.file, file)
Exemplo n.º 3
0
        def request():
            remoteFolder = RemoteFolder(file)

            pageToken = None
            while True:
                list = (self._drive.files().list(q = query,
                        fields = CHILDREN_FIELDS, pageToken = pageToken,
                        maxResults = LIST_MAX_RESULTS))

                files = list.execute()
                for child in files['items']:
                    remoteFolder.addChild(remotefile.fromParent(file, child))

                pageToken = files.get('nextPageToken')
                if pageToken is None:
                    break

            return remoteFolder
Exemplo n.º 4
0
        def request():
            remoteFolder = RemoteFolder(file)

            pageToken = None
            while True:
                list = (self._drive.files().list(q=query,
                                                 fields=CHILDREN_FIELDS,
                                                 pageToken=pageToken,
                                                 pageSize=LIST_PAGE_SIZE))

                files = list.execute()
                for child in files['files']:
                    remoteFolder.addChild(remotefile.fromParent(file, child))

                pageToken = files.get('nextPageToken')
                if pageToken is None:
                    break

            return remoteFolder