Advertisement
dan-masek

Untitled

Oct 10th, 2017
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. void reporting_manager::initialize_module_paths()
  2. {
  3.     common::script::python::scoped_gil_acquire unlocker;
  4.  
  5.     bp::object sys_module = bp::import("sys");
  6.  
  7.     for (uint32_t i(0); i < config_.module_dir_.size(); ++i) {
  8.         fs::path module_path = fs::absolute(config_.module_dir_[i]);
  9.         bp::str module_directory = module_path.generic_string().c_str();
  10.         sys_module.attr("path").attr("insert")(i, module_directory);
  11.         log::debug("reporting_manager", "Added Python module path '%s'"
  12.             , module_path.generic_string());
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement