Commit 9806f701 authored by Benjamin Graillot's avatar Benjamin Graillot

Ajout source.py

parent 30d587ba
import json
import threading
import config
class Source:
def __init__(self, name, address=None, args=(), kwargs={}):
self.name = name.casefold()
self.address = address.casefold()
self.thread = threading.Thread(target=self.loop, args=args, kwargs=kwargs)
self.thread.start()
def push_update(self, page, message):
with open(config.socket_path, 'w') as fifo:
fifo.write(json.dumps({'source': self.name, 'page': page, 'message': message}, separators=(',', ':')))
def loop(self, *args, **kwargs):
return
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment