def build_page(url, deploy_dir): filename = os.path.join(deploy_dir, url) _ensure_dir(filename) html = simpress.web.create_app().test_client().get( url, follow_redirects=True).data.decode('utf-8') logger().info('build %s (%dbytes)' % (url, len(html))) with open(filename, 'w') as f: f.write(html)
def copy_static_files(src, dst): logger().info('copy static files') shutil.copytree( src, dst, ignore=shutil.ignore_patterns('_*', '*.md', '*.py'))
def truncate_deploy_dir(deploy_dir): if os.path.exists(deploy_dir): logger().info('truncate deploy dir "%s"' % deploy_dir) shutil.rmtree(deploy_dir)
def copy_static_files(src, dst): logger().info('copy static files') shutil.copytree(src, dst, ignore=shutil.ignore_patterns('_*', '*.md', '*.py'))