- Added the LOAD command to TextSimulation, and the classic question made to user on replacing an unsaved simulation

- Changed the way syntactically incorrect python policies are handled, we no more exit abruptly

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@829 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-08-08 00:20:56 +00:00
parent d72ce96508
commit 0138387a7f
8 changed files with 189 additions and 14 deletions

View file

@ -122,23 +122,30 @@ PythonCPUPolicyManager::collect_policies()
for(Glib::DirIterator file_it = dir.begin(); file_it != dir.end(); ++file_it)
{
cout << "\tChecking if " << *file_it << " is a Python script... ";
cout << "\tChecking if " << *file_it << " is a valid Python script... ";
Glib::PatternSpec dot_py("*.py");
if(dot_py.match(*file_it))
{
cout << "yes\n";
cout << "yes" << endl;
//strip extension
std::string policy_name = (*file_it).substr(0, (*file_it).size() - 3);
PythonCPUPolicy *pypolicy = new PythonCPUPolicy(policy_name.c_str());
try
{
PythonCPUPolicy *pypolicy = new PythonCPUPolicy(policy_name.c_str());
_policies.push_back(pypolicy);
_policies.push_back(pypolicy);
}
catch(MalformedPolicyException e)
{
// TODO do something here someday
}
}
else
cout << "no\n";
cout << "no" << endl;
}
}
}