compiler.services.filemanager package

Integration with the filemanager service API.

The file management service is responsible for accepting and processing user uploads used for submissions. The core resource for the file management service is the upload “workspace”, which contains one or many files. We associate the workspace with a submission prior to finalization. The workspace URI is used for downpath processing, e.g. compilation.

A key requirement for this integration is the ability to pass uploads to the file management service as they are being received by this UI application.

class compiler.services.filemanager.Default[source]

Bases: dict

A more palatable dict for string formatting.

class compiler.services.filemanager.FileManager(verify=True, headers={})[source]

Bases: arxiv.integration.api.service.HTTPIntegration

Encapsulates a connection with the file management service.

class Meta[source]

Bases: object

Configuration for FileManagementService.

service_name = 'filemanager'
get_source_content(token, save_to='/tmp')[source]

Retrieve the sanitized/processed upload package.

Parameters
  • source_id (str) – Unique long-lived identifier for the upload.

  • save_to (str) – Directory into which source should be saved.

Returns

A read() -> bytes-able wrapper around response content.

Return type

SourcePackage

Return type

SourcePackage

get_upload_info(token)[source]

Get the current state of the source package/upload workspace.

Parameters

source_id (str) –

Returns

Return type

SourcePackageInfo

Return type

SourcePackageInfo

is_available()[source]

Check our connection to the filemanager service.

Return type

bool

owner(checksum, token)[source]

Get the owner of a source package.

Return type

Optional[str]