Ejemplo n.º 1
0
def ciods_from_extracted_list(ciod_module_list):
    ciods = []
    for ciod in ciod_module_list:
        ciod['description'] = pl.clean_html(ciod['description'])
        ciod.pop('modules', None)
        ciods.append(ciod)
    return ciods
Ejemplo n.º 2
0
def find_reference_html_in_sections(pairs, section_listing):
    refs_to_record = get_refs_from_pairs(pairs)
    references = {}
    for chapter, page_and_fragment in refs_to_record:
        reference_id = page_and_fragment.split('#')[-1]
        section_with_context = BeautifulSoup(
            section_listing[chapter + '.html'][reference_id], 'html.parser')
        enclosing_section = section_with_context.find('div').find(
            'a', id=True)['id']
        short_dicom_url = urljoin(
            pl.BASE_SHORT_DICOM_SECTION_URL,
            chapter + '/' + pl.get_standard_page(enclosing_section) +
            '.html#' + reference_id,
        )
        reference_html = section_with_context.find('a', id=reference_id)
        references[short_dicom_url] = str(
            reference_content_from_id(reference_html))
    refs_with_resolved_resource_urls = {
        k: pl.resolve_relative_resource_urls(v)
        for k, v in references.items()
    }
    cleaned_references = {
        k: pl.clean_html(v)
        for k, v in refs_with_resolved_resource_urls.items()
    }
    return cleaned_references
Ejemplo n.º 3
0
def modules_from_tables(tables):
    modules = []
    for module in tables:
        module['description'] = pl.clean_html(module['description'])
        module.pop('attributes', None)
        module.pop('isMacro', None)
        modules.append(module)
    return modules
Ejemplo n.º 4
0
def modules_from_tables(tables):
    modules = {}
    for module in tables:
        modules[module['id']] = {
            'id': module['id'],
            'name': module['name'],
            'description': pl.clean_html(module['description']),
            'linkToStandard': module['linkToStandard']
        }
    return modules
Ejemplo n.º 5
0
def ciods_from_extracted_list(ciod_module_list):
    ciods = {}
    for ciod in ciod_module_list:
        ciods[ciod['id']] = {
            'id': ciod['id'],
            'description': pl.clean_html(ciod['description']),
            'linkToStandard': ciod['linkToStandard'],
            'name': ciod['name']
        }
    return ciods
def get_table_with_metadata(table_with_tdiv: Tuple[List[TableDictType], Tag]) -> MetadataTableType:
    table, tdiv = table_with_tdiv
    clean_name = clean_macro_table_name(pr.table_name(tdiv))
    clean_description = pl.clean_html(str(tdiv.find_previous('p')))
    module_type = 'Multi-frame' if 'Multi-frame' in clean_description \
        else 'Current Frame' if 'Current Frame' in clean_description \
        else None
    return {
        'name': clean_name,
        'macros': table,
        'id': pl.create_slug(clean_name),
        'description': clean_description,
        'linkToStandard': get_short_standard_link(tdiv),
        'moduleType': module_type,
    }
Ejemplo n.º 7
0
def finalize_descriptions(pair):
    pair['description'] = pl.clean_html(pair['description'])