def init():
    """Initializes archive manager.

    """
    if not _FOLDERS:
        for project, source in config.get_project_sources():
            _FOLDERS.add(_create_folder(project, source))
    log("Loading documentation archive: {}".format(config.get_directory()))
def _create_folder(project, source):
    """Creates & returns a wrapped archive folder.

    """
    path = os.path.join(config.get_directory(), project)
    path = os.path.join(path, source)
    if not os.path.exists(path):
        os.makedirs(path)

    return ArchiveFolderInfo(project, source, path)
Exemple #3
0
def _create_folder(project, source):
    """Creates & returns a wrapped archive folder.

    """
    path = os.path.join(config.get_directory(), project)
    path = os.path.join(path, source)
    if not os.path.exists(path):
        os.makedirs(path)

    return ArchiveFolderInfo(project, source, path)
def _test_archive_config():
    """Test archive configuration."""
    import pyesdoc.archive.config as cfg

    tu.assert_path(cfg.get_directory())
    tu.assert_int(cfg.get_projects(), 6)
    tu.assert_int(cfg.get_sources(), 4)
    tu.assert_int(cfg.get_projects()[0].feeds, 2)
    tu.assert_int(cfg.get_projects()[1].feeds, 1)
    tu.assert_int(cfg.get_projects()[2].feeds, 1)
    tu.assert_int(cfg.get_projects()[3].feeds, 1)
    tu.assert_int(cfg.get_projects()[4].feeds, 1)
    tu.assert_int(cfg.get_project_sources(), 7)