owncloud/owncloud.py
def put_directory(self, target_path, local_directory, **kwargs):
        """Upload a directory with all its contents

        :param target_path: path of the directory to upload into
        :param local_directory: path to the local directory to upload
        :param \*\*kwargs: optional arguments that ``put_file`` accepts
        :returns: True if the operation succeeded, False otherwise
        :raises: ResponseError in case an HTTP error status was returned
        """
        target_path = self.__normalize_path(target_path)
        if not target_path[-1] == '/':
            target_path += '/'
        gathered_files = []

        if not local_directory[-1] == '/':
            local_directory += '/'

        basedir = os.path.basename(local_directory[0: -1]) + '/'
        # gather files to upload
        for path, _, files in os.walk(local_directory):
            gathered_files.append(
                    (path, basedir + path[len(local_directory):], files)
                    )

        for path, remote_path, files in gathered_files:
            self.mkdir(target_path + remote_path + '/')
            for name in files:
                if not self.put_file(
                        target_path + remote_path + '/',
                        path + '/' + name,
                        **kwargs
                        ):
                    return False
        return True
Upload a directory with all its contents

        :param target_path: path of the directory to upload into
        :param local_directory: path to the local directory to upload
        :param \*\*kwargs: optional arguments that ``put_file`` accepts
        :returns: True if the operation succeeded, False otherwise
        :raises: ResponseError in case an HTTP error status was returned
        
Upload a directory with all its contents
Upload a directory with all its contents
def put_directory(self, target_path, local_directory, **kwargs):
        target_path = self.__normalize_path(target_path)
        if not target_path[-1] == '/':
            target_path += '/'
        gathered_files = []
        if not local_directory[-1] == '/':
            local_directory += '/'
        basedir = os.path.basename(local_directory[0: -1]) + '/'
        for path, _, files in os.walk(local_directory):
            gathered_files.append(
                    (path, basedir + path[len(local_directory):], files)
                    )
        for path, remote_path, files in gathered_files:
            self.mkdir(target_path + remote_path + '/')
            for name in files:
                if not self.put_file(
                        target_path + remote_path + '/',
                        path + '/' + name,
                        **kwargs
                        ):
                    return False
        return True
def put_directory ( self , target_path , local_directory , ** kwargs ) : target_path = self . __normalize_path ( target_path ) if not target_path [ - 1 ] == '/' : target_path += '/' gathered_files = [ ] if not local_directory [ - 1 ] == '/' : local_directory += '/' basedir = os . path . basename ( local_directory [ 0 : - 1 ] ) + '/' for path , _ , files in os . walk ( local_directory ) : gathered_files . append ( ( path , basedir + path [ len ( local_directory ) : ] , files ) ) for path , remote_path , files in gathered_files : self . mkdir ( target_path + remote_path + '/' ) for name in files : if not self . put_file ( target_path + remote_path + '/' , path + '/' + name , ** kwargs ) : return False return True
Upload a directory with all its contents
Upload a directory with all its contents
"""Upload a directory with all its contents

        :param target_path: path of the directory to upload into
        :param local_directory: path to the local directory to upload
        :param \*\*kwargs: optional arguments that ``put_file`` accepts
        :returns: True if the operation succeeded, False otherwise
        :raises: ResponseError in case an HTTP error status was returned
        """ # gather files to upload
True if the operation succeeded, False otherwise
True if the operation succeeded False otherwise
ResponseError in case an HTTP error status was returned
ResponseError in case an HTTP error status was returned
self
target_path
path of the directory to upload into
path of the directory to upload into
local_directory
path to the local directory to upload
path to the local directory to upload
\*\*kwargs
optional arguments that ``put_file`` accepts
optional arguments that ` ` put_file ` ` accepts