Skip to content
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

Initial TDSX support. #44

Merged
merged 7 commits into from
Jun 30, 2016
Merged

Initial TDSX support. #44

merged 7 commits into from
Jun 30, 2016

Conversation

t8y8
Copy link
Contributor

@t8y8 t8y8 commented Jun 30, 2016

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
Contributor Author

Choose a reason for hiding this comment

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

'archivefile' is obviously a terrible name

Copy link
Contributor

@graysonarts graysonarts Jun 30, 2016

Choose a reason for hiding this comment

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

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
Contributor Author

Choose a reason for hiding this comment

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

containerfile works for me.

<Insert joke about naming things is hard here / >

Copy link
Contributor

Choose a reason for hiding this comment

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

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
Contributor

Choose a reason for hiding this comment

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

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

t8y8 added 2 commits June 30, 2016 09:33
…pen the file directly from the zip instead of extracting multiple times
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
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

@graysonarts
Copy link
Contributor

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

@t8y8
Copy link
Contributor Author

t8y8 commented Jun 30, 2016

@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 t8y8 merged commit aba2a35 into tableau:development Jun 30, 2016
@t8y8 t8y8 mentioned this pull request Jun 30, 2016
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