Esempio n. 1
0
 public Python3ScriptModule(IGraphRuntime runtime, ILoggerFactory loggerFactory, IPythonMainThread mainThread)
     : base(runtime, loggerFactory, mainThread)
 {
 }
Esempio n. 2
0
 public Python3EvalModule(IGraphRuntime runtime, IPythonMainThread mainThread)
     : base(runtime, ModuleKind.ScriptModule)
 {
     this.mainThread         = mainThread;
     this.DynamicDisplayName = new DynamicDisplayNameFunc(FormatDisplayName);
 }
        public PythonScriptModuleBase(IGraphRuntime runtime, ILoggerFactory loggerFactory, IPythonMainThread mainThread)
            : base(runtime, ModuleKind.ScriptModule)
        {
            logger          = loggerFactory.CreateLogger <PythonScriptModuleBase>();
            this.mainThread = mainThread;

            this.captionPin       = this.AddInputPin("caption", PinDataTypeFactory.Create <string>(), PropertyMode.Always);
            this.functionNamePin  = this.AddInputPin("functionName", PinDataTypeFactory.Create <string>(DEFAULT_FUNCTION_NAME), PropertyMode.Default);
            this.useMainThreadPin = this.AddInputPin("useMainThread", PinDataTypeFactory.Create <bool>(true), PropertyMode.Always);
            this.parserErrorPin   = this.AddInputPin("parserError", PinDataTypeFactory.Create <Models.ExceptionModel>(null, WellKnownEditors.ExceptionViewer), PropertyMode.Always);
            var scriptSourcePinId = this.AddScriptSourcePin();

            this.argumentPins = new List <GenericInputPin>();
            this.resultPins   = new List <GenericOutputPin>();

            this.properties[scriptSourcePinId].WhenNodeEvent.OfType <PropertyChangedEvent>().Subscribe(evt =>
            {
                logger.LogInformation("Script source changed");
                UpdateSignatureSafe();
            });

            this.properties[functionNamePin.Id].WhenNodeEvent.OfType <PropertyChangedEvent>().Subscribe(evt =>
            {
                logger.LogInformation("Function name changed");
                UpdateSignatureSafe();
            });

            this.DynamicDisplayName = new DynamicDisplayNameFunc(FormatDisplayName);
        }