diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-05-16 17:22:22 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-05-16 17:22:22 +0200 |
commit | 0bc4a3fa66423268ce17b57af8a5b1775dbb8a9a (patch) | |
tree | 75bd8329f91d1d2a69a52a37b2ad66ddae504403 /src/bus.py | |
parent | update dist (diff) | |
download | python-bus-0bc4a3fa66423268ce17b57af8a5b1775dbb8a9a.tar.gz python-bus-0bc4a3fa66423268ce17b57af8a5b1775dbb8a9a.tar.bz2 python-bus-0bc4a3fa66423268ce17b57af8a5b1775dbb8a9a.tar.xz |
update bus.write
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/bus.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -55,6 +55,12 @@ class Bus: Fail if interrupted ''' + NOWAIT = 1 + ''' + Function shall fail with errno set to `EAGAIN` + if the it would block and this flag is used + ''' + def __init__(self, pathname : str = None): ''' @@ -131,14 +137,16 @@ class Bus: self.bus = None - def write(self, message : str): + def write(self, message : str, flags : int = 0): ''' Broadcast a message a bus @param message:str The message to write, may not be longer than 2047 bytes after UTF-8 encoding + @param flags:int `Bus.NOWAIT` if the function shall fail if there is another process attempting + to broadcast on the bus ''' from native_bus import bus_write_wrapped - if bus_write_wrapped(self.bus, message) == -1: + if bus_write_wrapped(self.bus, message, flags) == -1: raise self.__oserror() |