Browse Source

Minor tweaks in request_handler

Yentl Van Tendeloo 7 years ago
parent
commit
84f1693146
2 changed files with 6 additions and 7 deletions
  1. 5 6
      kernel/modelverse_kernel/request_handler.py
  2. 1 1
      wrappers/modelverse_SCCD.py

+ 5 - 6
kernel/modelverse_kernel/request_handler.py

@@ -49,10 +49,11 @@ class RequestHandler(object):
         # Append the server's replies to the list of replies.
         # Append the server's replies to the list of replies.
         if reply is not None:
         if reply is not None:
             gen = self.generator_stack[-1]
             gen = self.generator_stack[-1]
-            if gen["replies"] is None:
-                gen["replies"] = reply
-            else:
+
+            if gen["replies"]:
                 gen["replies"].extend(reply)
                 gen["replies"].extend(reply)
+            else:
+                gen["replies"] = reply
 
 
         while 1:
         while 1:
             # Silence pylint's warning about catching Exception.
             # Silence pylint's warning about catching Exception.
@@ -113,9 +114,7 @@ class RequestHandler(object):
         if requests:
         if requests:
             if requests[0][0] in self.handlers:
             if requests[0][0] in self.handlers:
                 # First element is a known request
                 # First element is a known request
-                #elem = requests.pop(0)
-                elem = requests[0]
-                del requests[0]
+                elem = requests.pop(0)
 
 
                 # The list of requests might be empty now. If so, then flag this
                 # The list of requests might be empty now. If so, then flag this
                 # batch of requests as finished.
                 # batch of requests as finished.

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Tue Apr 24 13:24:04 2018
+Date:   Tue Apr 24 13:37:14 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server