本文整理汇总了C#中IronPython.Runtime.PythonContext.HasModuleState方法的典型用法代码示例。如果您正苦于以下问题:C# PythonContext.HasModuleState方法的具体用法?C# PythonContext.HasModuleState怎么用?C# PythonContext.HasModuleState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronPython.Runtime.PythonContext
的用法示例。
在下文中一共展示了PythonContext.HasModuleState方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
示例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");
}
示例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");
}
示例5: 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);
}
}
示例6: EnsureLocaleInitialized
internal static void EnsureLocaleInitialized(PythonContext context) {
if (!context.HasModuleState(_localeKey)) {
context.SetModuleState(_localeKey, new LocaleInfo(context));
}
}