def create_bag(dir_bag):
    """
    Create a Bag out of given files.
    :param str dir_bag: Directory that contains csv, jsonld, and changelog files.
    :return obj: Bag
    """
    logger_bagit.info("enter create_bag")
    # if not dir_bag:
    #     dir_bag = os.getcwd()
    try:
        bag = bagit.make_bag(dir_bag, {'Name': 'LiPD Project', 'Reference': 'www.lipds.net', 'DOI-Resolved': 'True'})
        logger_bagit.info("created bag")
        return bag
    except FileNotFoundError as e:
        print("Error: directory not found to create bagit")
        logger_bagit.debug("create_bag: FileNotFoundError: failed to create bagit, {}".format(e))
    except Exception as e:
        print("Error: failed to create bagit bag")
        logger_bagit.debug("create_bag: Exception: failed to create bag, {}".format(e))
    return None
def create_bag ( dir_bag ) : logger_bagit . info ( "enter create_bag" ) try : bag = bagit . make_bag ( dir_bag , { 'Name' : 'LiPD Project' , 'Reference' : 'www.lipds.net' , 'DOI-Resolved' : 'True' } ) logger_bagit . info ( "created bag" ) return bag except FileNotFoundError as e : print ( "Error: directory not found to create bagit" ) logger_bagit . debug ( "create_bag: FileNotFoundError: failed to create bagit, {}" . format ( e ) ) except Exception as e : print ( "Error: failed to create bagit bag" ) logger_bagit . debug ( "create_bag: Exception: failed to create bag, {}" . format ( e ) ) return None
Create a Bag out of given files.
    :param str dir_bag: Directory that contains csv, jsonld, and changelog files.
    :return obj: Bag