Skip to content

Commit

Permalink
Merge pull request #67 from hoverinc/add-has_extract-flag-to-tableau-…
Browse files Browse the repository at this point in the history
…file

Added an attribute to a TableauFile for has_extract_data
  • Loading branch information
JustinGrilli authored Oct 11, 2023
2 parents 2f28065 + 1ccfb25 commit 199d482
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
long_description=readme,
long_description_content_type='text/markdown',
name="tableau_utilities",
version="2.0.66",
version="2.0.67",
packages=[
'tableau_utilities',
'tableau_utilities.general',
Expand Down
2 changes: 2 additions & 0 deletions tableau_utilities/tableau_file/tableau_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, file_path):
''' Set on init '''
self._tree: ET.ElementTree
self._root: ET.Element
self.has_extract_data: bool = False
self.__extract_xml()

def __extract_xml(self, path=None):
Expand All @@ -50,6 +51,7 @@ def __extract_xml(self, path=None):
with ZipFile(path) as zip_file:
for z in zip_file.filelist:
if z.filename.split('.')[-1] not in ['tds', 'twb']:
self.has_extract_data = True
continue
self._tree = ET.parse(zip_file.open(z.filename))
self._root = self._tree.getroot()
Expand Down

0 comments on commit 199d482

Please sign in to comment.