PykeBot2.backend package

Subpackages

Submodules

PykeBot2.backend.backend_master module

Main Backend Module, responsible for calling stalker functions for query data or calling the database interface. When finished sets the payload field of the query with data object.

author

Jonathan Decker

async PykeBot2.backend.backend_master.backend_loop(forward_queue: asyncio.queues.Queue, backend_queue: asyncio.queues.Queue)
Description

Main Coroutine for the backend. Responsible for calling stalker functions.

Parameters
  • forward_queue (asyncio.Queue) – The Queue which is handled by the forwarder of the main event loop.

  • backend_queue (asyncio.Queue) – The Queue that is handled by this Coroutine.

Returns

None

Return type

None

async PykeBot2.backend.backend_master.call_rank_stalker(payload: PykeBot2.models.data_models.Payload, use_api=False)
Description

Checks the payload type and calls the correct rank stalker.

Parameters
  • payload (Payload) – The Payload object returned from stalking. Submitting Error, Message or Player will cause an error.

  • use_api (Bool) – If set to true, will try to use the Riot api to fetch ranks instead of op.gg.

Returns

None

Return type

None

PykeBot2.backend.backend_master.create_error(query: PykeBot2.models.query.Query, content: str)
Description

Creates an error message from the content and adds it to the query,

further sets query forward to to frontend and next step to format. :param query: The handled query, which encountered an error. :type query: Query :param content: The error message to be displayed, should usually include str(query). :type content: str :return: None :rtype: None

PykeBot2.backend.backend_master.determine_stalker(query: PykeBot2.models.query.Query)
Description

Checks the url for keywords to determine the correct stalker.

Parameters

query (Query) – The handled Query.

Returns

The stalker function fitting the url.

Return type

function (coroutine)

PykeBot2.backend.backend_master.logger = <Logger pb_logger (WARNING)>

Helper dictionaries used to map identifier in the url to stalker functions.

Module contents