Minor SDK update for prints
This commit is contained in:
@@ -2691,7 +2691,7 @@ class AppBase:
|
||||
#self.logger.info(f"\n\nType of value: {type(value)}")
|
||||
if isinstance(value, str):
|
||||
# Could we take it here?
|
||||
self.logger.info(f"[DEBUG] Got value %s for parameter {paramname}" % value)
|
||||
#self.logger.info(f"[DEBUG] Got value %s for parameter {paramname}" % value)
|
||||
# Should check if there is are quotes infront of and after the to_be_replaced
|
||||
# If there are, then we need to sanitize the value
|
||||
# 1. Look for the to_be_replaced in the data
|
||||
@@ -2703,7 +2703,6 @@ class AppBase:
|
||||
# value = returnvalue
|
||||
|
||||
|
||||
|
||||
parameter["value"] = parameter["value"].replace(to_be_replaced, value)
|
||||
elif isinstance(value, dict) or isinstance(value, list):
|
||||
# Changed from JSON dump to str() 28.05.2021
|
||||
|
||||
@@ -3049,55 +3049,7 @@ func verifySwagger(resp http.ResponseWriter, request *http.Request) {
|
||||
buildSwaggerApp(resp, body, user, false)
|
||||
}
|
||||
|
||||
// Creates osfs from folderpath with a basepath as directory base
|
||||
func createFs(basepath, pathname string) (billy.Filesystem, error) {
|
||||
log.Printf("[INFO] MemFS base: %s, pathname: %s", basepath, pathname)
|
||||
|
||||
fs := memfs.New()
|
||||
err := filepath.Walk(pathname,
|
||||
func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if strings.Contains(path, ".git") {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Fix the inner path here
|
||||
newpath := strings.ReplaceAll(path, pathname, "")
|
||||
fullpath := fmt.Sprintf("%s%s", basepath, newpath)
|
||||
switch mode := info.Mode(); {
|
||||
case mode.IsDir():
|
||||
err = fs.MkdirAll(fullpath, 0644)
|
||||
if err != nil {
|
||||
log.Printf("Failed making folder: %s", err)
|
||||
}
|
||||
case mode.IsRegular():
|
||||
srcData, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
log.Printf("Src error: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
dst, err := fs.Create(fullpath)
|
||||
if err != nil {
|
||||
log.Printf("Dst error: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = dst.Write(srcData)
|
||||
if err != nil {
|
||||
log.Printf("Dst write error: %s", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
return fs, err
|
||||
}
|
||||
|
||||
// Hotloads new apps from a folder
|
||||
func handleAppHotload(ctx context.Context, location string, forceUpdate bool) error {
|
||||
|
||||
Reference in New Issue
Block a user