Skip to content

Commit d5a83aa

Browse files
committed
hal_glib -add a function to run the gobject mainloop once
so GUIs not basd in gobject can run the message system
1 parent 7b3fe28 commit d5a83aa

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/python/common/hal_glib.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,11 @@ def __init__(self, stat = None):
352352
def set_timer(self):
353353
GLib.timeout_add(CYCLE_TIME, self.update)
354354

355+
# used to run the Gobject mainloop once
356+
# allows a GUI that is not GLib based to update the mainloop
357+
def run_iteration(self):
358+
GLib.MainContext.default().iteration (True)
359+
355360
# open a zmq socket for writing out data
356361
def init_write_socket(self):
357362
context = zmq.Context()
@@ -362,6 +367,7 @@ def init_write_socket(self):
362367
self.write_available = True
363368
except Exception as e:
364369
LOG.debug('hal_glib write socket not available: {}'.format(e))
370+
LOG.debug('hal_glib write socket not available\n {}'.format(e))
365371
self.write_available = False
366372

367373
# convert and actually send out the message

0 commit comments

Comments
 (0)