pilot_drive.services.updater package

Submodules

pilot_drive.services.updater.constants module

The constants of the PILOT Drive Updater

class pilot_drive.services.updater.constants.PipRegex(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

ReGex enum for pip outputs

NETWORK_ERROR_REGEX = "Failed to establish a new connection: \\[Errno -3\\] Temporary failure in name resolution'\\)"
PACKAGE_ERROR_REGEX = 'ERROR: No matching distribution found for'
PIP_UPDATE_REGEX = '^\\\\n\\[notice\\] A new release of pip is available: \\d{1,3}\\.\\d{1,3}\\.\\d{1,3} -> \\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\\\n\\[notice\\] To update, run: python3 -m pip install --upgrade pip\\\\n$'
class pilot_drive.services.updater.constants.UpdateCommands(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

The update commands that the UI sends to update

CHECK = 'check'
UPDATE = 'update'

pilot_drive.services.updater.updater module

Module doing the managing of the PILOT Drive settings

exception pilot_drive.services.updater.updater.JsonPullFailedException

Bases: Exception

Exception raised when a PYPI JSON pull fails

class pilot_drive.services.updater.updater.Updater(master_event_queue: MasterEventQueue, service_type: EventType, logger: MasterLogger, settings: Settings)

Bases: AbstractService

The service that manages the settings of PILOT Drive, both web and overarching app wise.

get_json() dict

Pull the PyPi JSON info on PILOT Drive

Raises:

requests.exceptions.HTTPError if an invalid HTTP status is presented

Raises:

requests.exceptions.ConnectionError if a network error occurs

Raises:

requests.exceptions.Timeout if the request times out

handler(command)

Method used to handle incoming update commands

Parameters:

command – the incoming comand to be handled

main() None
The main updater method, checks if an update was previous preformed,

pushes an event if so, then returns

refresh() None

Add any stored events back to the event queue, as this will be called in a client refresh.

update_pilot(version: str)

Update PILOT Drive to a specific version

Parameters:

version – the version to upgrade to

Module contents

The module that handles the updating functionality of PILOT Drive