compiler.domain module

Domain class for the compiler service.

class compiler.domain.Format[source]

Bases: enum.Enum

Compilation formats supported by this service.

DVI = 'dvi'
PDF = 'pdf'
PS = 'ps'
content_type

The mime-type for this format.

Return type

str

ext

Filename extension for the compilation product.

Return type

str

class compiler.domain.Product[source]

Bases: tuple

Content of a compilation product itself.

checksum

The B64-encoded MD5 hash of the compilation product.

stream

Readable buffer with the product content.

task

Status information about the product.

class compiler.domain.Reason[source]

Bases: enum.Enum

Specific reasons for a (usually failure) outcome.

AUTHORIZATION = 'auth_error'
CANCELLED = 'cancelled'
CORRUPTED = 'corrupted_source'
ERROR = 'compilation_errors'
MISSING = 'missing_source'
NETWORK = 'network_error'
NONE = None
SOURCE_TYPE = 'invalid_source_type'
STORAGE = 'storage'
class compiler.domain.SourcePackage[source]

Bases: tuple

Source package content, retrieved from file management service.

etag

Etag returned with the source package content; MD5 checksum.

path

Path to the retrieved source package.

source_id

The identifier of the source package (upload workspace).

class compiler.domain.SourcePackageInfo[source]

Bases: tuple

Current state of the source package in the file managment service.

etag

Alias for field number 1

source_id

Alias for field number 0

class compiler.domain.Status[source]

Bases: enum.Enum

Represents the status of a requested compilation.

COMPLETED = 'completed'
FAILED = 'failed'
IN_PROGRESS = 'in_progress'
class compiler.domain.Task[source]

Bases: tuple

Represents the state of a compilation product in the store.

checksum

Checksum of the source tarball from the file management service.

This is likely to be a checksum of some kind, but may be something else.

content_type

Mime type for the output format of this compilation.

Return type

str

description

A description of the outcome.

ext

Filename extension for the compilation product.

Return type

str

classmethod from_dict(data)[source]

Generate a Task instance from raw data.

Return type

Task

output_format

The target format of the compilation.

One of PDF, DVI, or PS.

owner

The owner of this resource.

reason

An explanation of the current status. E.g. why did it fail.

size_bytes

Size of the product.

source_id

Alias for field number 1

status

The status of the compilation.

If Status.COMPLETED, the current file corresponding to the format of this compilation status is the product of this compilation.

task_id

If a task exists for this compilation, the unique task ID.

to_dict()[source]

Generate a dict representation of this object.

Return type

dict