def main(src_dir, new_dir, map_d, archer):
""" Call out the necessary functions."""
print "Creating a copy of %s in %s" % (src_dir, new_dir)
shutil.copytree(src_dir, new_dir, symlinks=False, ignore=shutil.ignore_patterns('*.pyc'))
print "Changing the paths according to the mapping table."
for key in map_d.keys():
grep_and_sed(key, new_dir, map_d[key])
fn = shutil.make_archive(new_dir, 'tar', new_dir)
print "%s can now be copied elsewhere and used." %(fn)
评论列表
文章目录