Skip to content

Adds globbing to pull #2

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

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

Conversation

gabviv73
Copy link

@gabviv73 gabviv73 commented Apr 4, 2020

Let pull files with wildcards. dst-filename=src-filename always. Destination must be always a directory.

if source != '':
source_filename=os.path.basename(source)
destination=args.target + "/" + source_filename
print("Copying " + source + " to " + destination)
Copy link
Owner

Choose a reason for hiding this comment

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

Please use logging instead of print. Level info would be suitable here

if reply[0] == 'n':
return False
else:
return yes_or_no("Please enter y or n:")
Copy link
Owner

Choose a reason for hiding this comment

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

It crashes if you hit just enter:

Traceback (most recent call last):
  File "adb-root.py", line 92, in <module>
    pull()
  File "adb-root.py", line 74, in pull
    if yes_or_no("Destination file exits. Ovewrite it ?"):
  File "adb-root.py", line 57, in yes_or_no
    if reply[0] == 'y':
IndexError: string index out of range

Would be better to just default to no (y/N) if the input is empty here.

@Jakeler
Copy link
Owner

Jakeler commented Apr 11, 2020

Thanks, that works. Note that it still does not handle subdirectories and creates empty files.

btw: You can add more commits by pushing on your fork/branch, you don't have to make a new pull request.

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.

2 participants