Skip to content

add shape property #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions tableaudocumentapi/workbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ def __init__(self, filename):
self._datasource_index = self._prepare_datasource_index(self._datasources)

self._worksheets = self._prepare_worksheets(
self._workbookRoot, self._datasource_index
)
self._workbookRoot, self._datasource_index)

self._shapes = self._prepare_shapes(self._workbookRoot)

@property
def datasources(self):
Expand All @@ -42,6 +43,10 @@ def worksheets(self):
def filename(self):
return self._filename

@property
def shapes(self):
return self._shapes

def save(self):
"""
Call finalization code and save file.
Expand Down Expand Up @@ -116,3 +121,16 @@ def _prepare_worksheets(xml_root, ds_index):
datasource.fields[column_name].add_used_in(worksheet_name)

return worksheets

@staticmethod
def _prepare_shapes(xml_root):
shapes = []
worksheets_element = xml_root.find('.//external/shapes')
if worksheets_element is None:
return shapes

for worksheet_element in worksheets_element:
shape_name = worksheet_element.attrib['name']
shapes.append(shape_name)

return shapes
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy