galaxie-eveloop


Namegalaxie-eveloop JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
SummaryGalaxie EveLoop is a low tech EventLoop, it contain minimalistic Bus and Loop
upload_time2024-06-12 09:52:55
maintainerNone
docs_urlNone
authorTuuux
requires_python>=3.0
licenseWTFPL
keywords galaxie mainloop bus
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://img.shields.io/badge/License-WTFPL-brightgreen.svg
   :target: http://www.wtfpl.net/about/
   :alt: License: WTFPL
.. image:: https://readthedocs.org/projects/galaxie-eveloop/badge/?version=latest
  :target: https://galaxie-eveloop.readthedocs.io/en/latest/?badge=latest
  :alt: Documentation Status

=============================
Galaxie EveLoop documentation
=============================
.. figure::  https://galaxie-curses.readthedocs.io/_images/logo_galaxie.png
   :align:   center

Description
-----------
Galaxie Event Loop is a low tech main loop couple with a event bus.

After many years as kernel of Galaxie Curses project, it have been as decision to extract the main loop and the event bus.
Especially that because it work and be very small.


Links
-----
 * Git: https://codeberg.org/Tuuux/galaxie-eveloop/
 * Read the Doc: https://galaxie-eveloop.readthedocs.io/
 * PyPI: https://pypi.org/project/galaxie-eveloop/
 * PuPI Test: https://test.pypi.org/project/galaxie-eveloop/

Installation via pip
--------------------
Pypi

.. code:: bash

  pip install galaxie-eveloop

Pypi Test

.. code:: bash

  pip install -i https://test.pypi.org/simple/ galaxie-eveloop

Example
-------

.. code:: python

  from glxeveloop import MainLoop
  from time import time

  count = 1
  mainloop = MainLoop().loop
  mainloop.timer.fps.min = 30
  mainloop.timer.fps.value = 60
  mainloop.timer.fps.max = 30
  start = time()


  def pre():
      global count
      global mainloop
      global start
      if count >= 30:
          mainloop.stop()


  def cmd():
      global count
      global mainloop

      print("COUNT: {0}, FPS: {1}".format(count, mainloop.timer.fps.value))


  def post():
      global count
      count += 1
      if count > 30:
          print("TIME: {0}".format((time() - start)))
          print("PRECISION: {0}".format(1 - (time() - start)))


  def main():
      mainloop.hooks.cmd = cmd
      mainloop.hooks.pre = pre
      mainloop.hooks.post = post

      mainloop.start()


  if __name__ == '__main__':
      main()

While return

.. code:: shell

  COUNT: 1, FPS: 60.0
  COUNT: 2, FPS: 60.0
  COUNT: 3, FPS: 30.0
  COUNT: 4, FPS: 30.0
  COUNT: 5, FPS: 30.0
  COUNT: 6, FPS: 30.0
  COUNT: 7, FPS: 30.0
  COUNT: 8, FPS: 30.0
  COUNT: 9, FPS: 30.0
  COUNT: 10, FPS: 30.0
  COUNT: 11, FPS: 30.0
  COUNT: 12, FPS: 30.0
  COUNT: 13, FPS: 30.0
  COUNT: 14, FPS: 30.0
  COUNT: 15, FPS: 30.0
  COUNT: 16, FPS: 30.0
  COUNT: 17, FPS: 30.0
  COUNT: 18, FPS: 30.0
  COUNT: 19, FPS: 30.0
  COUNT: 20, FPS: 30.0
  COUNT: 21, FPS: 30.0
  COUNT: 22, FPS: 30.0
  COUNT: 23, FPS: 30.0
  COUNT: 24, FPS: 30.0
  COUNT: 25, FPS: 30.0
  COUNT: 26, FPS: 30.0
  COUNT: 27, FPS: 30.0
  COUNT: 28, FPS: 30.0
  COUNT: 29, FPS: 30.0
  COUNT: 30, FPS: 30.0
  TIME: 0.9341855049133301
  PRECISION: 0.0657961368560791

It Take 2 iterations for the loop to slow FPS for match the 30 FPS ask by the setting.
The mainloop can impose a Frame Rate :)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "galaxie-eveloop",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": null,
    "keywords": "Galaxie, Mainloop, Bus",
    "author": "Tuuux",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/21/df/9233a3b428f20cbf5684521a8dfeb518240e3141d6532a5263f584f7d076/galaxie_eveloop-0.1.5.tar.gz",
    "platform": null,
    "description": ".. image:: https://img.shields.io/badge/License-WTFPL-brightgreen.svg\n   :target: http://www.wtfpl.net/about/\n   :alt: License: WTFPL\n.. image:: https://readthedocs.org/projects/galaxie-eveloop/badge/?version=latest\n  :target: https://galaxie-eveloop.readthedocs.io/en/latest/?badge=latest\n  :alt: Documentation Status\n\n=============================\nGalaxie EveLoop documentation\n=============================\n.. figure::  https://galaxie-curses.readthedocs.io/_images/logo_galaxie.png\n   :align:   center\n\nDescription\n-----------\nGalaxie Event Loop is a low tech main loop couple with a event bus.\n\nAfter many years as kernel of Galaxie Curses project, it have been as decision to extract the main loop and the event bus.\nEspecially that because it work and be very small.\n\n\nLinks\n-----\n * Git: https://codeberg.org/Tuuux/galaxie-eveloop/\n * Read the Doc: https://galaxie-eveloop.readthedocs.io/\n * PyPI: https://pypi.org/project/galaxie-eveloop/\n * PuPI Test: https://test.pypi.org/project/galaxie-eveloop/\n\nInstallation via pip\n--------------------\nPypi\n\n.. code:: bash\n\n  pip install galaxie-eveloop\n\nPypi Test\n\n.. code:: bash\n\n  pip install -i https://test.pypi.org/simple/ galaxie-eveloop\n\nExample\n-------\n\n.. code:: python\n\n  from glxeveloop import MainLoop\n  from time import time\n\n  count = 1\n  mainloop = MainLoop().loop\n  mainloop.timer.fps.min = 30\n  mainloop.timer.fps.value = 60\n  mainloop.timer.fps.max = 30\n  start = time()\n\n\n  def pre():\n      global count\n      global mainloop\n      global start\n      if count >= 30:\n          mainloop.stop()\n\n\n  def cmd():\n      global count\n      global mainloop\n\n      print(\"COUNT: {0}, FPS: {1}\".format(count, mainloop.timer.fps.value))\n\n\n  def post():\n      global count\n      count += 1\n      if count > 30:\n          print(\"TIME: {0}\".format((time() - start)))\n          print(\"PRECISION: {0}\".format(1 - (time() - start)))\n\n\n  def main():\n      mainloop.hooks.cmd = cmd\n      mainloop.hooks.pre = pre\n      mainloop.hooks.post = post\n\n      mainloop.start()\n\n\n  if __name__ == '__main__':\n      main()\n\nWhile return\n\n.. code:: shell\n\n  COUNT: 1, FPS: 60.0\n  COUNT: 2, FPS: 60.0\n  COUNT: 3, FPS: 30.0\n  COUNT: 4, FPS: 30.0\n  COUNT: 5, FPS: 30.0\n  COUNT: 6, FPS: 30.0\n  COUNT: 7, FPS: 30.0\n  COUNT: 8, FPS: 30.0\n  COUNT: 9, FPS: 30.0\n  COUNT: 10, FPS: 30.0\n  COUNT: 11, FPS: 30.0\n  COUNT: 12, FPS: 30.0\n  COUNT: 13, FPS: 30.0\n  COUNT: 14, FPS: 30.0\n  COUNT: 15, FPS: 30.0\n  COUNT: 16, FPS: 30.0\n  COUNT: 17, FPS: 30.0\n  COUNT: 18, FPS: 30.0\n  COUNT: 19, FPS: 30.0\n  COUNT: 20, FPS: 30.0\n  COUNT: 21, FPS: 30.0\n  COUNT: 22, FPS: 30.0\n  COUNT: 23, FPS: 30.0\n  COUNT: 24, FPS: 30.0\n  COUNT: 25, FPS: 30.0\n  COUNT: 26, FPS: 30.0\n  COUNT: 27, FPS: 30.0\n  COUNT: 28, FPS: 30.0\n  COUNT: 29, FPS: 30.0\n  COUNT: 30, FPS: 30.0\n  TIME: 0.9341855049133301\n  PRECISION: 0.0657961368560791\n\nIt Take 2 iterations for the loop to slow FPS for match the 30 FPS ask by the setting.\nThe mainloop can impose a Frame Rate :)\n",
    "bugtrack_url": null,
    "license": "WTFPL",
    "summary": "Galaxie EveLoop is a low tech EventLoop, it contain minimalistic Bus and Loop",
    "version": "0.1.5",
    "project_urls": {
        "Changelog": "https://codeberg.org/Tuuux/galaxie-eveloop/src/branch/master/CHANGELOG.rst",
        "Homepage": "https://codeberg.org/Tuuux/galaxie-eveloop",
        "Issues": "https://codeberg.org/Tuuux/galaxie-eveloop/issues",
        "Readthedocs": "http://galaxie-eveloop.readthedocs.io"
    },
    "split_keywords": [
        "galaxie",
        " mainloop",
        " bus"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21df9233a3b428f20cbf5684521a8dfeb518240e3141d6532a5263f584f7d076",
                "md5": "f95bfc9045c5f9bc59f6c4792b33f9cd",
                "sha256": "44bb1c7181b78ffd5efa18216e62bed94d38efc0434eb5277b8e81a574dff56d"
            },
            "downloads": -1,
            "filename": "galaxie_eveloop-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "f95bfc9045c5f9bc59f6c4792b33f9cd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 16350,
            "upload_time": "2024-06-12T09:52:55",
            "upload_time_iso_8601": "2024-06-12T09:52:55.729690Z",
            "url": "https://files.pythonhosted.org/packages/21/df/9233a3b428f20cbf5684521a8dfeb518240e3141d6532a5263f584f7d076/galaxie_eveloop-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-12 09:52:55",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": true,
    "codeberg_user": "Tuuux",
    "codeberg_project": "galaxie-eveloop",
    "lcname": "galaxie-eveloop"
}
        
Elapsed time: 1.65611s