Commit 101003e8 authored by Ivan Tyagov's avatar Ivan Tyagov

Factorize.

parent 757dc723
......@@ -30,7 +30,7 @@ port = args.port
xml = args.xml
erp5_ip = args.erp5_ip
erp5_port = args.erp5_port
ERP5_REQUEST_API = "ERP5Site_handleOPCUARequest"
@dataclass(frozen=True)
class ERP5Handler(asyncua.common.subscription.SubHandler):
......@@ -40,7 +40,7 @@ class ERP5Handler(asyncua.common.subscription.SubHandler):
@property
def uri(self):
return f"http://{self.ip}:{self.port}/erp5/opcua_test"
return f"http://{self.ip}:{self.port}/erp5/%s" %ERP5_REQUEST_API
def call(self, **data):
params = urllib.parse.quote_plus(json.dumps({k: str(v) for k, v in data.items()}))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment