- Reduced verbosity of PythonPolicyManager`s policies collection process
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1060 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
c1d72439b5
commit
284490f271
|
@ -110,18 +110,20 @@ PythonCPUPolicyManager::collect_policies()
|
||||||
{
|
{
|
||||||
Glib::Dir dir(dir_it->c_str());
|
Glib::Dir dir(dir_it->c_str());
|
||||||
|
|
||||||
cout << "Opening directory " << *dir_it << " looking for python policies..." << endl;
|
#ifndef NDEBUG
|
||||||
|
std::clog << "Opening directory " << *dir_it << " looking for python policies..." << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (Glib::DirIterator file_it = dir.begin(); file_it != dir.end(); ++file_it)
|
for (Glib::DirIterator file_it = dir.begin(); file_it != dir.end(); ++file_it)
|
||||||
{
|
{
|
||||||
cout << "\tChecking if " << *file_it << " is a valid Python script... ";
|
|
||||||
|
|
||||||
Glib::PatternSpec dot_py("*.py");
|
Glib::PatternSpec dot_py("*.py");
|
||||||
|
|
||||||
if (dot_py.match(*file_it))
|
if (dot_py.match(*file_it))
|
||||||
{
|
{
|
||||||
cout << "yes" << endl;
|
#ifndef NDEBUG
|
||||||
|
std::clog << "\t" << *file_it << " is a valid Python script. Attempting to load... ";
|
||||||
|
#endif
|
||||||
//strip extension
|
//strip extension
|
||||||
std::string policy_name = (*file_it).substr(0, (*file_it).size() - 3);
|
std::string policy_name = (*file_it).substr(0, (*file_it).size() - 3);
|
||||||
|
|
||||||
|
@ -130,14 +132,16 @@ PythonCPUPolicyManager::collect_policies()
|
||||||
PythonCPUPolicy *pypolicy = new PythonCPUPolicy(policy_name.c_str());
|
PythonCPUPolicy *pypolicy = new PythonCPUPolicy(policy_name.c_str());
|
||||||
|
|
||||||
_policies.push_back(pypolicy);
|
_policies.push_back(pypolicy);
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
std::clog << "OK\n";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
catch (MalformedPolicyException e)
|
catch (const MalformedPolicyException& e)
|
||||||
{
|
{
|
||||||
std::cerr << "POLICY LOAD ERROR: " << e.what() << endl;
|
std::clog << "POLICY LOAD ERROR: " << e.what() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
cout << "no" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue