ryvencore.Base module - ryvencore v0.1.0 documentation

Hide navigation sidebar
Hide table of contents sidebar
Toggle table of contents sidebar

# ryvencore.Base module

complete_data(data: dict) → dict

  Default implementation for completing data with frontend properties. When running with a frontend that needs to store additional information about components (e.g. current position and color of a node), this frontend then overrode this exact function to add whatever is necessary for adding this data.

class Event(*args)

  Bases: `object`

  connect(callback)
  disconnect(callback)
  emit(*args)

class Base

  Bases: `object`

  Base class for all abstract components. Provides functionality for ID counting. Assigns a global ID to every object and provides an optional custom ID counter for additional custom counting.

  class IDCtr

    Bases: `object`

    count()

      increases the counter and returns the new count. first time is 0

    set_count(cnt)
  global_id_ctr = <ryvencore.Base.Base.IDCtr object>
  id_ctr = None
  events = {}
  complete_data_function()
  data() → dict

    converts the object to a JSON compatible dict for serialization

  complete_data(data: dict) → ryvencore.Base.Base.data
  on(ev: ryvencore.Base.Event, callback)
  off(ev: ryvencore.Base.Event, callback)