13.2.5. CatalogItem class

class keypirinha.CatalogItem

A CatalogItem object must always be created with Plugin.create_item().

valid()

Roughly validates item’s properties. Returns a boolean.

id()

Get the id (int) of the parent plugin of this object.

category()

Get the ItemCategory of this item.

label()

Get the label of this item.

set_label(label)

Change the label (string) of this item.

short_desc()

Get the short description of this item.

set_short_desc(short_desc)

Change the short description (string) of this item.

target()

Get the target (string) of this item.

hit_hint()

Get the ItemHitHint of this item.

args_hint()

Get the ItemArgsHint of this item.

accepts_args()

Returns self.args_hint() != keypirinha.ItemArgsHint.FORBIDDEN.

Note

If the result is True, this object might also requires_args().

requires_args()

Returns self.args_hint() != keypirinha.ItemArgsHint.REQUIRED

loop_on_suggest()

Returns the loop_on_suggest flag value.

Todo

Explain the loop_on_suggest concept.

set_loop_on_suggest(loop_on_suggest)

Change the value of the loop_on_suggest flag (bool).

Todo

Explain the loop_on_suggest concept.

data_bag()

Returns the content (string) of the data bag of this item.

See also

set_data_bag()

set_data_bag(content)

Change the content (string) of the data bag of this item.

See also

data_bag()

raw_args()

Returns the raw arguments (string).

displayed_args()

Returns the displayed arguments. Might be the same than the raw arguments. The returned value is never empty if the result of raw_args() is not empty.

set_args(raw_args, displayed_args='')

Change the arguments of this item.

The raw_args are the actual arguments of this item.

Sometimes a plugin needs to store arguments that are not human friendly to read. For that purpose, it is possible to apply a display name on these arguments (displayed_args) so the end-user can still differentiate two items with the same target in the results list.

If the displayed_args argument is left empty, displayed_args() will always return the same value than raw_args().

clone()

Returns a newly-created clone of this object.