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); }
internal static void EnsureLocaleInitialized(PythonContext context) { if (!context.HasModuleState(_localeKey)) { context.SetModuleState(_localeKey, new LocaleInfo(context)); } }
public static void PerformModuleReload(PythonContext /*!*/ context, PythonDictionary /*!*/ 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); } }
public static void PerformModuleReload(PythonContext context, PythonDictionary dict) { if (!context.HasModuleState(_registry_key)) { context.SetModuleState(_registry_key, new List <FunctionDescriptor>()); } context.SetSystemStateValue("exitfunc", (Action <CodeContext>)_run_exitfuncs); }
private static int GetFieldSizeLimit(CodeContext /*!*/ context) { PythonContext ctx = PythonContext.GetContext(context); if (!ctx.HasModuleState(_fieldSizeLimitKey)) { ctx.SetModuleState(_fieldSizeLimitKey, FieldSizeLimit); } return((int)ctx.GetModuleState(_fieldSizeLimitKey)); }
/// <summary> /// Returns the dialects from the code context. /// </summary> /// <param name="context"></param> /// <returns></returns> private static DialectRegistry GetDialects(CodeContext /*!*/ context) { PythonContext ctx = PythonContext.GetContext(context); if (!ctx.HasModuleState(_dialectRegistryKey)) { ctx.SetModuleState(_dialectRegistryKey, new DialectRegistry()); } return((DialectRegistry)ctx.GetModuleState(_dialectRegistryKey)); }