public PythonOptions(IDictionary <string, object> options) : base(EnsureSearchPaths(options)) { _arguments = GetStringCollectionOption(options, "Arguments") ?? EmptyStringCollection; _warningFilters = GetStringCollectionOption(options, "WarningFilters", ';', ',') ?? EmptyStringCollection; _warnPy3k = GetOption(options, "WarnPy3k", false); _bytesWarning = GetOption(options, "BytesWarning", false); _debug = GetOption(options, "Debug", false); _inspect = GetOption(options, "Inspect", false); _noUserSite = GetOption(options, "NoUserSite", false); _noSite = GetOption(options, "NoSite", false); _ignoreEnvironment = GetOption(options, "IgnoreEnvironment", false); _verbose = GetOption(options, "Verbose", false); _optimize = GetOption(options, "Optimize", false); _stripDocStrings = GetOption(options, "StripDocStrings", false); _division = GetOption(options, "DivisionOptions", PythonDivisionOptions.New); _recursionLimit = GetOption(options, "RecursionLimit", Int32.MaxValue); _indentationInconsistencySeverity = GetOption(options, "IndentationInconsistencySeverity", Severity.Ignore); _enableProfiler = GetOption(options, "EnableProfiler", false); _lightweightScopes = GetOption(options, "LightweightScopes", false); _fullFrames = GetOption(options, "FullFrames", false); _frames = _fullFrames || GetOption(options, "Frames", false); _gcStress = GetOption <int?>(options, "GCStress", null); _tracing = GetOption(options, "Tracing", false); _noDebug = GetOption(options, "NoDebug", (Regex)null); object value; if (options != null && options.TryGetValue("PythonVersion", out value)) { if (value is Version) { _version = (Version)value; } else if (value is string) { _version = new Version((string)value); } else { throw new ValueErrorException("Expected string or Version for PythonVersion"); } if (_version != new Version(2, 7) && _version != new Version(3, 0)) { throw new ValueErrorException("Expected Version to be 2.7 or 3.0"); } } else { _version = new Version(2, 7); } _python30 = _version == new Version(3, 0); }
public PythonOptions(IDictionary<string, object> options) : base(EnsureSearchPaths(options)) { _arguments = GetStringCollectionOption(options, "Arguments") ?? EmptyStringCollection; _warningFilters = GetStringCollectionOption(options, "WarningFilters", ';', ',') ?? EmptyStringCollection; _warnPy3k = GetOption(options, "WarnPy3k", false); _bytesWarning = GetOption(options, "BytesWarning", false); _debug = GetOption(options, "Debug", false); _inspect = GetOption(options, "Inspect", false); _noUserSite = GetOption(options, "NoUserSite", false); _noSite = GetOption(options, "NoSite", false); _ignoreEnvironment = GetOption(options, "IgnoreEnvironment", false); _verbose = GetOption(options, "Verbose", false); _optimize = GetOption(options, "Optimize", false); _stripDocStrings = GetOption(options, "StripDocStrings", false); _division = GetOption(options, "DivisionOptions", PythonDivisionOptions.Old); _recursionLimit = GetOption(options, "RecursionLimit", Int32.MaxValue); _indentationInconsistencySeverity = GetOption(options, "IndentationInconsistencySeverity", Severity.Ignore); _enableProfiler = GetOption(options, "EnableProfiler", false); _lightweightScopes = GetOption(options, "LightweightScopes", false); _fullFrames = GetOption(options, "FullFrames", false); _frames = _fullFrames || GetOption(options, "Frames", false); _gcStress = GetOption<int?>(options, "GCStress", null); _tracing = GetOption(options, "Tracing", false); _noDebug = GetOption(options, "NoDebug", (Regex)null); object value; if (options != null && options.TryGetValue("PythonVersion", out value)) { if (value is Version) { _version = (Version)value; } else if (value is string) { _version = new Version((string)value); } else { throw new ValueErrorException("Expected string or Version for PythonVersion"); } if (_version != new Version(2, 7) && _version != new Version(3, 0)) { throw new ValueErrorException("Expected Version to be 2.7 or 3.0"); } } else { _version = new Version(2, 7); } _python30 = _version == new Version(3, 0); }
public PythonOptions(IDictionary<string, object> options) : base(options) { _arguments = GetStringCollectionOption(options, "Arguments") ?? EmptyStringCollection; _warningFilters = GetStringCollectionOption(options, "WarningFilters", ';', ',') ?? EmptyStringCollection; _warnPy3k = GetOption(options, "WarnPy3k", false); _bytesWarning = GetOption(options, "BytesWarning", false); _debug = GetOption(options, "Debug", false); _inspect = GetOption(options, "Inspect", false); _noUserSite = GetOption(options, "NoUserSite", false); _noSite = GetOption(options, "NoSite", false); _ignoreEnvironment = GetOption(options, "IgnoreEnvironment", false); _verbose = GetOption(options, "Verbose", false); _optimize = GetOption(options, "Optimize", false); _stripDocStrings = GetOption(options, "StripDocStrings", false); _division = GetOption(options, "DivisionOptions", PythonDivisionOptions.Old); _recursionLimit = GetOption(options, "RecursionLimit", Int32.MaxValue); _indentationInconsistencySeverity = GetOption(options, "IndentationInconsistencySeverity", Severity.Ignore); _adaptiveCompilation = GetOption(options, "AdaptiveCompilation", true); _enableProfiler = GetOption(options, "EnableProfiler", false); _lightweightScopes = GetOption(options, "LightweightScopes", false); object value; if (options != null && options.TryGetValue("PythonVersion", out value)) { if (value is Version) { _version = (Version)value; } else if (value is string) { _version = new Version((string)value); } else { throw new ArgumentException("Expected string or Version for PythonVersion"); } if (_version != new Version(2, 5) && _version != new Version(2, 6)) { throw new ArgumentException("Expected Version to be 2.5 or 2.6"); } } else { _version = new Version(2, 6); } }