Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- job: copr_build
trigger: pull_request
targets:
- fedora-rawhide
- fedora-eln

- job: copr_build
Expand Down
10 changes: 4 additions & 6 deletions simpleline/event_loop/glib_event_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@

class GLibEventLoop(AbstractEventLoop):

def __init__(self):
def __init__(self, blocking=True):
super().__init__()
self._blocking = blocking
# Create first loop
loop = GLib.MainLoop()
self._event_loops = [EventLoopData(loop)]
Expand Down Expand Up @@ -208,12 +209,9 @@ def process_signals(self, return_after=None):
else:
self._iterate_event_loop(loop_data.loop)

@staticmethod
def _iterate_event_loop(event_loop):
Comment thread
KKoukiou marked this conversation as resolved.
def _iterate_event_loop(self, event_loop):
context = event_loop.get_context()
# This is useful for tests
wait_on_timeout = False
context.iteration(wait_on_timeout)
context.iteration(self._blocking)


class EventLoopData():
Expand Down
2 changes: 1 addition & 1 deletion tests/units/glib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _quit_loop(self, loop):
def create_glib_loop(self):
# clear flags
self.timeout_error = False
self.loop = GLibEventLoop()
self.loop = GLibEventLoop(blocking=False)

loop = self.loop.active_main_loop
context = loop.get_context()
Expand Down
Loading