omero.util.cleanse module

Reconcile and cleanse where necessary an OMERO data directory of orphaned data.

class util.cleanse.Cleanser(query_service, object_type)[source]

Bases: object

Keeps file cleansing state and performs OMERO database reconciliation of files within an OMERO binary repository.

PYRAMID_FILE = '_pyramid'
PYRAMID_LOCK = '.pyr_lock'
PYRAMID_TEMP = '.tmp'
QUERY_THRESHOLD = 25
cleanse(root)[source]

Begins a cleansing operation from a given OMERO binary repository root directory. /OMERO/Files or /OMERO/Pixels for instance.

do_cleanse()[source]

Actually performs the reconciliation check against OMERO and removes relevant files.

finalize()[source]

Takes the final set of deferred paths and performs a reconciliation check against OMERO for them. This method’s purpose is basically to catch the final set of paths in the deferred path list and/or perform any cleanup.

query_or_defer(path)[source]

Adds a given path to the list of deferred paths. If the number of deferred paths has reached the QUERY_THRESHOLD (to reduce database hits) a reconciliation check will happen against OMERO.

util.cleanse.cleanse(data_dir, client, dry_run=False)[source]
util.cleanse.delete_empty_dirs(repo, root, client, dry_run)[source]
util.cleanse.fixpyramids(data_dir, query_service, dry_run=False, config_service=None, admin_service=None)[source]
util.cleanse.initial_check(config_service, admin_service=None)[source]
util.cleanse.is_empty_dir(repo, directory, may_delete_dir, to_delete)[source]
util.cleanse.main()[source]

Default main() that performs OMERO data directory cleansing.

util.cleanse.removepyramids(client, little_endian=None, dry_run=False, imported_after=None, wait=25, limit=500)[source]
util.cleanse.usage(error)[source]

Prints usage so that we don’t have to. :)