changeset 3755:e14847bf65c0

tools (async_trigger): fix return value in `asyncReturnPoint` + typing hints
author Goffi <goffi@goffi.org>
date Fri, 13 May 2022 18:19:56 +0200 (2022-05-13)
parents af485e8afe03
children aa923e6b369f
files sat/tools/async_trigger.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat/tools/async_trigger.py	Fri May 13 18:02:37 2022 +0200
+++ b/sat/tools/async_trigger.py	Fri May 13 18:19:56 2022 +0200
@@ -19,6 +19,7 @@
 
 """Misc usefull classes"""
 
+from typing import Tuple, Any
 from . import trigger as sync_trigger
 from . import utils
 from twisted.internet import defer
@@ -53,10 +54,14 @@
                 break
         defer.returnValue(True)
 
-    async def asyncReturnPoint(self, point_name, *args, **kwargs):
+    async def asyncReturnPoint(
+        self,
+        point_name: str,
+        *args, **kwargs
+    ) -> Tuple[bool, Any]:
         """Async version of returnPoint"""
         if point_name not in self.__triggers:
-            return True
+            return True, None
 
         for priority, trigger in self.__triggers[point_name]:
             try: