EmbASP-Python
desktop_handler.py
1 from base.handler import Handler
2 
3 
5  """Handler specialization for desktop platforms."""
6 
7  def __init__(self, service):
8  super(DesktopHandler, self).__init__()
9  self.__service = service
10 
11  def start_async(self, c, program_index=None, option_index=None):
12  """Specialization of superclass start_async method.
13 
14  Starts ASP solving asynchronously a subset of data and
15  options for a desktop platform.
16  """
17  input_programs = self._collect_programs(program_index)
18  input_options = self._collect_options(option_index)
19  self.__service.start_async(c, input_programs, input_options)
20 
21  def start_sync(self, program_index=None, option_index=None):
22  """Specialization of superclass start_sync method.
23 
24  Starts ASP solving synchronously a subset of data and options
25  for a desktop platform.
26  """
27  input_programs = self._collect_programs(program_index)
28  input_options = self._collect_options(option_index)
29  return self.__service.start_sync(input_programs, input_options)
base.handler.Handler
Definition: handler.py:4
base.handler.Handler._collect_programs
def _collect_programs(self, program_index)
Definition: handler.py:56
platforms.desktop.desktop_handler.DesktopHandler.start_sync
def start_sync(self, program_index=None, option_index=None)
Definition: desktop_handler.py:21
platforms.desktop.desktop_handler.DesktopHandler.start_async
def start_async(self, c, program_index=None, option_index=None)
Definition: desktop_handler.py:11
platforms.desktop.desktop_handler.DesktopHandler.__service
__service
Definition: desktop_handler.py:9
base.handler.Handler._collect_options
def _collect_options(self, option_index)
Definition: handler.py:40
base.handler
Definition: handler.py:1
platforms.desktop.desktop_handler.DesktopHandler
Definition: desktop_handler.py:4