Documentation for pdfebc-web

factory

Factory module for pdfebc-web.

pdfebc_web.factory.create_app()[source]

Instantiate the pdfebc-web app.

Returns:A Flask application.
Return type:Flask

startapp

Module for starting up the pdfebc-web application.

main.views

This module contains all views for the main blueprint.

pdfebc_web.main.views.construct_blueprint(celery)[source]

Construct the main blueprint.

Parameters:celery (Celery) – A Celery instance.
Returns:A Flask Blueprint.
Return type:Blueprint

main.forms

Module containing forms for use pdfebc-web.

class pdfebc_web.main.forms.CompressFilesForm(formdata=<object object>, **kwargs)[source]

A form for compressing uploaded files.

class pdfebc_web.main.forms.FileUploadForm(formdata=<object object>, **kwargs)[source]

A form for uploading a single PDF file.

util.file

This module contains functions for manipulating the file system.

exception pdfebc_web.util.file.ArchivingError[source]

An error to be thrown something goes wrong when archiving a directory.

pdfebc_web.util.file.compress_uploaded_files(src_dir, gs_binary, status_callback=None)[source]

Compress the pdf files in the given source directory and place them in a subdirectory.

Parameters:src_dir (str) – Path to the source directory.
Returns:Paths to the compressed files.
Return type:List[str]
pdfebc_web.util.file.compress_uploaded_files_to_tgz(src_dir, gs_binary, status_callback=None)[source]

Compress the files in src_dir and place in a comrpessed tarball.

Parameters:src_dir (str) – Path to the source directory.
Returns:Path to a tarball with the compressed files.
Return type:str
pdfebc_web.util.file.create_session_upload_dir(session_id)[source]

Create an upload directory for the session.

Parameters:session_id (str) – The id for the session.
pdfebc_web.util.file.delete_session_upload_dir(session_id)[source]

Remove all files in the session upload directory.

Parameters:session_id (str) – Id of the session.
pdfebc_web.util.file.get_session_upload_dir_path(session_id)[source]

Return the path to the session upload directory

Parameters:session_id (str) – The id for the session.
pdfebc_web.util.file.make_tarfile(src_dir, out)[source]

Make a tar archive from the src_dir.

Parameters:
  • src_dir (str) – Path to the source directory.
  • out – Path to the output file.
Returns:

Path to the tarball.

Return type:

str

Raises:

ArchivingError

pdfebc_web.util.file.session_upload_dir_exists(session_id)[source]

Check if the session upload directory exists.

Parameters:session_id (str) – The id for the session.
pdfebc_web.util.file.tarball_in_session_upload_dir(session_id)[source]

Check if there is a tarball in the session upload directory.

Ags:
session_id (str): Id of the session.