#1859 - Started giving the red agent some 'intelligence' and a sense of a state. Changed Application.run to .execute.
This commit is contained in:
@@ -65,6 +65,10 @@ class Application(IOSoftware):
|
||||
self.sys_log.info(f"Running Application {self.name}")
|
||||
self.operating_state = ApplicationOperatingState.RUNNING
|
||||
|
||||
def _application_loop(self):
|
||||
"""THe main application loop."""
|
||||
pass
|
||||
|
||||
def close(self) -> None:
|
||||
"""Close the Application."""
|
||||
if self.operating_state == ApplicationOperatingState.RUNNING:
|
||||
|
||||
@@ -128,11 +128,11 @@ class DatabaseClient(Application):
|
||||
)
|
||||
return self._query(sql=sql, query_id=query_id, is_reattempt=True)
|
||||
|
||||
def run(self) -> None:
|
||||
def execute(self) -> None:
|
||||
"""Run the DatabaseClient."""
|
||||
super().run()
|
||||
self.operating_state = ApplicationOperatingState.RUNNING
|
||||
self.connect()
|
||||
super().execute()
|
||||
if self.operating_state == ApplicationOperatingState.RUNNING:
|
||||
self.connect()
|
||||
|
||||
def query(self, sql: str) -> bool:
|
||||
"""
|
||||
|
||||
@@ -30,7 +30,7 @@ class WebBrowser(Application):
|
||||
kwargs["port"] = Port.HTTP
|
||||
|
||||
super().__init__(**kwargs)
|
||||
self.run()
|
||||
self.execute()
|
||||
|
||||
def describe_state(self) -> Dict:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user