upsies.jobs.imagehost
Upload images to image hosting services
Classes
- class upsies.jobs.imagehost.ImagehostJob(*, home_directory=None, cache_directory=None, cache_id='', ignore_cache=False, no_output_is_ok=False, hidden=False, autostart=True, guaranteed=False, precondition=None, prejobs=(), callbacks={}, **kwargs)[source]
Bases:
JobBaseUpload images to an image hosting service
- cache_id = None
- initialize(*, imagehosts, image_paths=(), thumb_width=None, output_format=None)[source]
Validate arguments and set internal state
- Parameters:
First, image_paths are uploaded. If a Job named “screenshots” exists in
siblings, screenshots from that job are uploaded as well.
- async run()[source]
Do the work
This method is called by
start(). Its coroutine is passed toadd_task().Any keyword arguments passed to
initialize()are available viakwargs.The job
is_finishedwhen alladded tasksare done or cancelled. (See alsofinalize()andfinalization().)This method may call
add_task()if more tasks are required.
- property exit_code
0 if all images were uploaded, 1 otherwise, None if unfinished
- property uploaded_images
Sequence of
UploadedImageobjectsUse this property to get additional information like thumbnail URLs that are not part of this job’s
output.
- property urls_by_file
Map of image file paths to
UploadedImageinstances
- property images_uploaded
Number of uploaded images
- property images_total
Expected number of images to upload
- set_images_total(value)[source]
images_totalsetter as a method