FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Initial TDSX support. by t8y8 · Pull Request #44 · tableau/document-api-python · GitHub

Initial TDSX support. - #44

Merged
t8y8 merged 7 commits into
tableau:developmentfrom
t8y8:tdsx-support
Jun 30, 2016
Merged

Initial TDSX support.#44
t8y8 merged 7 commits into
tableau:developmentfrom
t8y8:tdsx-support

Conversation

t8y8 commented Jun 30, 2016

Copy link
Copy Markdown
Contributor

Lots of duplicated code with TWBX's. But it works.

So much so, I wouldn't really want to check this in as-is.

I have a vague idea of an ArchiveFile module to hold all the shared logic, or something along those lines.

Thoughts? @RussTheAerialist

@@ -0,0 +1,67 @@
import contextlib

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

'archivefile' is obviously a terrible name

graysonarts Jun 30, 2016
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

hah, containerfile? It's only a zip archive because of implementation details. Ultimately, it's a container file format.
(also, I'm horrible at naming things)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

containerfile works for me.

<Insert joke about naming things is hard here / >

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

what exactly are we trying to convey here? just that there is some kind of container (i.e. TDSX or TWBX) vs. a single file (TDS or TWB)?

if these containers will always end in "x" then let's call this xfile.py :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Oh damn, @benlower with the winning name! we should go with xfiles

Comment thread tableaudocumentapi/containerfile.py Outdated
xml_file = find_file_in_zip(zf, file_type)
xml_tree = ET.parse(os.path.join(temp, xml_file))
with zipfile.ZipFile(filename) as zf:
xml_file = zf.open(find_file_in_zip(zf))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this a context object also? Or does it automatically get closed when the zipfile is closed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You're right, it needs to be wrapped in a with

Copy link
Copy Markdown
Contributor

one small comment about the zt.open usage, but otherwise LGTM.

t8y8 commented Jun 30, 2016

Copy link
Copy Markdown
Contributor Author

@benlower @RussTheAerialist alright, the code is feeling much better -- but we have one last chance to call that module something else before merging.

Do we want to go with xfile :) ?

t8y8 merged commit aba2a35 into tableau:development Jun 30, 2016
t8y8 mentioned this pull request Jun 30, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL