Uploader Implementation

Uploader implementation. The code in here surrounds the uploaders’ implementations, and properly invokes the uploader with correct arguments, etc.

class dput.uploader.AbstractUploader(profile)

Abstract base class for all concrete uploader implementations.


Setup the things needed to upload a file. Usually this means creating a network connection & authenticating.


Disconnect and shutdown.

upload_file(filename, upload_filename=None)

Upload a single file (filename) to the server.



don’t call this.

please don’t call this

class dput.uploader.DputNamespace
dput.uploader.determine_logfile(changes, conf, args)

Figure out what logfile to write to. This is mostly an internal implementation. Returns the file to log to, given a changes and profile.

dput.uploader.invoke_dput(changes, args)


This method may change names. Please use it via dput.upload(). also, please don’t depend on args, that’s likely to change shortly.

Given a changes file changes, and arguments to dput args, upload a package to the archive that makes sense.

dput.uploader.uploader(uploader_method, profile, simulate=True)

Context-managed uploader implementation.

Invoke sorta like:

with uploader() as obj:

This will automatically call that object’s dput.uploader.AbstractUploader.initialize(), pre-hook, yield the object, call the post hook and invoke it’s dput.uploader.AbstractUploader.shutdown().