azkaban_cli/azkaban.py
def upload(self, path, project=None, zip_name=None):
        """
        Upload command, intended to make the request to Azkaban and treat the response properly

        This method receives a path to a directory that contains all the files that should be in the Azkaban project,
        zip this path (as Azkaban expects it zipped), make the upload request to Azkaban, deletes the zip that was
        created and evaluate the response.

        If project name is not passed as argument, it will be assumed that the project name is the basename of the path
        passed. If zip name is not passed as argument, the project name will be used for the zip.

        If project or path is wrong or if there is no session_id, it returns false. If everything is fine, returns True.

        :param str path: path to be zipped and uploaded
        :param str project: Project name on Azkaban, optional.
        :param str zip_name: Zip name that will be created and uploaded, optional.
        :raises UploadError: when Azkaban api returns error in response
        """

        self.__check_if_logged()

        if not project:
            # define project name as basename
            project = os.path.basename(os.path.abspath(path))

        if not zip_name:
            # define zip name as project name
            zip_name = project

        try:
            zip_path = make_archive(zip_name, 'zip', path)
        except FileNotFoundError as e:
            raise UploadError(str(e))

        try:
            response = api.upload_request(self.__session, self.__host, self.__session_id, project, zip_path)
        finally:
            os.remove(zip_path)

        self.__catch_response_error(response, UploadError)

        response_json = response.json()
        logging.info('Project %s updated to version %s' % (project, response_json[u'version']))

        Upload command, intended to make the request to Azkaban and treat the response properly

        This method receives a path to a directory that contains all the files that should be in the Azkaban project,
        zip this path (as Azkaban expects it zipped), make the upload request to Azkaban, deletes the zip that was
        created and evaluate the response.

        If project name is not passed as argument, it will be assumed that the project name is the basename of the path
        passed. If zip name is not passed as argument, the project name will be used for the zip.

        If project or path is wrong or if there is no session_id, it returns false. If everything is fine, returns True.

        :param str path: path to be zipped and uploaded
        :param str project: Project name on Azkaban, optional.
        :param str zip_name: Zip name that will be created and uploaded, optional.
        :raises UploadError: when Azkaban api returns error in response
        
Upload command, intended to make the request to Azkaban and treat the response properly
This method receives a path to a directory that contains all the files that should be in the Azkaban project,
zip this path (as Azkaban expects it zipped), make the upload request to Azkaban, deletes the zip that was
created and evaluate the response.

If project name is not passed as argument, it will be assumed that the project name is the basename of the path
passed. If zip name is not passed as argument, the project name will be used for the zip.

If project or path is wrong or if there is no session_id, it returns false. If everything is fine, returns True.
Upload command intended to make the request to Azkaban and treat the response properly This method receives a path to a directory that contains all the files that should be in the Azkaban project zip this path ( as Azkaban expects it zipped ) make the upload request to Azkaban deletes the zip that was created and evaluate the response . If project name is not passed as argument it will be assumed that the project name is the basename of the path passed . If zip name is not passed as argument the project name will be used for the zip . If project or path is wrong or if there is no session_id it returns false . If everything is fine returns True .
def upload(self, path, project=None, zip_name=None):
        self.__check_if_logged()
        if not project:
            project = os.path.basename(os.path.abspath(path))
        if not zip_name:
            zip_name = project
        try:
            zip_path = make_archive(zip_name, 'zip', path)
        except FileNotFoundError as e:
            raise UploadError(str(e))
        try:
            response = api.upload_request(self.__session, self.__host, self.__session_id, project, zip_path)
        finally:
            os.remove(zip_path)
        self.__catch_response_error(response, UploadError)
        response_json = response.json()
        logging.info('Project %s updated to version %s' % (project, response_json[u'version']))
def upload ( self , path , project = None , zip_name = None ) : self . __check_if_logged ( ) if not project : project = os . path . basename ( os . path . abspath ( path ) ) if not zip_name : zip_name = project try : zip_path = make_archive ( zip_name , 'zip' , path ) except FileNotFoundError as e : raise UploadError ( str ( e ) ) try : response = api . upload_request ( self . __session , self . __host , self . __session_id , project , zip_path ) finally : os . remove ( zip_path ) self . __catch_response_error ( response , UploadError ) response_json = response . json ( ) logging . info ( 'Project %s updated to version %s' % ( project , response_json [ u'version' ] ) )
Upload command, intended to make the request to Azkaban and treat the response properly
This method receives a path to a directory that contains all the files that should be in the Azkaban project,
zip this path (as Azkaban expects it zipped), make the upload request to Azkaban, deletes the zip that was
created and evaluate the response.
Upload command intended to make the request to Azkaban and treat the response properly This method receives a path to a directory that contains all the files that should be in the Azkaban project zip this path ( as Azkaban expects it zipped ) make the upload request to Azkaban deletes the zip that was created and evaluate the response .
"""
        Upload command, intended to make the request to Azkaban and treat the response properly

        This method receives a path to a directory that contains all the files that should be in the Azkaban project,
        zip this path (as Azkaban expects it zipped), make the upload request to Azkaban, deletes the zip that was
        created and evaluate the response.

        If project name is not passed as argument, it will be assumed that the project name is the basename of the path
        passed. If zip name is not passed as argument, the project name will be used for the zip.

        If project or path is wrong or if there is no session_id, it returns false. If everything is fine, returns True.

        :param str path: path to be zipped and uploaded
        :param str project: Project name on Azkaban, optional.
        :param str zip_name: Zip name that will be created and uploaded, optional.
        :raises UploadError: when Azkaban api returns error in response
        """ # define project name as basename # define zip name as project name
when Azkaban api returns error in response
when Azkaban api returns error in response
UploadError
self
path
path to be zipped and uploaded
path to be zipped and uploaded
project
Project name on Azkaban, optional.
Project name on Azkaban optional .
zip_name
Zip name that will be created and uploaded, optional.
Zip name that will be created and uploaded optional .