evennia.help.manager

Custom manager for HelpEntry objects.

class evennia.help.manager.HelpEntryManager(*args, **kwargs)[source]

Bases: evennia.typeclasses.managers.TypedObjectManager

This HelpEntryManager implements methods for searching and manipulating HelpEntries directly from the database.

These methods will all return database objects (or QuerySets) directly.

Evennia-specific: find_topicmatch find_apropos find_topicsuggestions find_topics_with_category all_to_category search_help (equivalent to evennia.search_helpentry)

find_topicmatch(topicstr, exact=False)[source]

Searches for matching topics or aliases based on player’s input.

Parameters
  • topcistr (str) – Help topic to search for.

  • exact (bool, optional) – Require exact match (non-case-sensitive). If False (default), match sub-parts of the string.

Returns

matches (HelpEntries) – Query results.

find_apropos(topicstr)[source]

Do a very loose search, returning all help entries containing the search criterion in their titles.

Parameters

topicstr (str) – Search criterion.

Returns

matches (HelpEntries) – Query results.

find_topicsuggestions(topicstr)[source]

Do a fuzzy match, preferably within the category of the current topic.

Parameters

topicstr (str) – Search criterion.

Returns

matches (Helpentries) – Query results.

find_topics_with_category(help_category)[source]

Search topics having a particular category.

Parameters

help_category (str) – Category query criterion.

Returns

matches (HelpEntries) – Query results.

get_all_topics()[source]

Get all topics.

Returns

all (HelpEntries) – All topics.

get_all_categories()[source]

Return all defined category names with at least one topic in them.

Returns

matches (list)

Unique list of category names across all

topics.

all_to_category(default_category)[source]

Shifts all help entries in database to default_category. This action cannot be reverted. It is used primarily by the engine when importing a default help database, making sure this ends up in one easily separated category.

Parameters

default_category (str) – Category to move entries to.

search_help(ostring, help_category=None)[source]

Retrieve a search entry object.

Parameters
  • ostring (str) – The help topic to look for.

  • category (str) – Limit the search to a particular help topic

Returns

Queryset – An iterable with 0, 1 or more matches.

create_help(key, entrytext, category='General', locks=None, aliases=None, tags=None)[source]

Create a static help entry in the help database. Note that Command help entries are dynamic and directly taken from the __doc__ entries of the command. The database-stored help entries are intended for more general help on the game, more extensive info, in-game setting information and so on.

Parameters
  • key (str) – The name of the help entry.

  • entrytext (str) – The body of te help entry

  • category (str, optional) – The help category of the entry.

  • locks (str, optional) – A lockstring to restrict access.

  • aliases (list of str, optional) – List of alternative (likely shorter) keynames.

  • tags (lst, optional) – List of tags or tuples (tag, category).

Returns

help (HelpEntry) – A newly created help entry.