def start(filename=None): "Start the pvblot interpreter." # Turn off progress printing while running. import paraview.servermanager doProgressToggle = (paraview.servermanager.progressObserverTag != None) if doProgressToggle: paraview.servermanager.ToggleProgressPrinting() blotish.detour(filename) pvblotinterp = _PVBlotInterp() pvblotinterp.cmdloop() if doProgressToggle: paraview.servermanager.ToggleProgressPrinting()
def initialize(filename=None): """Initialize the pvblot interpreter for non-interactive use. Normally you just call start and it takes care of reading and executing commands. However, in situation where you are not reading from stdin and stdout, you may need some other controlling mechanism to call methods one at a time. In that case, use the initialize, execute, and finalize functions. """ # Turn off progress printing while running. import paraview.servermanager global doProgressToggle doProgressToggle = (paraview.servermanager.progressObserverTag != None) if doProgressToggle: paraview.servermanager.ToggleProgressPrinting() blotish.detour(filename) global interpreter interpreter = _PVBlotInterp()