# Path: openpyxl/shared/xmltools.py
# def get_document_content(xml_node):
# def pretty_indent(elem, level=0):
# def start_tag(doc, name, attr=None, body=None, namespace=None):
# def end_tag(doc, name, namespace=None):
# def tag(doc, name, attr=None, body=None, namespace=None):


from openpyxl.shared.xmltools import Element, SubElement, get_document_content

        self._sheet = sheet

    def write(self):
        """ write drawings for one sheet in one file """

        root = Element('xdr:wsDr',
            {'xmlns:xdr' : "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
            'xmlns:a' : "http://schemas.openxmlformats.org/drawingml/2006/main"})

        for i, chart in enumerate(self._sheet._charts):

            drawing = chart.drawing

#            anchor = SubElement(root, 'xdr:twoCellAnchor')
#            (start_row, start_col), (end_row, end_col) = drawing.coordinates
#            # anchor coordinates
#            _from = SubElement(anchor, 'xdr:from')
#            x = SubElement(_from, 'xdr:col').text = str(start_col)
#            x = SubElement(_from, 'xdr:colOff').text = '0'
#            x = SubElement(_from, 'xdr:row').text = str(start_row)
#            x = SubElement(_from, 'xdr:rowOff').text = '0'

#            _to = SubElement(anchor, 'xdr:to')
#            x = SubElement(_to, 'xdr:col').text = str(end_col)
#            x = SubElement(_to, 'xdr:colOff').text = '0'
#            x = SubElement(_to, 'xdr:row').text = str(end_row)
#            x = SubElement(_to, 'xdr:rowOff').text = '0'

            # we only support absolute anchor atm (TODO: oneCellAnchor, twoCellAnchor
            x, y, w, h = drawing.get_emu_dimensions()

# Path: openpyxl/shared/xmltools.py
# def get_document_content(xml_node):
# def pretty_indent(elem, level=0):
# def start_tag(doc, name, attr=None, body=None, namespace=None):
# def end_tag(doc, name, namespace=None):
# def tag(doc, name, attr=None, body=None, namespace=None):


# Path: openpyxl/writer/drawings.py
from openpyxl.shared.xmltools import Element, SubElement, get_document_content

        self._sheet = sheet

    def write(self):
        """ write drawings for one sheet in one file """

        root = Element('xdr:wsDr',
            {'xmlns:xdr' : "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
            'xmlns:a' : "http://schemas.openxmlformats.org/drawingml/2006/main"})

        for i, chart in enumerate(self._sheet._charts):

            drawing = chart.drawing

#            anchor = SubElement(root, 'xdr:twoCellAnchor')
#            (start_row, start_col), (end_row, end_col) = drawing.coordinates
#            # anchor coordinates
#            _from = SubElement(anchor, 'xdr:from')
#            x = SubElement(_from, 'xdr:col').text = str(start_col)
#            x = SubElement(_from, 'xdr:colOff').text = '0'
#            x = SubElement(_from, 'xdr:row').text = str(start_row)
#            x = SubElement(_from, 'xdr:rowOff').text = '0'

#            _to = SubElement(anchor, 'xdr:to')
#            x = SubElement(_to, 'xdr:col').text = str(end_col)
#            x = SubElement(_to, 'xdr:colOff').text = '0'
#            x = SubElement(_to, 'xdr:row').text = str(end_row)
#            x = SubElement(_to, 'xdr:rowOff').text = '0'

            # we only support absolute anchor atm (TODO: oneCellAnchor, twoCellAnchor
            x, y, w, h = drawing.get_emu_dimensions()

            anchor = SubElement(root, 'xdr:absoluteAnchor')
