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

Top-level functions #71

Closed
kimgr opened this issue May 17, 2016 · 1 comment · Fixed by #72
Closed

Top-level functions #71

kimgr opened this issue May 17, 2016 · 1 comment · Fixed by #72

Comments

@kimgr
Copy link

kimgr commented May 17, 2016

I'd like to add two utility functions to the scp module -- get and put, something like;

def get(transport, remote_path, local_path='',
        recursive=False, preserve_times=False):
     return SCPClient(transport).get(...)

In many one-off use cases, creating an SCPClient object is more syntactic noise than necessary.

I'd be happy to work on patches if this sounds reasonable.

@remram44
Copy link
Collaborator

remram44 commented May 17, 2016

SCPClient(transport).get(...) is not that much more to write.

I agree that this makes sense conceptually, but the truth is that SCPClient closes the channel after each get() or put() invocation so there is no real point in writing the proper with SCPClient(...) as client: client.get(...) instead of the chained SCPClient(...).get(...).

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

Successfully merging a pull request may close this issue.

2 participants