Beispiel #1
0
 if filename in autopack.RECIPES:
     n = filename
     v = sys.argv[2]
     filename = autopack.RECIPES[n][v]["setupfile"]
     resultfile = autopack.RECIPES[n][v]["resultfile"]
 else:
     resultfile = sys.argv[2]
 setupfile = autopack.retrieveFile(filename, cache="recipes")
 print("ok use ", setupfile, filename, resultfile)
 fileName, fileExtension = os.path.splitext(setupfile)
 n = os.path.basename(fileName)
 h = Environment(name=n)
 h.loadRecipe(setupfile)
 h.setupfile = filename
 if resultfile is not None:
     h.resultfile = resultfile
 fileName, fileExtension = os.path.splitext(setupfile)
 if export_json:
     print("expot json recipe ", fileName)
     h.saveRecipe(fileName + ".json", useXref=useXref, indent=True)
 if check_result:
     rfile = h.resultfile
     resultfilename = autopack.retrieveFile(rfile, cache="results")
     if resultfilename is None:
         print("no result for " + n + " " + h.version + " " + rfile)
         sys.exit()
     print("get the result file from ", resultfilename)
     result, orgaresult, freePoint = h.loadResult(
         resultfilename=resultfilename, restore_grid=False,
         backward=True)  #load text ?#this will restore the grid
     ingredients = h.restore(result, orgaresult, freePoint)
Beispiel #2
0
 filename = sys.argv[1]
 resultfile = None
 if filename in autopack.RECIPES:
     n = filename
     v = sys.argv[2]
     filename = autopack.RECIPES[n][v]["setupfile"]
     resultfile = autopack.RECIPES[n][v]["resultfile"]
 setupfile = autopack.retrieveFile(filename, cache="recipes")
 print("ok use ", setupfile, filename)
 fileName, fileExtension = os.path.splitext(setupfile)
 n = os.path.basename(fileName)
 h = Environment(name=n)
 h.loadRecipe(setupfile)
 h.setupfile = filename
 if resultfile is not None:
     h.resultfile = resultfile
 fileName, fileExtension = os.path.splitext(setupfile)
 if load:
     rfile = h.resultfile
     resultfilename = autopack.retrieveFile(rfile, cache="results")
     if resultfilename is None:
         print("no result for " + n + " " + h.version + " " + rfile)
         sys.exit()
     print("get the result file from ", resultfilename)
     result, orgaresult, freePoint = h.loadResult(
         resultfilename=resultfilename)
     #                                             restore_grid=False,backward=True)#load text ?#this will restore the grid
     ingredients = h.restore(result, orgaresult, freePoint)
 elif pack:
     #pack
     gridfile = "/home/ludo/Dev/bdbox/grid_store"