Example #1
0
        public static void Load()
        {
            PyScriptPlatform.LoadWorldMemory();
            Scripts.Clear();
            foreach (var f in Directory.GetFiles("Scripts"))
            {
                var fInfos = new FileInfo(f);
                if (fInfos.Extension.ToLower() == ".py")
                {
                    try
                    {
                        var script = new PyScript(f);
                        script.Load();
                        Scripts.Add(script);
                    }
                    catch (Exception e)
                    {
                        Utilities.ConsoleStyle.Error("Can't load script engine for '" + f + "' : " + e.ToString());
                    }
                }
            }

            foreach (var f in Directory.GetFiles("Scripts/System"))
            {
                var fInfos = new FileInfo(f);
                if (fInfos.Extension.ToLower() == ".py")
                {
                    try
                    {
                        var script = new PyScript(f);
                        script.Load();
                        Scripts.Add(script);
                    }
                    catch (Exception e)
                    {
                        Utilities.ConsoleStyle.Error("Can't load script engine for '" + f + "' : " + e.ToString());
                    }
                }
            }
        }
Example #2
0
 public PyScript(string path)
 {
     this.Path     = path;
     this.Platform = new PyScriptPlatform(this);
 }