omero.plugins.tag module

Tag plugin for command-line tag manipulation

class plugins.tag.Tag(tag_id=None, name=None, description=None, owner=None, children=None)[source]

Bases: object

class plugins.tag.TagCollection[source]

Bases: object

class plugins.tag.TagControl(*args: Any, **kwargs: Any)[source]

Bases: BaseControl

add_newtag_params(parser)[source]
add_standard_params(parser)[source]
add_tag_common_params(parser)[source]
create(args)[source]

create a tag command.

create_tag(name, description, text='tag')[source]

Creates a new tag object. Returns the new tag object.

If name parameter is None, the user will be prompted to input it.

The “text” parameter should be the text description to use upon user input. For example, if we were creating a tag, this would be “tag” (the default). If we were creating a tagset, this could be “tag set”.

createset(args)[source]

Create a tag set command.

determine_console_size()[source]

Will attempt to determine console size based upon the current platform.

Returns tuple of width and length.

generate_empties(empties, args)[source]

Given a list of empty tagsets, return a list of lines representing the empty tagset output.

generate_orphans(orphans, args)[source]

Given a list of orphaned tags, return a list of lines representing the orphan output.

generate_tagset(tags, mapping, args)[source]

Given a dict of tags and mappings for parent/child relationships return a list of lines representing the tagset output.

Links an object to a tag annotation.

list(args)[source]

List tags command.

list_tags(args, tagset=None)[source]

Returns a TagCollection object

list_tags_recursive(args, tagset=None)[source]

Returns a TagCollection object

list_tagsets(args, tag)[source]

Returns a TagCollection of just the tagsets.

If tag is provided, will return the tagsets with those tags.

listsets(args)[source]

List tag sets command.

load(args)[source]

Import new tag(s) from json.

pagetext(lines)[source]
pagetext_format(format, elements)[source]
print_line(line, index)[source]
plugins.tag.clip(s, width)[source]

Given a string, s, and a width, will clip the string to that width or fill it with spaces up to that width.

Returns modified string

plugins.tag.exec_command(cmd)[source]

given a command, will execute it in the parent environment Returns a list containing the output