# coding: utf-8
""" Dynamic rule to copy file in another directory.
"""

def dynamic_copy(name, project):
    metadata = {'name': name}
    dynamic_copy = '''
rule copy_%(name)s:
    input:
        src = __copy_%(name)s__input
    output:
        dst = __copy_%(name)s__output
    shell:
        """
        cp {input.src} {output.dst}
        """
'''
    from sequana.snaketools import build_dynamic_rule
    return build_dynamic_rule(dynamic_copy % metadata, project.pipeline_dir)
