CleverSwarm API invocation example
This commit is contained in:
@@ -17,6 +17,11 @@ class AMQRouteFactory:
|
||||
|
||||
@staticmethod
|
||||
def from_string(data):
|
||||
"""
|
||||
Builds the AMQRoute from its string form.
|
||||
:param data: route string
|
||||
:return: AMQRoute object
|
||||
"""
|
||||
try:
|
||||
keys = data.split(RS)
|
||||
if len(keys) >= 5:
|
||||
@@ -55,6 +60,11 @@ class AMQRouteFactory:
|
||||
|
||||
@staticmethod
|
||||
def validate(route_str):
|
||||
"""
|
||||
Validates the route string.
|
||||
:param route_str: route string
|
||||
:return: boolean validity indicator
|
||||
"""
|
||||
if route_str is not None:
|
||||
return route_str.count(":") > 4
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user