Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Support pull directories #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

tgalal
Copy link
Contributor

@tgalal tgalal commented May 30, 2015

No description provided.

return dest_file.getvalue()

if dest_file:
print("pull: %s -> %s" % (device_filename, dest_file))
Copy link
Contributor

Choose a reason for hiding this comment

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

No printing, please. Also, instead of an assert on 182, raise a custom error or something like ValueError that can be caught more specifically than the generic AssertionError.

@fahhem
Copy link
Contributor

fahhem commented May 31, 2015

Other than that one comment, LGTM. Thanks for adding that!

@tgalal
Copy link
Contributor Author

tgalal commented May 31, 2015

Updated

@fahhem
Copy link
Contributor

fahhem commented May 31, 2015

LGTM! I can't merge these myself, but hopefully @alusco is still paying attention these days


if stat.S_ISDIR(filemode):
if dest_file is None:
raise ValueError("Must specify dest_file when pulling a directory")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a check for dest_file being a directory (or not existing)? If they specify an existing file then we'll error out in a weird place down in Pull

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, if they call without dest_file, can we return a map of StringIO objects?

dest_file = collections.defaultdict(cStringIO.StringIO)
...
self.Pull(
    ..., os.path.join(dest_file, device_file.filename)
         if isinstance(dest_file, basestring) else dest_file[device_file.filename])

then after the loop do:

if isinstance(dest_file, dict):
  return {fn: data.getvalue() for fn, data in dest_file.iteritems()}

@fahhem
Copy link
Contributor

fahhem commented Feb 16, 2016

Any interest in this PR? I have write access now, but there are a few comments left alone here. If you get around to those, I can merge this PR. Otherwise, I'll take this over from you in late March

maruel added a commit to maruel/python-adb that referenced this pull request Feb 18, 2016
maruel added a commit to maruel/python-adb that referenced this pull request Jun 17, 2016
@fahhem
Copy link
Contributor

fahhem commented Jun 8, 2017

Ping? This PR had some activity, but none of the comments were addressed (and now it conflicts with master, sorry)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants