aboutsummaryrefslogtreecommitdiff
path: root/python/dep_label.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-11 09:05:00 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-11 17:16:34 +0100
commitc04b6e52e6fb72b7db85a329e9d752b903d103ca (patch)
tree9ca9f05f387610b70e8c5f58400105d47fc7fdbf /python/dep_label.cc
parent4782eea70f1dcfabb3187f465f3f2a2ea290591a (diff)
downloadpaludis-c04b6e52e6fb72b7db85a329e9d752b903d103ca.tar.gz
paludis-c04b6e52e6fb72b7db85a329e9d752b903d103ca.tar.xz
labels track whether they're enabled
Diffstat (limited to 'python/dep_label.cc')
-rw-r--r--python/dep_label.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/python/dep_label.cc b/python/dep_label.cc
index 4f5d4c999..d01a2bfd6 100644
--- a/python/dep_label.cc
+++ b/python/dep_label.cc
@@ -22,11 +22,21 @@
#include <python/iterable.hh>
#include <paludis/dep_label.hh>
+#include <paludis/util/return_literal_function.hh>
using namespace paludis;
using namespace paludis::python;
namespace bp = boost::python;
+namespace
+{
+ template <typename T_>
+ T_ * make_concrete_dependencies_label(const std::string & t, const bool b)
+ {
+ return new T_(t, return_literal_function(b));
+ }
+}
+
template <typename L_>
struct class_concrete_uri_label :
bp::class_<L_, std::tr1::shared_ptr<L_>, bp::bases<URILabel>, boost::noncopyable>
@@ -52,9 +62,14 @@ struct class_concrete_dependencies_label :
(
name.c_str(),
"A concrete dependencies label class.",
- bp::init<const std::string &>("__init__(string)")
+ bp::no_init
)
{
+ def("__init__",
+ bp::make_constructor(&make_concrete_dependencies_label<L_>),
+ "__init__(String, bool)"
+ );
+
bp::implicitly_convertible<std::tr1::shared_ptr<L_>, std::tr1::shared_ptr<DependenciesLabel> >();
}
};