13.2.5. CatalogItem class¶
-
class
keypirinha.CatalogItem¶ A
CatalogItemobject must always be created withPlugin.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
ItemCategoryof 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
ItemHitHintof this item.
-
args_hint()¶ Get the
ItemArgsHintof this item.See also
-
accepts_args()¶ Returns
self.args_hint() != keypirinha.ItemArgsHint.FORBIDDEN.Note
If the result is
True, this object might alsorequires_args().See also
-
requires_args()¶ Returns
self.args_hint() != keypirinha.ItemArgsHint.REQUIREDSee also
-
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(content)¶ Change the content (string) of the data bag of this item.
See also
-
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 thanraw_args().See also
-
clone()¶ Returns a newly-created clone of this object.
-