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


C# PythonContext.EnsureModuleException方法代码示例

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


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

示例1: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {
     context.EnsureModuleException("PickleError", dict, "PickleError", "cPickle");
     context.EnsureModuleException("PicklingError", dict, "PicklingError", "cPickle");
     context.EnsureModuleException("UnpicklingError", dict, "UnpicklingError", "cPickle");
     context.EnsureModuleException("UnpickleableError", dict, "UnpickleableError", "cPickle");
     context.EnsureModuleException("BadPickleGet", dict, "BadPickleGet", "cPickle");
     dict["__builtins__"] = context.BuiltinModuleInstance;
     dict["compatible_formats"] = PythonOps.MakeList("1.0", "1.1", "1.2", "1.3", "2.0");
 }
开发者ID:kevinkeeney,项目名称:ironruby,代码行数:9,代码来源:cPickle.cs

示例2: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) {
     context.EnsureModuleException("PickleError", dict, "PickleError", "cPickle");
     context.EnsureModuleException("PicklingError", dict, "PicklingError", "cPickle");
     context.EnsureModuleException("UnpicklingError", dict, "UnpicklingError", "cPickle");
     context.EnsureModuleException("UnpickleableError", dict, "UnpickleableError", "cPickle");
     context.EnsureModuleException("BadPickleGet", dict, "BadPickleGet", "cPickle");
     dict[Symbols.Builtins] = context.BuiltinModuleInstance;
     dict[SymbolTable.StringToId("compatible_formats")] = PythonOps.MakeList("1.0", "1.1", "1.2", "1.3", "2.0");
 }
开发者ID:techarch,项目名称:ironruby,代码行数:9,代码来源:cPickle.cs

示例3: 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

示例4: 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

示例5: InitModuleExceptions

 private static void InitModuleExceptions(PythonContext context, PythonDictionary dict)
 {
     Warning = context.EnsureModuleException("sqlite.Warning", PythonExceptions.StandardError, dict, "Warning", "_sqlite3");
     Error = context.EnsureModuleException("sqlite.Error", PythonExceptions.StandardError, dict, "Error", "_sqlite3");
     InterfaceError = context.EnsureModuleException("sqlite.InterfaceError", Error, dict, "InterfaceError", "_sqlite3");
     DatabaseError = context.EnsureModuleException("sqlite.DatabaseError", Error, dict, "DatabaseError", "_sqlite3");
     DataError = context.EnsureModuleException("sqlite.DataError", DatabaseError, dict, "DataError", "_sqlite3");
     OperationalError = context.EnsureModuleException("sqlite.OperationalError", DatabaseError, dict, "OperationalError", "_sqlite3");
     IntegrityError = context.EnsureModuleException("sqlite.IntegrityError", DatabaseError, dict, "IntegrityError", "_sqlite3");
     InternalError = context.EnsureModuleException("sqlite.InternalError", DatabaseError, dict, "InternalError", "_sqlite3");
     ProgrammingError = context.EnsureModuleException("sqlite.ProgrammingError", DatabaseError, dict, "ProgrammingError", "_sqlite3");
     NotSupportedError = context.EnsureModuleException("sqlite.NotSupportedError", DatabaseError, dict, "NotSupportedError", "_sqlite3");
 }
开发者ID:TerabyteX,项目名称:ironpython3,代码行数:13,代码来源:Exceptions.cs

示例6: PerformModuleReload

        public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {            
            var socket = context.GetBuiltinModule("socket");
            var socketError = PythonSocket.GetSocketError(context, socket.__dict__);
            
            context.EnsureModuleException("SSLError", socketError, dict, "SSLError", "ssl");

        }
开发者ID:kevinkeeney,项目名称:ironruby,代码行数:7,代码来源:_ssl.cs

示例7: InitModuleExceptions

 private static void InitModuleExceptions(PythonContext context,
     PythonDictionary dict)
 {
     ZipImportError = context.EnsureModuleException(
         "zipimport.ZipImportError",
         PythonExceptions.ImportError,
         typeof(PythonExceptions.BaseException),
         dict, "ZipImportError", "zipimport",
         msg => new ImportException(msg));
 }
开发者ID:TerabyteX,项目名称:main,代码行数:10,代码来源:zipimport.cs

示例8: 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

示例9: 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

示例10: GetSocketError

 internal static PythonType GetSocketError(PythonContext context, PythonDictionary dict) {
     return context.EnsureModuleException("socketerror", PythonExceptions.IOError, dict, "error", "socket");
 }
开发者ID:TerabyteX,项目名称:main,代码行数:3,代码来源:socket.cs

示例11: InitModuleExceptions

 private static void InitModuleExceptions(PythonContext context,
     PythonDictionary dict)
 {
     Error = context.EnsureModuleException("csv.Error",
         PythonExceptions.StandardError, dict, "Error", "_csv");
 }
开发者ID:robjperez,项目名称:main,代码行数:6,代码来源:_csv.cs

示例12: InitModuleExceptions

 /// <summary>
 /// Initialize exception
 /// </summary>
 /// <param name="context"></param>
 /// <param name="dict"></param>
 private static void InitModuleExceptions(PythonContext context, PythonDictionary dict)
 {
     GenericImporterError = context.EnsureModuleException(
         "genericimporter.GenericImporterError",
         PythonExceptions.ImportError,
         typeof(PythonExceptions.BaseException),
         dict, "GenericImporterError", "genericimporter",
         msg => new ImportException(msg));
 }
开发者ID:simplic-systems,项目名称:simplic-dlr,代码行数:14,代码来源:GenericImporter.cs

示例13: PerformModuleReload

 public static void PerformModuleReload(PythonContext context, PythonDictionary dict)
 {
     error = context.EnsureModuleException("zlib.error", PythonExceptions.Exception, dict, "error", "zlib");
 }
开发者ID:jschementi,项目名称:iron,代码行数:4,代码来源:ZlibModule.cs

示例14: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {
     context.EnsureModuleException("selecterror", dict, "error", "select");
 }
开发者ID:jschementi,项目名称:iron,代码行数:3,代码来源:select.cs

示例15: PerformModuleReload

 public static void PerformModuleReload(PythonContext/*!*/ context, IAttributesCollection/*!*/ dict) {
     context.EnsureModuleException("binasciierror", dict, "Error", "binascii");
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:3,代码来源:binascii.cs


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