Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/openpyxl/reader/strings.py : 31%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Copyright (c) 2010-2020 openpyxl
3from openpyxl.cell.text import Text
5from openpyxl.xml.functions import iterparse
6from openpyxl.xml.constants import SHEET_MAIN_NS
9def read_string_table(xml_source):
10 """Read in all shared strings in the table"""
12 strings = []
13 STRING_TAG = '{%s}si' % SHEET_MAIN_NS
15 for _, node in iterparse(xml_source):
16 if node.tag == STRING_TAG:
17 text = Text.from_tree(node).content
18 text = text.replace('x005F_', '')
19 node.clear()
21 strings.append(text)
23 return strings