Пример #1
0
        public void Read()
        {
            _settings = new ApplicationSettings();
            _colors   = new Dictionary <Level, ColorPair>();

            Ipy.ExecuteFile(new[] { "config.py" }, new Dictionary <string, object> {
                { "settings", _settings }, { "colors", _colors }
            });
        }
Пример #2
0
        /// <summary>
        /// Read the files with processors again.
        /// </summary>
        public void RereadProcessors()
        {
            lock (_processorsLock)
            {
                _messageProcessors = new Dictionary <string, List <IProcessor> >();

                foreach (var f in Directory.GetFiles(".", "rules*.py"))
                {
                    string            file       = Path.GetFileName(f);
                    List <IProcessor> processors = new List <IProcessor>();
                    Ipy.ExecuteFile(
                        new[] { "definitions.py", file },
                        new Dictionary <string, object> {
                        { "processor", processors }
                    });
                    if (_currentProcessorsFile == null)
                    {
                        _currentProcessorsFile = file;
                    }
                    _messageProcessors[file] = processors;
                }
            }
        }