// Summary: // load python plugins // Remarks: // Python scripts located in bin\PyPlugins will be executed automatically. public void loadPyPlugins() { Assembly exeAssembly = Assembly.GetExecutingAssembly(); string exeLocation = exeAssembly.Location; string exePath = Path.GetDirectoryName(exeLocation); string pyPluginsPath = exePath + "\\PyPlugins"; if (!Directory.Exists(pyPluginsPath)) return; PyManager pyMan = new PyManager(); pyMan.loadPlugins(pyPluginsPath); }
// Summary: // Run python scripts // Remarks: // The scripts runned here is in the main UI thread, // which is different from scripts inputted in the Python // Console window. In the case of Python Console window, // the script is runned in another thread. Therefore, // there is no restriction on calls to main UI thread here. // Known bugs: // Script call to IS3View.addGdbLayer will hang the program. // This problem doesn't exist in scripts runned from console window. public void runPythonScripts(string file) { PyManager pyMan = new PyManager(); pyMan.run(file); }