def extract_locale_settings(tree): """Extract localised settings available in the tree.""" value_list = ( ('surveyls_title', './/div[@class="surveytitle"]'), ) results = [] for key, selector in value_list: value = get(tree.xpath(selector)) value = get_inner_html(value) value = strip_tags(value) results.append((key, value.strip())) return dict(results)
def get_form_title(tree): """Gets the title of the form.""" title = get(tree.xpath('//div[@class="surveytitle"]')) title_text = get_inner_html(title) return title_text
def get_page_title(section): title = get(section) title = get_inner_html(title) return strip_tags(title)
def clean_text(content): content = get_inner_html(content) return content.strip()