16 #include <boost/python.hpp>
17 #include <boost/python/suite/indexing/vector_indexing_suite.hpp>
19 using namespace boost::python;
26 std::string classID(std::string
const & token) {
27 static std::string
const clid(
"CLID=");
30 return token.substr(s,e-s);
34 boost::shared_ptr<cond::ClassInfo> pyInfo(std::string
const & token) {
37 std::string pluginName = prefix + classID(token);
44 if (0==iov.
size())
return std::string();
45 return pyInfo(iov.
begin()->wrapperToken())->resource();
48 std::string moduleNameByToken(std::string
const & token) {
50 if (token.empty())
return std::string();
51 return pyInfo(token)->resource();
54 std::string moduleName(
cond::CondDB & db, std::string
const & ss) {
57 if (ss[0]==
'[')
return moduleNameByToken(ss);
58 return moduleNameByTag(db,ss);
68 PyErr_SetString(PyExc_RuntimeError, e.what());
75 return boost::python::make_tuple(
94 return boost::python::make_tuple(
104 void append2VS(std::vector<std::string> &
v, std::string s) {
110 return boost::python::make_tuple(l.first,l.second);
117 def(
"append2VS",&append2VS);
119 def(
"unpackTime",&unpackTime);
121 class_<cond::LogDBEntry>(
"LogDBEntry")
122 .
def(
"getState",getLogState)
137 class_<cond::TagMetadata>(
"TagEntry")
138 .
def(
"getState",getTagState)
146 class_<cond::GlobalTag >(
"GlobalTag", init<>())
151 class_<std::vector<std::string> >(
"VString")
152 .
def(vector_indexing_suite<std::vector<std::string> >())
155 class_<std::vector<float> >(
"VFloat")
156 .
def(vector_indexing_suite<std::vector<float> >())
159 class_<std::vector<int> >(
"VInt")
160 .
def(vector_indexing_suite<std::vector<int> >())
163 class_<cond::IOVElementProxy>(
"IOVElement", init<>())
169 enum_<cond::TimeType>(
"timetype")
176 class_<cond::IOVProxy>(
"IOV", init<>())
191 class_<cond::FWIncantation>(
"FWIncantation", init<>());
193 class_<cond::CondDB>(
"CondDB", init<>())
198 .def(
"moduleName",moduleName)
204 class_<cond::RDBMS>(
"RDBMS", init<>())
205 .def(init<std::string>())
206 .def(init<std::string, std::string>())
215 register_exception_translator<std::exception>(exceptionTranslator);
std::string const pythonIDCategory("CondPythonID")
CondDB getDB(std::string const &db)
IOVProxy iov(std::string const &tag) const
cond::LogDBEntry lastLogEntryOK(std::string const &tag) const
GlobalTag const & globalTag(std::string const &connstr, std::string const &gname, std::string const &prefix, std::string const &postfix) const
std::string comment() const
IOVProxy iovWithLib(std::string const &tag) const
cond::Time_t timestamp() const
const_iterator begin() const
cond::Time_t till() const
std::string destinationDB
std::string allTags() const
std::string payloadContainerName() const
const_iterator end() const
TimeType timetype() const
cond::LogDBEntry lastLogEntry(std::string const &tag) const
IOVElementProxy payLoad(std::string const &token) const
unsigned long long Time_t
std::string const & wrapperToken() const
std::string payloadContainer
cond::Time_t since() const
std::pair< unsigned int, unsigned int > UnpackedTime
BOOST_PYTHON_MODULE(pluginEcalPyUtils)
void setRange(cond::Time_t since, cond::Time_t till) const
CondDB getReadOnlyDB(std::string const &db)
tuple size
Write out results.
T get(const Candidate &c)
void setLogger(std::string const &connstr)
cond::UnpackedTime unpack(cond::Time_t iValue)