Skip to main content

An implementation of some functionalities of gobject/glib/gio in pure python, but adding a lot of new features.

Project description

pygel
=====

*pygel* is a pure-python event loop library that works on *Python 2.7+*, *Python 3.4+* and PyPy as well

*pygel* implements its own event loop library from scratch using [socketqueue](http://github.com/caetanus/socketqueue/)

it was initially based on pygtk2/gobject interfaces but has gained its own life and its own interfaces and the pygtk2/gobject is no longer supported anymore

it can interface with another event libraries as Qt4, Qt5, Gi(work in progress), pygtk2(work in progress)

in some level it mimicks single flow application in some methods as: *sleep*, *selector* and *@threaded_wrapper*

A more deatailed documentation is in progress.


Usage Example
---------------------


```python

"""
example using pygel
"""

import socket
from gel import Gel

reactor = Gel()
socket_server = socket.socket()
socket_server.bind(("", 12345))
socket_server.listen()
my_socket = socket.socket()
my_socket.connect(socket_server.getsockname())
connection, _ = socket_server.accept()

def application():
connection.send(b"some data")
reactor.sleep(2000)
print("sleeping doesn't stop the main_loop")

def on_socket_read(sock):
print("data received", sock.recv(1024))

def timeout():
print("i'm called after the timeout.")
reactor.main_quit()

reactor.register_io(my_socket)
reactor.idle_call(application)
reactor.timeout_call_seconds(3.0, timeout)
reactor.main()
```


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygel-0.6.4.tar.gz (13.8 kB view details)

Uploaded Source

File details

Details for the file pygel-0.6.4.tar.gz.

File metadata

  • Download URL: pygel-0.6.4.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygel-0.6.4.tar.gz
Algorithm Hash digest
SHA256 9c8792c427f8231af9e82c8cb068bf8857b07bf81dd8d6f18c2661947b82acc0
MD5 7ba9d5bd6e097c7cd6edc77c513cd518
BLAKE2b-256 cb82283c53ff00898fef4f95d79356990c922ca7c0d16c9d87f5791ce6a16384

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page