PublishHistoryStorage#

class stixcore.processing.publish.PublishHistoryStorage(filename)[source]#

Bases: object

Persistent handler for meta data on already published files.

Methods Summary

add(path)

Adds a new file to the history.

close()

Close the IDB connection.

count()

Counts the number of entries in the DB

find_by_esa_name(esa_name)

Finds all history entries based on the the ESA name (not unique).

find_by_name(name)

Finds a history entry based on the file name (unique constraint).

get_all()

Queries all entries

is_connected()

Is the handler connected to the db file.

set_modified_esa_name(name, id)

Updates the modified ESA file name of an entry.

set_result(result, id)

Sets the result of a publishing action for a given file.

Methods Documentation

add(path)[source]#

Adds a new file to the history.

Parameters:

path (path like object) – path to the FITS file to be published

Returns:

(PublishConflicts, list) – PublishConflicts with already published files and a list of all “conflicting files” including the newly added files as last entry.

close()[source]#

Close the IDB connection.

count()[source]#

Counts the number of entries in the DB

Returns:

int – number of tracked files

find_by_esa_name(esa_name)[source]#

Finds all history entries based on the the ESA name (not unique).

Parameters:

esa_name (str) – the truncated ESA file name of the fits file

Returns:

list – list of all found files with the same ESA file name

find_by_name(name)[source]#

Finds a history entry based on the file name (unique constraint).

Parameters:

name (str) – the file name

Returns:

hash – the history entry

get_all()[source]#

Queries all entries

Returns:

list – all found entries.

is_connected()[source]#

Is the handler connected to the db file.

Returns:

True | False

set_modified_esa_name(name, id)[source]#

Updates the modified ESA file name of an entry.

Parameters:
  • name (str) – the new modified esa name

  • id (int) – the id of the entry to update

Returns:

hash – the update result

set_result(result, id)[source]#

Sets the result of a publishing action for a given file.

Parameters:
  • result (PublishResult) – the result

  • id (int) – the id of the entry to update

Returns:

hash – the update result