def bundle_content_section(src_path, dst_path, section, config, online_link): """Bundles content. Calls copy_files method after setting necessary parameters in HtmlTransformation Args: src_path: Path to the content to be bundled dst_path: Path where the bundled content will be written section: Section to be bundled config: Dictionary containing configuration parameters online_link: URL to content online """ # Initialising a list of transformations logging.info("Start bundling files from " + section + ".") transformations = [] if online_link and not "http://" in online_link: online_link = "http://" + online_link link_color = config["link_color"] tracking_code = config["tracking_code"] html_transform = HtmlTransformation(color=link_color, code=tracking_code, link=online_link) transformations.append(html_transform) paths = (src_path, dst_path) copy_files(paths, section, transformations) click.echo("\n") logging.info("Finish bundling files from " + section + ".")
def bundle_video_section(paths, vid, metadata, transformations, videos_src): """Bundles videos. Calls copy_files method after setting necessary parameters in HtmlTransformation for videos only. Args: paths: Tuple of source and destination directories vid: Video Section metadata: Video metadata transformations: Transformation object videos_src: Path to video source directory """ logging.info("Start bundling videos from " + vid + ".") copy_files(paths, vid, transformations, metadata, videos_src) click.echo("\n") logging.info("Finish bundling videos from " + vid + ".")