- Add copyright notices to existing builtin python policies
- Implement system to dinamically pass plugins and policies search paths to the sgpemv2 binary and tests (class GlobalSettings) - Drastically reduce usage of hardcoded paths in code except as default overridable values git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@514 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
24a0194368
commit
92e6f3be2b
9 changed files with 353 additions and 88 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "backend/pyloader/python_policy_manager.hh"
|
||||
#include "backend/pyloader/python_policy.hh"
|
||||
#include "backend/process.hh"
|
||||
#include "backend/global_settings.hh"
|
||||
#include "backend/schedulable_status.hh"
|
||||
#include "backend/schedulable_list.hh"
|
||||
#include "backend/scheduler.hh"
|
||||
|
@ -36,14 +37,16 @@
|
|||
#include <glibmm/module.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
// FIXME: Eeeeh? Why does this work without explicit namespace resolving?
|
||||
// Is there some using declaration in included HEADERS?? Aaaaagh!
|
||||
|
||||
class TestPythonPolicyManager : public PythonPolicyManager {
|
||||
public:
|
||||
void test_init(const char* policy_name) {
|
||||
init();
|
||||
PyRun_SimpleString("import sys\n"
|
||||
"sys.path[:0] = [ '" MODDIR "', '" POLDIR "' ]\n");
|
||||
_python_policy = std::auto_ptr<PythonPolicy>(new PythonPolicy(policy_name));
|
||||
}
|
||||
};
|
||||
|
@ -52,8 +55,16 @@ public:
|
|||
int
|
||||
main(int argc, char** argv) {
|
||||
using namespace sgpem;
|
||||
using Glib::Module;
|
||||
|
||||
if(argc != 2) {
|
||||
std::cout << "[EE] Usage:\n\t" << argv[0] <<
|
||||
" path/to/uninstalled/policies" << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
// Add current directory to search for uninstalled policies
|
||||
sgpem::GlobalSettings::instance().add_policies_dir(argv[1]);
|
||||
|
||||
Glib::thread_init();
|
||||
|
||||
// Create an INITIAL STATE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue