Example #1
0
        GetModule(string name)
        {
            PythonDictionary modules = (PythonDictionary)this.python.SystemState.Get__dict__()["modules"];

            if (modules.has_key(name))
            {
                return((PythonModule)modules[name]);
            }
            return(null);
        }
Example #2
0
        private OldClass(SerializationInfo info, StreamingContext context)
        {
            _bases = (List <OldClass>)info.GetValue("__class__", typeof(List <OldClass>));
            _name  = info.GetValue("__name__", typeof(object));
            _dict  = new PythonDictionary();

            InitializeInstanceNames(""); //TODO should we serialize the optimization data

            List <object> keys   = (List <object>)info.GetValue("keys", typeof(List <object>));
            List <object> values = (List <object>)info.GetValue("values", typeof(List <object>));

            for (int i = 0; i < keys.Count; i++)
            {
                _dict[keys[i]] = values[i];
            }

            if (_dict.has_key("__del__"))
            {
                HasFinalizer = true;
            }
        }
Example #3
0
        private OldClass(SerializationInfo info, StreamingContext context) {
            _bases = (List<OldClass>)info.GetValue("__class__", typeof(List<OldClass>));
            _name = info.GetValue("__name__", typeof(object));
            _dict = new PythonDictionary();

            InitializeInstanceNames(""); //TODO should we serialize the optimization data

            List<object> keys = (List<object>)info.GetValue("keys", typeof(List<object>));
            List<object> values = (List<object>)info.GetValue("values", typeof(List<object>));
            for (int i = 0; i < keys.Count; i++) {
                _dict[keys[i]] = values[i];
            }

            if (_dict.has_key("__del__")) HasFinalizer = true;
        }