Allow tftp client to be imported as a library#15
Open
isaiahtaylor wants to merge 7 commits intompetazzoni:masterfrom
Open
Allow tftp client to be imported as a library#15isaiahtaylor wants to merge 7 commits intompetazzoni:masterfrom
isaiahtaylor wants to merge 7 commits intompetazzoni:masterfrom
Conversation
mpetazzoni
requested changes
Jul 26, 2018
README.rst
Outdated
|
|
||
| pTFTPd TFTP client can also be imported and used within a Python script. | ||
|
|
||
| ```from ptftpd import tftpclient |
Owner
There was a problem hiding this comment.
This is not how reStructuredText work for code blocks. See below in the "Installation" section for an example.
mpetazzoni
requested changes
Jul 26, 2018
| print() | ||
|
|
||
| def client(host=_PTFTP_DEFAULT_HOST, port=_PTFTP_DEFAULT_PORT, | ||
| mode=_PTFTP_DEFAULT_MODE, exts={}, rfc1350=False): |
|
|
||
| from ptftpd import tftpclient | ||
|
|
||
| client = tftpclient.client(host='tftpsite.com', exts={'windowsize': 4}) |
| self.__get_speed(self.PTFTP_STATE.filesize, | ||
| transfer_time))) | ||
| .format(self.PTFTP_STATE.filesize, transfer_speed)) | ||
| self.PTFTP_STATE.file.close() |
Owner
There was a problem hiding this comment.
While you're in there, would you mind moving this and the line below (the close and the remove) in a finally block of the try/except above (line 567)?
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Client Usable as a Library
Allows the ptftpd client tool to be imported as a library and integrated into other Python libraries.
Usage