'Write a tar archive containing all the TAP files and
a meta.yml containing the file names.'

def _write_tap_archive(self):

    os.chdir(self.resultdir)
    tap_files = []
    for (rel_path, _, files) in os.walk('.'):
        tap_files.extend(['/'.join([rel_path, f]) for f in files if f.endswith('.tap')])
    meta_yaml = open('meta.yml', 'w')
    meta_yaml.write('file_order:\n')
    tap_tar = tarfile.open((self.resultdir + '/tap.tar.gz'), 'w:gz')
    for f in tap_files:
        meta_yaml.write((('        -    ' + f.lstrip('./')) + '\n'))
        tap_tar.add(f)
    meta_yaml.close()
    tap_tar.add('meta.yml')
    tap_tar.close()
