Skip to main content
License: WTFPL Documentation Status

Galaxie EveLoop documentation

https://galaxie-curses.readthedocs.io/_images/logo_galaxie.png

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.

Installation via pip

Pypi

pip install galaxie-eveloop

Pypi Test

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

Example

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

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 :)

Metadata

Release files for galaxie-eveloop 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for galaxie-eveloop 0.1.5
File Size Uploaded Provenance Actions
galaxie_eveloop-0.1.5.tar.gz 16.4 kB Without provenance Details for galaxie_eveloop-0.1.5.tar.gz

Release files / galaxie_eveloop-0.1.5.tar.gz

Download URL galaxie_eveloop-0.1.5.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
44bb1c7181b78ffd5efa18216e62bed94d38efc0434eb5277b8e81a574dff56d
BLAKE2b-256 checksum
How to use checksums
21df9233a3b428f20cbf5684521a8dfeb518240e3141d6532a5263f584f7d076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.2

Security for galaxie-eveloop 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page