bmonreporter/reporter.py
def create_reports(
        source_repos,
        log_level,
        log_file_dir='bmon-reporter-logs/',
        cores=1,
    ):
    """Creates all of the reports for Organizations a Buildings across all specified BMON
    servers.

    Input Parameters:

    source_repos: a list of dictionaries, one dictionary for each GitHub repository containing
        notebook report templates and configuration info.  The dictionary must have a 'git_spec'
        key indicating the GitHub spec used to clone the repo, 
        eg. git@github.com:alanmitchell/bmonreporter-templates.git.  A 'branch' key is optional
        indicating which branch of the repo to use; if the 'branch' key of the dictionary is not
        present, the 'master' branch is used.
    log_level: string indicating detail of logging to occur: DEBUG, INFO, WARNING, ERROR
    log_file_dir: (optional) directory or S3 bucket + prefix to store log files from report
        creation; defaults to 'bmon-report-logs' in current directory.
    cores: (optional) # of cores available to process this script.  Defaults to 1.
    """

    try:
        # Set up a main temporary directory, which will have a folder for logs.
        # ├── bmonreporter_<temp directory id>
        #     ├── logs            # log files
        temp_dir = tempfile.TemporaryDirectory(prefix='bmonreporter_')
        temp_dir_path = Path(temp_dir.name)
        (temp_dir_path / 'logs').mkdir()

        # set up logging
        bmonreporter.config_logging.configure_logging(
            logging, 
            temp_dir_path / 'logs/bmonreporter.log', 
            log_level
        )

        try:

            # Loop through the Git repos to process, but use the multiprocessing
            # module to do this in multiple processes.
            cores_to_use = min(len(source_repos), cores)
            with Pool(cores_to_use) as p:
                p.map(process_repo, source_repos)
            
        except:
            logging.exception('Error setting up reporter.')
            
    finally:
        # copy the temporary logging directory to its final location
        try:
            copy_dir_tree(str(temp_dir_path / 'logs'), log_file_dir, 'text/plain; charset=ISO-8859-15')
        except:
            logging.exception('Error uploading logging directory.')
        
        # Clean up the main temporary directory
        temp_dir.cleanup()
Creates all of the reports for Organizations a Buildings across all specified BMON
    servers.

    Input Parameters:

    source_repos: a list of dictionaries, one dictionary for each GitHub repository containing
        notebook report templates and configuration info.  The dictionary must have a 'git_spec'
        key indicating the GitHub spec used to clone the repo, 
        eg. git@github.com:alanmitchell/bmonreporter-templates.git.  A 'branch' key is optional
        indicating which branch of the repo to use; if the 'branch' key of the dictionary is not
        present, the 'master' branch is used.
    log_level: string indicating detail of logging to occur: DEBUG, INFO, WARNING, ERROR
    log_file_dir: (optional) directory or S3 bucket + prefix to store log files from report
        creation; defaults to 'bmon-report-logs' in current directory.
    cores: (optional) # of cores available to process this script.  Defaults to 1.
    
Creates all of the reports for Organizations a Buildings across all specified BMON
servers.

Input Parameters.

a list of dictionaries, one dictionary for each GitHub repository containing
notebook report templates and configuration info.  The dictionary must have a 'git_spec'
key indicating the GitHub spec used to clone the repo,
eg.
Creates all of the reports for Organizations a Buildings across all specified BMON servers . Input Parameters . a list of dictionaries one dictionary for each GitHub repository containing notebook report templates and configuration info . The dictionary must have a ' git_spec ' key indicating the GitHub spec used to clone the repo eg .
def create_reports(
        source_repos,
        log_level,
        log_file_dir='bmon-reporter-logs/',
        cores=1,
    ):
    try:
        temp_dir = tempfile.TemporaryDirectory(prefix='bmonreporter_')
        temp_dir_path = Path(temp_dir.name)
        (temp_dir_path / 'logs').mkdir()
        bmonreporter.config_logging.configure_logging(
            logging, 
            temp_dir_path / 'logs/bmonreporter.log', 
            log_level
        )
        try:
            cores_to_use = min(len(source_repos), cores)
            with Pool(cores_to_use) as p:
                p.map(process_repo, source_repos)
        except:
            logging.exception('Error setting up reporter.')
    finally:
        try:
            copy_dir_tree(str(temp_dir_path / 'logs'), log_file_dir, 'text/plain; charset=ISO-8859-15')
        except:
            logging.exception('Error uploading logging directory.')
        temp_dir.cleanup()
def create_reports ( source_repos , log_level , log_file_dir = 'bmon-reporter-logs/' , cores = 1 , ) : try : temp_dir = tempfile . TemporaryDirectory ( prefix = 'bmonreporter_' ) temp_dir_path = Path ( temp_dir . name ) ( temp_dir_path / 'logs' ) . mkdir ( ) bmonreporter . config_logging . configure_logging ( logging , temp_dir_path / 'logs/bmonreporter.log' , log_level ) try : cores_to_use = min ( len ( source_repos ) , cores ) with Pool ( cores_to_use ) as p : p . map ( process_repo , source_repos ) except : logging . exception ( 'Error setting up reporter.' ) finally : try : copy_dir_tree ( str ( temp_dir_path / 'logs' ) , log_file_dir , 'text/plain; charset=ISO-8859-15' ) except : logging . exception ( 'Error uploading logging directory.' ) temp_dir . cleanup ( )
Creates all of the reports for Organizations a Buildings across all specified BMON
servers.
Creates all of the reports for Organizations a Buildings across all specified BMON servers .
"""Creates all of the reports for Organizations a Buildings across all specified BMON
    servers.

    Input Parameters:

    source_repos: a list of dictionaries, one dictionary for each GitHub repository containing
        notebook report templates and configuration info.  The dictionary must have a 'git_spec'
        key indicating the GitHub spec used to clone the repo, 
        eg. git@github.com:alanmitchell/bmonreporter-templates.git.  A 'branch' key is optional
        indicating which branch of the repo to use; if the 'branch' key of the dictionary is not
        present, the 'master' branch is used.
    log_level: string indicating detail of logging to occur: DEBUG, INFO, WARNING, ERROR
    log_file_dir: (optional) directory or S3 bucket + prefix to store log files from report
        creation; defaults to 'bmon-report-logs' in current directory.
    cores: (optional) # of cores available to process this script.  Defaults to 1.
    """ # Set up a main temporary directory, which will have a folder for logs. # ├── bmonreporter_<temp directory id> #     ├── logs            # log files # set up logging # Loop through the Git repos to process, but use the multiprocessing # module to do this in multiple processes. # copy the temporary logging directory to its final location # Clean up the main temporary directory
source_repos
log_level
log_file_dir
cores