Skip to main content

Implementation of classes and functions for working with files via tftp.

Project description

uc_tftp

Implementation of classes and functions for working with files via tftp.

It is part of the Unicon project.

https://unicon.10k.me

Usage:

Install
pip install --user uc-tftp
and use
from uc_tftp import TFTPReceiver

Examples:

as iterator

receiver = TFTPReceiver(timeout=3)  
for data in receiver:  
	print(data)  

as function

receiver = TFTPReceiver(timeout=3)  
receiver.recvto("/path/to/destination")  

with filename

receiver = TFTPReceiver(timeout=3)  
receiver.open()  
with open(receiver.filename, "w") as file:  
    for block in receiver:  
        file.write(block)  

Exceptions

May raise exceptions in the following cases:

NoWRQPacket

If the connected client tried to perform a non-WRQ operation (data recording).

NoIncomingConnection

If there were no connections in the allotted time.

ErrorReceived

If error packet was received from client.

UnexpectedOpcode

If an unexpected opcode is received during data transfer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uc_tftp-0.0.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

uc_tftp-0.0.1-py3-none-any.whl (15.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page