当前位置: 首页>>代码示例>>C#>>正文


C# PythonContext.SetModuleState方法代码示例

本文整理汇总了C#中IronPython.Runtime.PythonContext.SetModuleState方法的典型用法代码示例。如果您正苦于以下问题:C# PythonContext.SetModuleState方法的具体用法?C# PythonContext.SetModuleState怎么用?C# PythonContext.SetModuleState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IronPython.Runtime.PythonContext的用法示例。


在下文中一共展示了PythonContext.SetModuleState方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PerformModuleReload

        public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {
            if (!context.HasModuleState(_defaultTimeoutKey)) {
                context.SetModuleState(_defaultTimeoutKey, null);
            }

            context.SetModuleState(_defaultBufsizeKey, DefaultBufferSize);

            PythonType socketErr = GetSocketError(context, dict);
            context.EnsureModuleException("socketherror", socketErr, dict, "herror", "socket");
            context.EnsureModuleException("socketgaierror", socketErr, dict, "gaierror", "socket");
            context.EnsureModuleException("sockettimeout", socketErr, dict, "timeout", "socket");
        }
开发者ID:TerabyteX,项目名称:main,代码行数:12,代码来源:socket.cs

示例2: PerformModuleReload

        public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) {
            if (!context.HasModuleState(_defaultTimeoutKey)) {
                context.SetModuleState(_defaultTimeoutKey, null);
            }

            context.SetModuleState(_defaultBufsizeKey, DefaultBufferSize);

            context.EnsureModuleException("sslerror", dict, "sslerror", "socket");
            PythonType socketErr = context.EnsureModuleException("socketerror", PythonExceptions.IOError, dict, "error", "socket");
            context.EnsureModuleException("socketherror", socketErr, dict, "herror", "socket");
            context.EnsureModuleException("socketgaierror", socketErr, dict, "gaierror", "socket");
            context.EnsureModuleException("sockettimeout", socketErr, dict, "timeout", "socket");
        }
开发者ID:Hank923,项目名称:ironruby,代码行数:13,代码来源:socket.cs

示例3: PerformModuleReload

        public static void PerformModuleReload(PythonContext context, PythonDictionary dict)
        {
            if (!context.HasModuleState(_fieldSizeLimitKey))
            {
                context.SetModuleState(_fieldSizeLimitKey, FieldSizeLimit);
            }

            if (!context.HasModuleState(_dialectRegistryKey))
            {
                context.SetModuleState(_dialectRegistryKey,
                    new DialectRegistry());
            }
            InitModuleExceptions(context, dict);
        }
开发者ID:robjperez,项目名称:main,代码行数:14,代码来源:_csv.cs

示例4: PerformModuleReload

        public static void PerformModuleReload(PythonContext context, PythonDictionary dict) {
            if (!context.HasModuleState(_zip_directory_cache_key))
                context.SetModuleState(_zip_directory_cache_key, new PythonDictionary());

            dict["_zip_directory_cache"] = context.GetModuleState(_zip_directory_cache_key);
            InitModuleExceptions(context, dict);
        }
开发者ID:Gerhman,项目名称:IronLanguages,代码行数:7,代码来源:zipimport.cs

示例5: PerformModuleReload

        public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) {

            context.EnsureModuleException("ArgumentError", dict, "ArgumentError", "_ctypes");
            context.EnsureModuleException("COMError", dict, "COMError", "_ctypes");

            // TODO: Provide an implementation which is coordinated with our _refCountTable
            context.SystemState.__dict__["getrefcount"] = null;
            PythonDictionary pointerTypeCache = new PythonDictionary();
            dict[SymbolTable.StringToId("_pointer_type_cache")] = pointerTypeCache;
            context.SetModuleState(_pointerTypeCacheKey, pointerTypeCache);

            if (Environment.OSVersion.Platform == PlatformID.Win32NT ||
                Environment.OSVersion.Platform == PlatformID.Win32S ||
                Environment.OSVersion.Platform == PlatformID.Win32Windows ||
                Environment.OSVersion.Platform == PlatformID.WinCE) {
                context.SetModuleState(_conversion_mode, PythonTuple.MakeTuple("mbcs", "ignore"));
            } else {
                context.SetModuleState(_conversion_mode, PythonTuple.MakeTuple("ascii", "strict"));
            }
        }
开发者ID:techarch,项目名称:ironruby,代码行数:20,代码来源:_ctypes.cs

示例6: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) {
     dict.Add(SymbolTable.StringToId(_keyDefaultAction), "default");
     dict.Add(SymbolTable.StringToId(_keyOnceRegistry), new PythonDictionary());
     dict.Add(SymbolTable.StringToId(_keyFilters), new List() {
         // Default filters
         PythonTuple.MakeTuple("ignore", null, PythonExceptions.PendingDeprecationWarning, null, 0),
         PythonTuple.MakeTuple("ignore", null, PythonExceptions.ImportWarning, null, 0),
         PythonTuple.MakeTuple("ignore", null, PythonExceptions.BytesWarning, null, 0)
     });
     context.SetModuleState(_keyFields, dict);
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:11,代码来源:_warnings.cs

示例7: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {
     context.SetModuleState(_stackSizeKey, 0);
     context.EnsureModuleException("threaderror", dict, "error", "thread");
 }
开发者ID:rpattabi,项目名称:ironruby,代码行数:4,代码来源:thread.cs

示例8: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {
     PythonSignalState pss = new PythonSignalState(context);
     context.SetModuleState(_PythonSignalStateKey, pss);
     NativeSignal.SetConsoleCtrlHandler(pss.WinAllSignalsHandlerDelegate, true);
 }
开发者ID:jschementi,项目名称:iron,代码行数:5,代码来源:signal.cs

示例9: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) {
     // set the lock count to zero on the 1st load, don't reset the lock count on reloads
     if (!context.HasModuleState(_lockCountKey)) {
         context.SetModuleState(_lockCountKey, 0L);
     }
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:6,代码来源:imp.cs

示例10: PerformModuleReload

        public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {
            context.NewObject = (BuiltinFunction)dict["__newobj__"];
            context.PythonReconstructor = (BuiltinFunction)dict["_reconstructor"];

            PythonDictionary dispatchTable = new PythonDictionary();
            dispatchTable[TypeCache.Complex64] = dict["pickle_complex"];

            context.SetModuleState(_dispatchTableKey, dict["dispatch_table"] = dispatchTable);
            context.SetModuleState(_extensionRegistryKey, dict["_extension_registry"] = new PythonDictionary());
            context.SetModuleState(_invertedRegistryKey, dict["_inverted_registry"] = new PythonDictionary());
            context.SetModuleState(_extensionCacheKey, dict["_extension_cache"] = new PythonDictionary());
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:12,代码来源:copy_reg.cs

示例11: EnsureLocaleInitialized

 internal static void EnsureLocaleInitialized(PythonContext context) {
     if (!context.HasModuleState(_localeKey)) {
         context.SetModuleState(_localeKey, new LocaleInfo(context));
     }
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:5,代码来源:locale.cs

示例12: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {            
     context.SetModuleState(_threadholdKey, PythonTuple.MakeTuple(64 * 1024, 256 * 1024, 1024 * 1024));
 }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:3,代码来源:gc.cs

示例13: ExecuteInternal

        protected override void ExecuteInternal()
        {
            pythonContext = HostingHelpers.GetLanguageContext(Engine) as PythonContext;

            if (pythonContext != null)
            {
                foreach( var expose in exposeBuffer)
                {
                    pythonContext.BuiltinModuleDict[expose.Key] = expose.Value;
                }

                pythonContext.SetModuleState(typeof (ScriptEngine), Engine);
                base.ExecuteInternal();
            }
        }
开发者ID:BernhardGlueck,项目名称:Phare,代码行数:15,代码来源:PythonScriptConsole.cs

示例14: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {
     context.SetModuleState(_PythonSignalStateKey, MakeSignalState(context));
 }
开发者ID:TerabyteX,项目名称:ironpython3,代码行数:3,代码来源:signal.cs


注:本文中的IronPython.Runtime.PythonContext.SetModuleState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。