예제 #1
0
def create_examples_all():
    """create arduino/examples/all directory.

    :rtype: None

    """
    remove_examples_all()
    examples_all_dir().mkdir()

    for lib in libraries():
        maindir = examples_all_dir() / lib.upper()[0:1] / lib
        #        libraries_dir() /
        maindir.makedirs_p()

        for ex in lib_examples(lib):
            d = lib_example_dir(lib, ex)
            if hasattr(os, "symlink"):
                d.symlink(maindir / ex)
            else:
                d.copytree(maindir / ex)
예제 #2
0
def create_examples_all():
    """create arduino/examples/all directory.

    :rtype: None

    """
    remove_examples_all()
    examples_all_dir().mkdir()

    for lib in libraries():
        maindir = examples_all_dir() / lib.upper()[0:1] / lib
#        libraries_dir() /
        maindir.makedirs_p()

        for ex in lib_examples(lib):
            d = lib_example_dir(lib, ex)
            if hasattr(os, 'symlink'):
                d.symlink(maindir / ex)
            else:
                d.copytree(maindir / ex)
예제 #3
0
def remove_examples_all():
    """remove arduino/examples/all directory.

    :rtype: None

    """
    d = examples_all_dir()
    if d.exists():
        log.debug('remove %s', d)
        d.rmtree()
    else:
        log.debug('nothing to remove: %s', d)