Example #1
0
        public void Reload()
        {
            messageHandlers.Clear();
            eventMessageHandlers.Clear();

            engineRuntime.ImportModule("api");

            foreach (string path in System.IO.Directory.GetFiles(rootPath))
            {
                try
                {
                    Debug.WriteLine($"loading {path}");
                    engine.ExecuteFile(path, engineScope);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine($"{ex.Message}");
                }
            }
        }
 public MoodleAPI(IDictionary <string, string> Server)
 {
     python      = Python.CreateRuntime();
     moodle      = python.ImportModule("moodle");
     this.Server = Server;
 }