Deprecated use of old casting system to push use of Liquid formatting (ok just in betagit status)
This commit is contained in:
+39
-17
@@ -1147,6 +1147,11 @@ class AppBase:
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
return data, False
|
return data, False
|
||||||
|
|
||||||
|
# Because liquid can handle ALL of this now.
|
||||||
|
# Implemented for >0.9.25
|
||||||
|
self.logger.info("[DEBUG] Skipping parser because use of its been deprecated >0.9.25 due to Liquid implementation")
|
||||||
|
return data, False
|
||||||
|
|
||||||
wrappers = ["int", "number", "lower", "upper", "trim", "strip", "split", "parse", "len", "length", "lenght", "join", "replace"]
|
wrappers = ["int", "number", "lower", "upper", "trim", "strip", "split", "parse", "len", "length", "lenght", "join", "replace"]
|
||||||
|
|
||||||
if not any(wrapper in data for wrapper in wrappers):
|
if not any(wrapper in data for wrapper in wrappers):
|
||||||
@@ -1219,7 +1224,7 @@ class AppBase:
|
|||||||
|
|
||||||
if isinstance(data, str) and len(data) > 4:
|
if isinstance(data, str) and len(data) > 4:
|
||||||
if (data[0] == "{" or data[0] == "[") and (data[len(data)-1] == "]" or data[len(data)-1] == "}"):
|
if (data[0] == "{" or data[0] == "[") and (data[len(data)-1] == "]" or data[len(data)-1] == "}"):
|
||||||
self.logger.info("Skipping parser because use of {[ and ]}")
|
self.logger.info("[DEBUG] Skipping parser because use of {[ and ]}")
|
||||||
return data
|
return data
|
||||||
|
|
||||||
newdata = []
|
newdata = []
|
||||||
@@ -1587,10 +1592,11 @@ class AppBase:
|
|||||||
|
|
||||||
# Sending self as it's not a normal function
|
# Sending self as it's not a normal function
|
||||||
def parse_liquid(template, self):
|
def parse_liquid(template, self):
|
||||||
|
|
||||||
#self.logger.info("Inside liquid with glob: %s" % globals())
|
errors = False
|
||||||
|
error_msg = ""
|
||||||
try:
|
try:
|
||||||
if len(template) > 5000000:
|
if len(template) > 10000000:
|
||||||
self.logger.info("[DEBUG] Skipping liquid - size too big (%d)" % len(template))
|
self.logger.info("[DEBUG] Skipping liquid - size too big (%d)" % len(template))
|
||||||
return template
|
return template
|
||||||
|
|
||||||
@@ -1609,21 +1615,37 @@ class AppBase:
|
|||||||
# Can't handle self yet (?)
|
# Can't handle self yet (?)
|
||||||
ret = run.render(**globals())
|
ret = run.render(**globals())
|
||||||
return ret
|
return ret
|
||||||
#try:
|
|
||||||
#run = Liquid(template)
|
|
||||||
#return ret
|
|
||||||
#except liquid.exceptions.LiquidSyntaxError as e:
|
|
||||||
# run = Liquid(template, {'mode': 'python'})
|
|
||||||
# ret = run.render(**globals())
|
|
||||||
# return ret
|
|
||||||
#except liquid.exceptions.LiquidRenderError as e:
|
|
||||||
# self.logger.info("Render error: %s" % e)
|
|
||||||
except jinja2.exceptions.TemplateNotFound as e:
|
except jinja2.exceptions.TemplateNotFound as e:
|
||||||
self.logger.info("[ERROR] Template error: %s" % e)
|
self.logger.info(f"[ERROR] Liquid Template error: {e}")
|
||||||
|
error = True
|
||||||
|
error_msg = e
|
||||||
except jinja2.exceptions.TemplateSyntaxError as e:
|
except jinja2.exceptions.TemplateSyntaxError as e:
|
||||||
self.logger.info("[ERROR] Syntax error: %s" % e)
|
self.logger.info(f"[ERROR] Liquid Syntax error: {e}")
|
||||||
except:
|
error = True
|
||||||
self.logger.info("[ERROR] General exception for liquid")
|
error_msg = e
|
||||||
|
except Exception as e:
|
||||||
|
self.logger.info(f"[ERROR] General exception for liquid: {e}")
|
||||||
|
error = True
|
||||||
|
error_msg = e
|
||||||
|
|
||||||
|
if error == True:
|
||||||
|
self.action_result["status"] = "FAILURE"
|
||||||
|
data = {
|
||||||
|
"success": False,
|
||||||
|
"input": template,
|
||||||
|
"reason": f"Failed to parse LiquidPy: {error_msg}",
|
||||||
|
}
|
||||||
|
try:
|
||||||
|
self.action_result["result"] = json.dumps(data)
|
||||||
|
except Exception as e:
|
||||||
|
self.action_result["result"] = f"Failed to parse LiquidPy: {error_msg}"
|
||||||
|
print("[WARNING] Failed to set LiquidPy result")
|
||||||
|
|
||||||
|
self.action_result["completed_at"] = int(time.time())
|
||||||
|
self.send_result(self.action_result, headers, stream_path)
|
||||||
|
|
||||||
|
self.logger.info(f"[ERROR] Sent FAILURE response to backend due to : {e}")
|
||||||
|
os.exit()
|
||||||
|
|
||||||
return template
|
return template
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
### DEFAULT
|
### DEFAULT
|
||||||
NAME=shuffle-app_sdk
|
NAME=shuffle-app_sdk
|
||||||
VERSION=0.9.23
|
VERSION=0.9.25
|
||||||
|
|
||||||
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
|
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
|
||||||
docker build . -f Dockerfile -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION -t ghcr.io/frikky/$NAME:nightly
|
docker build . -f Dockerfile -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION -t ghcr.io/frikky/$NAME:nightly
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const data = [{
|
|||||||
'margin': '5px',
|
'margin': '5px',
|
||||||
'border-width': '1px',
|
'border-width': '1px',
|
||||||
'text-margin-x': '10px',
|
'text-margin-x': '10px',
|
||||||
|
'cursor': 'pointer',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -26,6 +27,7 @@ const data = [{
|
|||||||
'text-margin-y': '-15px',
|
'text-margin-y': '-15px',
|
||||||
'width': '5px',
|
'width': '5px',
|
||||||
"color": "white",
|
"color": "white",
|
||||||
|
'cursor': 'pointer',
|
||||||
"line-fill": "linear-gradient",
|
"line-fill": "linear-gradient",
|
||||||
"line-gradient-stop-positions": ["0.0", "100"],
|
"line-gradient-stop-positions": ["0.0", "100"],
|
||||||
"line-gradient-stop-colors": ["grey", "grey"],
|
"line-gradient-stop-colors": ["grey", "grey"],
|
||||||
|
|||||||
@@ -887,6 +887,8 @@ const AngularWorkflow = (props) => {
|
|||||||
//console.log(curworkflowTrigger)
|
//console.log(curworkflowTrigger)
|
||||||
|
|
||||||
newTriggers.push(curworkflowTrigger)
|
newTriggers.push(curworkflowTrigger)
|
||||||
|
} else {
|
||||||
|
alert.info("No handler for type: "+type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user