Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6b822b0e3 | |||
| 239bc4b5b9 | |||
| 4eea15ddc1 | |||
| 204aa7466e |
@@ -3,6 +3,7 @@
|
||||
Provides mechanisms to execute any function,
|
||||
that conforms to the AutomateFunction "interface"
|
||||
"""
|
||||
|
||||
import json
|
||||
import sys
|
||||
import traceback
|
||||
@@ -65,7 +66,9 @@ def execute_automate_function(
|
||||
|
||||
|
||||
@overload
|
||||
def execute_automate_function(automate_function: AutomateFunctionWithoutInputs) -> None:
|
||||
def execute_automate_function(
|
||||
automate_function: AutomateFunctionWithoutInputs,
|
||||
) -> None:
|
||||
...
|
||||
|
||||
|
||||
@@ -127,10 +130,9 @@ def execute_automate_function(
|
||||
automate_function, # type: ignore
|
||||
)
|
||||
|
||||
exit_code = (
|
||||
0 if automation_context.run_status == AutomationStatus.SUCCEEDED else 1
|
||||
)
|
||||
exit(exit_code)
|
||||
# if we've gotten this far, the execution should technically be completed as expected
|
||||
# thus exiting with 0 is the schemantically correct thing to do
|
||||
exit(0)
|
||||
|
||||
else:
|
||||
raise NotImplementedError(f"Command: '{command}' is not supported.")
|
||||
|
||||
@@ -64,6 +64,8 @@ class SpeckleClient:
|
||||
host: str = DEFAULT_HOST,
|
||||
use_ssl: bool = USE_SSL,
|
||||
verify_certificate: bool = True,
|
||||
connection_retries: int = 3,
|
||||
connection_timeout: int = 10,
|
||||
) -> None:
|
||||
ws_protocol = "ws"
|
||||
http_protocol = "http"
|
||||
@@ -80,10 +82,15 @@ class SpeckleClient:
|
||||
self.ws_url = f"{ws_protocol}://{host}/graphql"
|
||||
self.account = Account()
|
||||
self.verify_certificate = verify_certificate
|
||||
self.connection_retries = connection_retries
|
||||
self.connection_timeout = connection_timeout
|
||||
|
||||
self.httpclient = Client(
|
||||
transport=RequestsHTTPTransport(
|
||||
url=self.graphql, verify=self.verify_certificate, retries=3
|
||||
url=self.graphql,
|
||||
verify=self.verify_certificate,
|
||||
retries=self.connection_retries,
|
||||
timeout=self.connection_timeout,
|
||||
)
|
||||
)
|
||||
self.wsclient = None
|
||||
|
||||
Reference in New Issue
Block a user