BUG: Minor app sdk and build fixes

This commit is contained in:
frikky
2021-03-04 17:06:25 +01:00
parent 62e7fa09d8
commit f88d88ba9e
3 changed files with 21 additions and 12 deletions
+11 -9
View File
@@ -391,7 +391,8 @@ class AppBase:
print("Ret length: %d" % len(ret)) print("Ret length: %d" % len(ret))
if len(ret) == 1: if len(ret) == 1:
ret = ret[0] #ret = ret[0]
print("DONT make list of 1 into 0!!")
print("Return from execution: %s" % ret) print("Return from execution: %s" % ret)
if ret == None: if ret == None:
@@ -418,7 +419,8 @@ class AppBase:
results.append(ret) results.append(ret)
if len(results) == 1: if len(results) == 1:
results = results[0] #results = results[0]
print("DONT MAKE LIST FROM 1 TO 0!!")
print("\nLOOP: %s\nRESULTS: %s" % (loop_wrapper, results)) print("\nLOOP: %s\nRESULTS: %s" % (loop_wrapper, results))
return results return results
@@ -521,11 +523,11 @@ class AppBase:
data["filename"] = curfile["filename"] data["filename"] = curfile["filename"]
filename = curfile["filename"] filename = curfile["filename"]
except KeyError as e: except KeyError as e:
print("KeyError in file setup: %s" % e) print(f"KeyError in file setup: {e}")
pass pass
ret = requests.post("%s%s" % (self.url, create_path), headers=headers, json=data) ret = requests.post("%s%s" % (self.url, create_path), headers=headers, json=data)
print("Ret CREATE: %s" % ret.text) print(f"Ret CREATE: {ret.text}")
cur_id = "" cur_id = ""
if ret.status_code == 200: if ret.status_code == 200:
print("RET: %s" % ret.text) print("RET: %s" % ret.text)
@@ -546,7 +548,7 @@ class AppBase:
continue continue
new_headers = { new_headers = {
"Authorization": "Bearer %s" % self.authorization, "Authorization": f"Bearer {self.authorization}",
} }
upload_path = "/api/v1/files/%s/upload?execution_id=%s" % (cur_id, full_execution["execution_id"]) upload_path = "/api/v1/files/%s/upload?execution_id=%s" % (cur_id, full_execution["execution_id"])
@@ -1255,16 +1257,16 @@ class AppBase:
self.logger.info("Checking %s %s %s" % (sourcevalue, check, destinationvalue)) self.logger.info("Checking %s %s %s" % (sourcevalue, check, destinationvalue))
if check == "=" or check.lower() == "equals": if check == "=" or check.lower() == "equals":
if sourcevalue.lower() == destinationvalue.lower(): if str(sourcevalue).lower() == str(destinationvalue).lower():
return True return True
elif check == "!=" or check.lower() == "does not equal": elif check == "!=" or check.lower() == "does not equal":
if sourcevalue.lower() != destinationvalue.lower(): if str(sourcevalue).lower() != str(destinationvalue).lower():
return True return True
elif check.lower() == "startswith": elif check.lower() == "startswith":
if sourcevalue.lower().startswith(destinationvalue.lower()): if str(sourcevalue).lower().startswith(str(destinationvalue).lower()):
return True return True
elif check.lower() == "endswith": elif check.lower() == "endswith":
if sourcevalue.lower().endswith(destinationvalue.lower()): if str(sourcevalue).lower().endswith(str(destinationvalue).lower()):
return True return True
elif check.lower() == "contains": elif check.lower() == "contains":
if destinationvalue.lower() in sourcevalue.lower(): if destinationvalue.lower() in sourcevalue.lower():
+7 -2
View File
@@ -392,7 +392,11 @@ func makePythoncode(swagger *openapi3.Swagger, name, url, method string, paramet
%s %s
%s %s
%s %s
return requests.%s(url, headers=headers%s%s%s%s).text ret = requests.%s(url, headers=headers%s%s%s%s)
try:
return ret.json()
except json.decoder.JSONDecodeError:
return ret.text
`, `,
functionname, functionname,
authenticationParameter, authenticationParameter,
@@ -419,6 +423,7 @@ func makePythoncode(swagger *openapi3.Swagger, name, url, method string, paramet
) )
// Use lowercase when checking // Use lowercase when checking
log.Println(data)
/* /*
if strings.Contains(functionname, "filter") { if strings.Contains(functionname, "filter") {
//log.Printf("FUNCTION: %s", data) //log.Printf("FUNCTION: %s", data)
@@ -1564,7 +1569,7 @@ func handlePost(swagger *openapi3.Swagger, api WorkflowApp, extraParameters []Wo
newName := string(fmt.Sprintf("%s", string(fieldname))) newName := string(fmt.Sprintf("%s", string(fieldname)))
if newName[0] == 0x22 && newName[len(newName)-1] == 0x22 { if newName[0] == 0x22 && newName[len(newName)-1] == 0x22 {
parsedName := newName[1 : len(newName)-1] parsedName := newName[1 : len(newName)-1]
log.Printf("Parse name: %s", parsedName) //log.Printf("[INFO] Parse name: %s", parsedName)
fileField = parsedName fileField = parsedName
curParam := WorkflowAppActionParameter{ curParam := WorkflowAppActionParameter{
+3 -1
View File
@@ -2700,6 +2700,8 @@ const AngularWorkflow = (props) => {
selectedAction.label = event.target.value selectedAction.label = event.target.value
setSelectedAction(selectedAction) setSelectedAction(selectedAction)
console.log("SHOULD CHANGE NAME EVERYWHERE ITS USED TOO BASED ON OLD NAME!")
/* /*
if (nodeaction.label !== curaction.label) { if (nodeaction.label !== curaction.label) {
console.log("BEACH!") console.log("BEACH!")
@@ -7032,7 +7034,7 @@ const AngularWorkflow = (props) => {
<FormControl> <FormControl>
<DialogTitle><span style={{color: "white"}}>Execution Variable</span></DialogTitle> <DialogTitle><span style={{color: "white"}}>Execution Variable</span></DialogTitle>
<DialogContent> <DialogContent>
Execution Variables are TEMPORARY variables that you can ony be set and used during execution. Learn more <a rel="norefferer" href="https://shuffler.io/docs/workflow#execution_variables" target="_blank" style={{textDecoration: "none", color: "#f85a3e"}}>here</a> Execution Variables are TEMPORARY variables that you can ony be set and used during execution. Learn more <a rel="norefferer" href="https://shuffler.io/docs/workflows#execution_variables" target="_blank" style={{textDecoration: "none", color: "#f85a3e"}}>here</a>
<TextField <TextField
onBlur={(event) => setNewVariableName(event.target.value)} onBlur={(event) => setNewVariableName(event.target.value)}
color="primary" color="primary"