aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-10-14 10:15:06 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-10-14 10:15:06 +0000
commit7cebf851d7f4137d7a2ae519993b417863d4a7f4 (patch)
tree7e672f402e3e177c55e0a2d9da906b6856fbb075
parente2f9100bbb31b6061110ad4d41d72e4d125ca4eb (diff)
downloadpaludis-7cebf851d7f4137d7a2ae519993b417863d4a7f4.tar.gz
paludis-7cebf851d7f4137d7a2ae519993b417863d4a7f4.tar.xz
(python) Add Labels and support for MetadataSpecTreeKey<FetchableURISpecTree>.
More work on Formatters. Docs. Fixes: ticket:382
-rw-r--r--paludis/dep_tree.hh2
-rw-r--r--python/Makefile.am2
-rw-r--r--python/action.cc2
-rw-r--r--python/additional_tests.cc30
-rw-r--r--python/dep_label.cc216
-rwxr-xr-xpython/dep_label_TEST.py88
-rw-r--r--python/formatter.cc446
-rw-r--r--python/mask.cc112
-rw-r--r--python/metadata_key.cc263
-rwxr-xr-xpython/metadata_key_TEST.py44
-rw-r--r--python/nice_names.nn4
-rw-r--r--python/paludis_python.hh1
-rw-r--r--python/paludis_python_so.cc1
13 files changed, 1092 insertions, 119 deletions
diff --git a/paludis/dep_tree.hh b/paludis/dep_tree.hh
index ba9301e..34231d2 100644
--- a/paludis/dep_tree.hh
+++ b/paludis/dep_tree.hh
@@ -140,7 +140,7 @@ namespace paludis
{
/**
* A formatter that can handle any formattable type found in a
- * FetchableURIDepSpec.
+ * FetchableURISpecTree.
*
* \since 0.26
* \ingroup g_dep_spec
diff --git a/python/Makefile.am b/python/Makefile.am
index 3b8884c..d59e1ad 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -29,6 +29,7 @@ IF_PYTHON_TESTS = \
contents_TEST.py \
dep_spec_TEST.py \
dep_tag_TEST.py \
+ dep_label_TEST.py \
log_TEST.py \
name_TEST.py \
query_TEST.py \
@@ -52,6 +53,7 @@ IF_PYTHON_SOURCES = \
validated.hh \
action.cc \
contents.cc \
+ dep_label.cc \
dep_list.cc \
dep_spec.hh dep_spec.cc \
dep_tag.cc \
diff --git a/python/action.cc b/python/action.cc
index b04132a..1f19351 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -76,7 +76,7 @@ void expose_action()
enum_auto("InstallActionDebugOption", last_iado,
"Debug build mode for an InstallAction.\n\n"
"May be ignored by some repositories, and by packages where there\n"
- "isn't a sensible concept of debugging.\n");
+ "isn't a sensible concept of debugging.");
enum_auto("InstallActionChecksOption", last_iaco,
"Whether to run post-build checks (for example, 'make check' or 'src_test'),\n"
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index ef69e2d..5a35dcd 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -24,6 +24,7 @@
#include <paludis/util/tr1_memory.hh>
#include <paludis/util/set.hh>
#include <paludis/environment.hh>
+#include <paludis/environments/test/test_environment.hh>
#include <paludis/package_database.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
@@ -138,6 +139,7 @@ namespace metadata_key
{
m.raw_name();
m.human_name();
+ MetadataKeyType foo(m.type());
}
void test_metadata_package_id_key(MetadataPackageIDKey & m)
@@ -175,6 +177,23 @@ namespace metadata_key
{
test_metadata_key(m);
m.value();
+ StringifyFormatter ff;
+ m.pretty_print_flat(ff);
+ }
+
+ template <>
+ void test_metadata_set_key(MetadataSetKey<IUseFlagSet> & m)
+ {
+ test_metadata_key(m);
+ m.value();
+ StringifyFormatter ff;
+ m.pretty_print_flat(ff);
+
+ TestEnvironment e;
+ tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&e, RepositoryName("fakerepo")));
+ tr1::shared_ptr<PackageID> pid(repo->add_version("cat", "pkg", "1.0"));
+
+ m.pretty_print_flat_with_comparison(&e, pid, ff);
}
template <typename C_>
@@ -186,6 +205,17 @@ namespace metadata_key
m.pretty_print(ff);
m.pretty_print_flat(ff);
}
+
+ template <>
+ void test_metadata_spec_tree_key(MetadataSpecTreeKey<FetchableURISpecTree> & m)
+ {
+ test_metadata_key(m);
+ m.value();
+ StringifyFormatter ff;
+ m.pretty_print(ff);
+ m.pretty_print_flat(ff);
+ m.initial_label();
+ }
}
namespace formatter
diff --git a/python/dep_label.cc b/python/dep_label.cc
new file mode 100644
index 0000000..b97ddcc
--- /dev/null
+++ b/python/dep_label.cc
@@ -0,0 +1,216 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Piotr Jaroszyński <peper@gentoo.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <python/paludis_python.hh>
+#include <python/exception.hh>
+#include <python/iterable.hh>
+
+#include <paludis/dep_label.hh>
+
+using namespace paludis;
+using namespace paludis::python;
+namespace bp = boost::python;
+
+template <typename L_>
+struct class_concrete_uri_label :
+ bp::class_<L_, tr1::shared_ptr<L_>, bp::bases<URILabel>, boost::noncopyable>
+{
+ class_concrete_uri_label(const std::string & name) :
+ bp::class_<L_, tr1::shared_ptr<L_>, bp::bases<URILabel>, boost::noncopyable>
+ (
+ name.c_str(),
+ "A concrete URI label class.",
+ bp::init<const std::string &>("__init__(string)")
+ )
+ {
+ bp::implicitly_convertible<tr1::shared_ptr<L_>, tr1::shared_ptr<URILabel> >();
+ }
+};
+
+template <typename L_, typename C_>
+struct class_concrete_dependency_label :
+ bp::class_<L_, tr1::shared_ptr<L_>, bp::bases<C_>, boost::noncopyable>
+{
+ class_concrete_dependency_label(const std::string & name, const std::string & doc) :
+ bp::class_<L_, tr1::shared_ptr<L_>, bp::bases<C_>, boost::noncopyable>
+ (
+ name.c_str(),
+ doc.c_str(),
+ bp::init<const std::string &>("__init__(string)")
+ )
+ {
+ bp::implicitly_convertible<tr1::shared_ptr<L_>, tr1::shared_ptr<C_> >();
+ }
+};
+
+void expose_dep_label()
+{
+ /**
+ * URILabel
+ */
+ register_shared_ptrs_to_python<URILabel>();
+ bp::class_<URILabel, boost::noncopyable>
+ (
+ "URILabel",
+ "URI label base class.",
+ bp::no_init
+ )
+ .add_property("text", &URILabel::text,
+ "[ro] string\n"
+ "Our text."
+ )
+
+ .def("__str__", &URILabel::text)
+ ;
+
+ /**
+ * ConcreteURILabels
+ */
+ class_concrete_uri_label<URIMirrorsThenListedLabel>("URIMirrorsThenListedLabel");
+ class_concrete_uri_label<URIMirrorsOnlyLabel>("URIMirrorsOnlyLabel");
+ class_concrete_uri_label<URIListedOnlyLabel>("URIListedOnlyLabel");
+ class_concrete_uri_label<URIListedThenMirrorsLabel>("URIListedThenMirrorsLabel");
+ class_concrete_uri_label<URILocalMirrorsOnlyLabel>("URILocalMirrorsOnlyLabel");
+ class_concrete_uri_label<URIManualOnlyLabel>("URIManualOnlyLabel");
+
+ /**
+ * DependencyLabel
+ */
+ register_shared_ptrs_to_python<DependencyLabel>();
+ bp::class_<DependencyLabel, boost::noncopyable>
+ (
+ "DependencyLabel",
+ "Dependency label base class.",
+ bp::no_init
+ )
+ .add_property("text", &DependencyLabel::text,
+ "[ro] string\n"
+ "Our text."
+ )
+
+ .def("__str__", &DependencyLabel::text)
+ ;
+
+ /**
+ * DependencySystemLabel
+ */
+ bp::implicitly_convertible<tr1::shared_ptr<DependencySystemLabel>, tr1::shared_ptr<DependencyLabel> >();
+ register_shared_ptrs_to_python<DependencySystemLabel>();
+ bp::class_<DependencySystemLabel, bp::bases<DependencyLabel>, boost::noncopyable>
+ (
+ "DependencySystemLabel",
+ "System dependency label base class.",
+ bp::no_init
+ );
+
+ /**
+ * DependencyTypeLabel
+ */
+ bp::implicitly_convertible<tr1::shared_ptr<DependencyTypeLabel>, tr1::shared_ptr<DependencyLabel> >();
+ register_shared_ptrs_to_python<DependencyTypeLabel>();
+ bp::class_<DependencyTypeLabel, bp::bases<DependencyLabel>, boost::noncopyable>
+ (
+ "DependencyTypeLabel",
+ "Type dependency label base class.",
+ bp::no_init
+ );
+
+ /**
+ * DependencySuggestLabel
+ */
+ bp::implicitly_convertible<tr1::shared_ptr<DependencySuggestLabel>, tr1::shared_ptr<DependencyLabel> >();
+ register_shared_ptrs_to_python<DependencySuggestLabel>();
+ bp::class_<DependencySuggestLabel, bp::bases<DependencyLabel>, boost::noncopyable>
+ (
+ "DependencySuggestLabel",
+ "Suggest dependency label base class.",
+ bp::no_init
+ );
+
+ /**
+ * DependencyABIsLabel
+ */
+ bp::implicitly_convertible<tr1::shared_ptr<DependencyABIsLabel>, tr1::shared_ptr<DependencyLabel> >();
+ register_shared_ptrs_to_python<DependencyABIsLabel>();
+ bp::class_<DependencyABIsLabel, bp::bases<DependencyLabel>, boost::noncopyable>
+ (
+ "DependencyABIsLabel",
+ "ABI dependency label base class.",
+ bp::no_init
+ );
+
+ /**
+ * ConcreteDependencyLabels
+ */
+ class_concrete_dependency_label<DependencyHostLabel, DependencySystemLabel>
+ ("DependencyHostLabel",
+ "A DependencyHostLabel specifies host requirements for building a package.");
+
+ class_concrete_dependency_label<DependencyTargetLabel, DependencySystemLabel>
+ ("DependencyTargetLabel",
+ "A DependencyTargetLabel specifies target requirements for building a package.");
+
+ class_concrete_dependency_label<DependencyBuildLabel, DependencyTypeLabel>
+ ("DependencyBuildLabel",
+ "A DependencyBuildLabel specifies build-time requirements for building a package.");
+
+ class_concrete_dependency_label<DependencyRunLabel, DependencyTypeLabel>
+ ("DependencyRunLabel",
+ "A DependencyRunLabel specifies runtime requirements for building a package.");
+
+ class_concrete_dependency_label<DependencyInstallLabel, DependencyTypeLabel>
+ ("DependencyInstallLabel",
+ "A DependencyInstallLabel specifies install-time requirements for building a package.");
+
+ class_concrete_dependency_label<DependencyCompileLabel, DependencyTypeLabel>
+ ("DependencyCompileLabel",
+ "A DependencyCompileLabel specifies compiled-against requirements for building a package.");
+
+ class_concrete_dependency_label<DependencySuggestedLabel, DependencySuggestLabel>
+ ("DependencySuggestedLabel",
+ "A DependencySuggestLabel specifies that a dependency is suggested.");
+
+ class_concrete_dependency_label<DependencyRecommendedLabel, DependencySuggestLabel>
+ ("DependencyRecommendedLabel",
+ "A DependencyRecommendedLabel specifies that a dependency is recommended.");
+
+ class_concrete_dependency_label<DependencyRequiredLabel, DependencySuggestLabel>
+ ("DependencyRequiredLabel",
+ "* A DependencyRequiredLabel specifies that a dependency is required.");
+
+ class_concrete_dependency_label<DependencyAnyLabel, DependencyABIsLabel>
+ ("DependencyAnyLabel",
+ "A DependencyAnyLabel specifies that a dependency can be satisfied by\n"
+ "any ABI.");
+
+ class_concrete_dependency_label<DependencyMineLabel, DependencyABIsLabel>
+ ("DependencyMineLabel",
+ "A DependencyMineLabel specifies that a dependency is satisfied by\n"
+ "ABIs equal to those being used to create the depending package.");
+
+ class_concrete_dependency_label<DependencyPrimaryLabel, DependencyABIsLabel>
+ ("DependencyPrimaryLabel",
+ "A DependencyPrimaryLabel specifies that a dependency can be satisfied by\n"
+ "the primary ABI.");
+
+ class_concrete_dependency_label<DependencyABILabel, DependencyABIsLabel>
+ ("DependencyABILabel",
+ "A DependencyABILabel specifies that a dependency can be satisfied by\n"
+ "a named ABI.");
+}
diff --git a/python/dep_label_TEST.py b/python/dep_label_TEST.py
new file mode 100755
index 0000000..6fb17f6
--- /dev/null
+++ b/python/dep_label_TEST.py
@@ -0,0 +1,88 @@
+#!/usr/bin/env python
+# vim: set fileencoding=utf-8 sw=4 sts=4 et :
+
+#
+# Copyright (c) 2007 Piotr Jaroszyński <peper@gentoo.org>
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+from paludis import *
+import unittest
+
+class TestCase_01_URILabels(unittest.TestCase):
+ def setUp(self):
+ self.list = []
+ self.list.append(URIMirrorsThenListedLabel("foo"))
+ self.list.append(URIMirrorsOnlyLabel("foo"))
+ self.list.append(URIListedOnlyLabel("foo"))
+ self.list.append(URIListedThenMirrorsLabel("foo"))
+ self.list.append(URILocalMirrorsOnlyLabel("foo"))
+ self.list.append(URIManualOnlyLabel("foo"))
+
+ def test_01_no_create(self):
+ self.assertRaises(Exception, URILabel)
+
+ def test_02_inheritance(self):
+ for l in self.list:
+ self.assert_(isinstance(l, URILabel))
+
+ def test_03_text(self):
+ for l in self.list:
+ self.assert_(l.text, "foo")
+
+ def test_04_str(self):
+ for l in self.list:
+ self.assert_(str(l), "foo")
+
+class TestCase_02_DependencyLabels(unittest.TestCase):
+ def setUp(self):
+ self.list = []
+ self.list.append((DependencyHostLabel("foo"), DependencySystemLabel))
+ self.list.append((DependencyTargetLabel("foo"), DependencySystemLabel))
+ self.list.append((DependencyBuildLabel("foo"), DependencyTypeLabel))
+ self.list.append((DependencyRunLabel("foo"), DependencyTypeLabel))
+ self.list.append((DependencyInstallLabel("foo"), DependencyTypeLabel))
+ self.list.append((DependencyCompileLabel("foo"), DependencyTypeLabel))
+ self.list.append((DependencySuggestedLabel("foo"), DependencySuggestLabel))
+ self.list.append((DependencyRecommendedLabel("foo"), DependencySuggestLabel))
+ self.list.append((DependencyRequiredLabel("foo"), DependencySuggestLabel))
+ self.list.append((DependencyAnyLabel("foo"), DependencyABIsLabel))
+ self.list.append((DependencyMineLabel("foo"), DependencyABIsLabel))
+ self.list.append((DependencyPrimaryLabel("foo"), DependencyABIsLabel))
+ self.list.append((DependencyABILabel("foo"), DependencyABIsLabel))
+
+ def test_01_no_create(self):
+ self.assertRaises(Exception, DependencyLabel)
+ self.assertRaises(Exception, DependencySystemLabel)
+ self.assertRaises(Exception, DependencyTypeLabel)
+ self.assertRaises(Exception, DependencySuggestLabel)
+ self.assertRaises(Exception, DependencyABIsLabel)
+
+ def test_02_inheritance(self):
+ for t in self.list:
+ self.assert_(isinstance(t[0], DependencyLabel))
+ self.assert_(isinstance(t[0], t[1]))
+
+ def test_03_text(self):
+ for t in self.list:
+ self.assert_(t[0].text, "foo")
+
+ def test_04_str(self):
+ for t in self.list:
+ self.assert_(str(t[0]), "foo")
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/python/formatter.cc b/python/formatter.cc
index cf0ae38..cdd85a7 100644
--- a/python/formatter.cc
+++ b/python/formatter.cc
@@ -24,8 +24,10 @@
#include <python/nice_names-nn.hh>
#include <paludis/formatter.hh>
+#include <paludis/stringify_formatter.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/dep_tree.hh>
using namespace paludis;
using namespace paludis::python;
@@ -67,6 +69,11 @@ struct PythonCanFormat<T_, format::PlainRoles> :
{
return do_format(t, f);
}
+
+ std::string format_plain(const T_ & t) const
+ {
+ return format(t, format::Plain());
+ }
};
template <typename T_>
@@ -88,6 +95,21 @@ struct PythonCanFormat<T_, format::AcceptableRoles> :
{
return do_format(t, f);
}
+
+ std::string format_plain(const T_ & t) const
+ {
+ return format(t, format::Plain());
+ }
+
+ std::string format_accepted(const T_ & t) const
+ {
+ return format(t, format::Accepted());
+ }
+
+ std::string format_unaccepted(const T_ & t) const
+ {
+ return format(t, format::Unaccepted());
+ }
};
template <typename T_>
@@ -119,6 +141,31 @@ struct PythonCanFormat<T_, format::UseRoles> :
{
return do_format(t, f);
}
+
+ std::string format_plain(const T_ & t) const
+ {
+ return format(t, format::Plain());
+ }
+
+ std::string format_enabled(const T_ & t) const
+ {
+ return format(t, format::Enabled());
+ }
+
+ std::string format_disabled(const T_ & t) const
+ {
+ return format(t, format::Disabled());
+ }
+
+ std::string format_forced(const T_ & t) const
+ {
+ return format(t, format::Forced());
+ }
+
+ std::string format_masked(const T_ & t) const
+ {
+ return format(t, format::Masked());
+ }
};
template <typename T_>
@@ -174,6 +221,41 @@ struct PythonCanFormat<T_, format::IUseRoles> :
{
return do_decorate(t, s, f);
}
+
+ std::string format_plain(const T_ & t) const
+ {
+ return format(t, format::Plain());
+ }
+
+ std::string format_enabled(const T_ & t) const
+ {
+ return format(t, format::Enabled());
+ }
+
+ std::string format_disabled(const T_ & t) const
+ {
+ return format(t, format::Disabled());
+ }
+
+ std::string format_forced(const T_ & t) const
+ {
+ return format(t, format::Forced());
+ }
+
+ std::string format_masked(const T_ & t) const
+ {
+ return format(t, format::Masked());
+ }
+
+ std::string decorate_added(const T_ & t, const std::string & s) const
+ {
+ return decorate(t, s, format::Added());
+ }
+
+ std::string decorate_changed(const T_ & t, const std::string & s) const
+ {
+ return decorate(t, s, format::Changed());
+ }
};
template <typename T_>
@@ -181,20 +263,35 @@ struct PythonCanFormat<T_, format::PackageRoles> :
CanFormat<T_>,
PythonCanFormatBase<T_>
{
- virtual std::string format(const T_ & t, const format::Plain & f) const
+ std::string format(const T_ & t, const format::Plain & f) const
{
return do_format(t, f);
}
- virtual std::string format(const T_ & t, const format::Installed & f) const
+ std::string format(const T_ & t, const format::Installed & f) const
{
return do_format(t, f);
}
- virtual std::string format(const T_ & t, const format::Installable & f) const
+ std::string format(const T_ & t, const format::Installable & f) const
{
return do_format(t, f);
}
+
+ std::string format_plain(const T_ & t) const
+ {
+ return format(t, format::Plain());
+ }
+
+ std::string format_installed(const T_ & t) const
+ {
+ return format(t, format::Installed());
+ }
+
+ std::string format_installable(const T_ & t) const
+ {
+ return format(t, format::Installable());
+ }
};
template <typename T_>
@@ -269,135 +366,276 @@ class PythonFormatterWrapper :
void expose_formatter()
{
+
+ /**
+ * CanFormatString
+ */
+ std::string (PythonCanFormatWrapper<std::string>::* format_string_plain)
+ (const std::string &) const = &PythonCanFormatWrapper<std::string>::format_plain;
+
+ bp::class_<PythonCanFormatWrapper<std::string>, boost::noncopyable>
+ (
+ "CanFormatString",
+ "Descendents of this class implement the necessary methods to format a String.",
+ bp::init<>("__init__()")
+ )
+ .def("format_string_plain", format_string_plain)
+ ;
+
/**
* CanFormatUseFlagName
*/
+ std::string (PythonCanFormatWrapper<UseFlagName>::* format_use_flag_name_plain)
+ (const UseFlagName &) const = &PythonCanFormatWrapper<UseFlagName>::format_plain;
+ std::string (PythonCanFormatWrapper<UseFlagName>::* format_use_flag_name_enabled)
+ (const UseFlagName &) const = &PythonCanFormatWrapper<UseFlagName>::format_enabled;
+ std::string (PythonCanFormatWrapper<UseFlagName>::* format_use_flag_name_disabled)
+ (const UseFlagName &) const = &PythonCanFormatWrapper<UseFlagName>::format_disabled;
+ std::string (PythonCanFormatWrapper<UseFlagName>::* format_use_flag_name_forced)
+ (const UseFlagName &) const = &PythonCanFormatWrapper<UseFlagName>::format_forced;
+ std::string (PythonCanFormatWrapper<UseFlagName>::* format_use_flag_name_masked)
+ (const UseFlagName &) const = &PythonCanFormatWrapper<UseFlagName>::format_masked;
+
bp::class_<PythonCanFormatWrapper<UseFlagName>, boost::noncopyable>
(
"CanFormatUseFlagName",
"Descendents of this class implement the necessary methods to format a UseFlagName.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_use_flag_name_plain", format_use_flag_name_plain)
+ .def("format_use_flag_name_enabled", format_use_flag_name_enabled)
+ .def("format_use_flag_name_disabled", format_use_flag_name_disabled)
+ .def("format_use_flag_name_forced", format_use_flag_name_forced)
+ .def("format_use_flag_name_masked", format_use_flag_name_masked)
+ ;
/**
* CanFormatIUseFlag
*/
+ std::string (PythonCanFormatWrapper<IUseFlag>::* format_iuse_flag_plain)
+ (const IUseFlag &) const = &PythonCanFormatWrapper<IUseFlag>::format_plain;
+ std::string (PythonCanFormatWrapper<IUseFlag>::* format_iuse_flag_enabled)
+ (const IUseFlag &) const = &PythonCanFormatWrapper<IUseFlag>::format_enabled;
+ std::string (PythonCanFormatWrapper<IUseFlag>::* format_iuse_flag_disabled)
+ (const IUseFlag &) const = &PythonCanFormatWrapper<IUseFlag>::format_disabled;
+ std::string (PythonCanFormatWrapper<IUseFlag>::* format_iuse_flag_forced)
+ (const IUseFlag &) const = &PythonCanFormatWrapper<IUseFlag>::format_forced;
+ std::string (PythonCanFormatWrapper<IUseFlag>::* format_iuse_flag_masked)
+ (const IUseFlag &) const = &PythonCanFormatWrapper<IUseFlag>::format_masked;
+ std::string (PythonCanFormatWrapper<IUseFlag>::* decorate_iuse_flag_added)
+ (const IUseFlag &, const std::string &) const = &PythonCanFormatWrapper<IUseFlag>::decorate_added;
+ std::string (PythonCanFormatWrapper<IUseFlag>::* decorate_iuse_flag_changed)
+ (const IUseFlag &, const std::string &) const = &PythonCanFormatWrapper<IUseFlag>::decorate_changed;
+
bp::class_<PythonCanFormatWrapper<IUseFlag>, boost::noncopyable>
(
"CanFormatIUseFlag",
"Descendents of this class implement the necessary methods to format a IUseFlag.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_iuse_flag_plain", format_iuse_flag_plain)
+ .def("format_iuse_flag_enabled", format_iuse_flag_enabled)
+ .def("format_iuse_flag_disabled", format_iuse_flag_disabled)
+ .def("format_iuse_flag_forced", format_iuse_flag_forced)
+ .def("format_iuse_flag_masked", format_iuse_flag_masked)
+ .def("decorate_iuse_flag_added", decorate_iuse_flag_added)
+ .def("decorate_iuse_flag_changed", decorate_iuse_flag_changed)
+ ;
/**
* CanFormatKeywordName
*/
+ std::string (PythonCanFormatWrapper<KeywordName>::* format_keyword_name_plain)
+ (const KeywordName &) const = &PythonCanFormatWrapper<KeywordName>::format_plain;
+ std::string (PythonCanFormatWrapper<KeywordName>::* format_keyword_name_accepted)
+ (const KeywordName &) const = &PythonCanFormatWrapper<KeywordName>::format_accepted;
+ std::string (PythonCanFormatWrapper<KeywordName>::* format_keyword_name_unaccepted)
+ (const KeywordName &) const = &PythonCanFormatWrapper<KeywordName>::format_unaccepted;
+
bp::class_<PythonCanFormatWrapper<KeywordName>, boost::noncopyable>
(
"CanFormatKeywordName",
"Descendents of this class implement the necessary methods to format a KeywordName.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_keyword_name_plain", format_keyword_name_plain)
+ .def("format_keyword_name_accepted", format_keyword_name_accepted)
+ .def("format_keyword_name_unaccepted", format_keyword_name_unaccepted)
+ ;
/**
* CanFormatPackageDepSpec
*/
+ std::string (PythonCanFormatWrapper<PackageDepSpec>::* format_package_dep_spec_plain)
+ (const PackageDepSpec &) const = &PythonCanFormatWrapper<PackageDepSpec>::format_plain;
+ std::string (PythonCanFormatWrapper<PackageDepSpec>::* format_package_dep_spec_installed)
+ (const PackageDepSpec &) const = &PythonCanFormatWrapper<PackageDepSpec>::format_installed;
+ std::string (PythonCanFormatWrapper<PackageDepSpec>::* format_package_dep_spec_installable)
+ (const PackageDepSpec &) const = &PythonCanFormatWrapper<PackageDepSpec>::format_installable;
+
bp::class_<PythonCanFormatWrapper<PackageDepSpec>, boost::noncopyable>
(
"CanFormatPackageDepSpec",
"Descendents of this class implement the necessary methods to format a PackageDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_package_dep_spec_plain", format_package_dep_spec_plain)
+ .def("format_package_dep_spec_installed", format_package_dep_spec_installed)
+ .def("format_package_dep_spec_installable", format_package_dep_spec_installable)
+ ;
/**
* CanFormatBlockDepSpec
*/
+ std::string (PythonCanFormatWrapper<BlockDepSpec>::* format_block_dep_spec_plain)
+ (const BlockDepSpec &) const = &PythonCanFormatWrapper<BlockDepSpec>::format_plain;
+
bp::class_<PythonCanFormatWrapper<BlockDepSpec>, boost::noncopyable>
(
"CanFormatBlockDepSpec",
"Descendents of this class implement the necessary methods to format a BlockDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_block_dep_spec_plain", format_block_dep_spec_plain)
+ ;
/**
* CanFormatFetchableURIDepSpec
*/
+ std::string (PythonCanFormatWrapper<FetchableURIDepSpec>::* format_fetchable_uri_dep_spec_plain)
+ (const FetchableURIDepSpec &) const = &PythonCanFormatWrapper<FetchableURIDepSpec>::format_plain;
+
bp::class_<PythonCanFormatWrapper<FetchableURIDepSpec>, boost::noncopyable>
(
"CanFormatFetchableURIDepSpec",
"Descendents of this class implement the necessary methods to format a FetchableURIDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_fetchable_uri_dep_spec_plain", format_fetchable_uri_dep_spec_plain)
+ ;
/**
* CanFormatSimpleURIDepSpec
*/
+ std::string (PythonCanFormatWrapper<SimpleURIDepSpec>::* format_simple_uri_dep_spec_plain)
+ (const SimpleURIDepSpec &) const = &PythonCanFormatWrapper<SimpleURIDepSpec>::format_plain;
+
bp::class_<PythonCanFormatWrapper<SimpleURIDepSpec>, boost::noncopyable>
(
"CanFormatSimpleURIDepSpec",
"Descendents of this class implement the necessary methods to format a SimpleURIDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_simple_uri_dep_spec_plain", format_simple_uri_dep_spec_plain)
+ ;
/**
* CanFormatDependencyLabelsDepSpec
*/
+ std::string (PythonCanFormatWrapper<DependencyLabelsDepSpec>::* format_dependency_labels_dep_spec_plain)
+ (const DependencyLabelsDepSpec &) const = &PythonCanFormatWrapper<DependencyLabelsDepSpec>::format_plain;
+
bp::class_<PythonCanFormatWrapper<DependencyLabelsDepSpec>, boost::noncopyable>
(
"CanFormatDependencyLabelsDepSpec",
"Descendents of this class implement the necessary methods to format a DependencyLabelsDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_dependency_labels_dep_spec_plain", format_dependency_labels_dep_spec_plain)
+ ;
/**
* CanFormatURILabelsDepSpec
*/
+ std::string (PythonCanFormatWrapper<URILabelsDepSpec>::* format_uri_labels_dep_spec_plain)
+ (const URILabelsDepSpec &) const = &PythonCanFormatWrapper<URILabelsDepSpec>::format_plain;
+
bp::class_<PythonCanFormatWrapper<URILabelsDepSpec>, boost::noncopyable>
(
"CanFormatURILabelsDepSpec",
"Descendents of this class implement the necessary methods to format an URILabelsDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_uri_labels_dep_spec_plain", format_uri_labels_dep_spec_plain)
+ ;
/**
* CanFormatPlainTextDepSpec
*/
+ std::string (PythonCanFormatWrapper<PlainTextDepSpec>::* format_plain_text_dep_spec_plain)
+ (const PlainTextDepSpec &) const = &PythonCanFormatWrapper<PlainTextDepSpec>::format_plain;
+
bp::class_<PythonCanFormatWrapper<PlainTextDepSpec>, boost::noncopyable>
(
"CanFormatPlainTextDepSpec",
"Descendents of this class implement the necessary methods to format a PlainTextDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_plain_text_dep_spec_plain", format_plain_text_dep_spec_plain)
+ ;
/**
* CanFormatLicenseDepSpec
*/
+ std::string (PythonCanFormatWrapper<LicenseDepSpec>::* format_license_dep_spec_plain)
+ (const LicenseDepSpec &) const = &PythonCanFormatWrapper<LicenseDepSpec>::format_plain;
+ std::string (PythonCanFormatWrapper<LicenseDepSpec>::* format_license_dep_spec_accepted)
+ (const LicenseDepSpec &) const = &PythonCanFormatWrapper<LicenseDepSpec>::format_accepted;
+ std::string (PythonCanFormatWrapper<LicenseDepSpec>::* format_license_dep_spec_unaccepted)
+ (const LicenseDepSpec &) const = &PythonCanFormatWrapper<LicenseDepSpec>::format_unaccepted;
+
bp::class_<PythonCanFormatWrapper<LicenseDepSpec>, boost::noncopyable>
(
"CanFormatLicenseDepSpec",
"Descendents of this class implement the necessary methods to format a LicenseDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_license_dep_spec_plain", format_license_dep_spec_plain)
+ .def("format_license_dep_spec_accepted", format_license_dep_spec_accepted)
+ .def("format_license_dep_spec_unaccepted", format_license_dep_spec_unaccepted)
+ ;
/**
* CanFormatUseDepSpec
*/
+ std::string (PythonCanFormatWrapper<UseDepSpec>::* format_use_dep_spec_plain)
+ (const UseDepSpec &) const = &PythonCanFormatWrapper<UseDepSpec>::format_plain;
+ std::string (PythonCanFormatWrapper<UseDepSpec>::* format_use_dep_spec_enabled)
+ (const UseDepSpec &) const = &PythonCanFormatWrapper<UseDepSpec>::format_enabled;
+ std::string (PythonCanFormatWrapper<UseDepSpec>::* format_use_dep_spec_disabled)
+ (const UseDepSpec &) const = &PythonCanFormatWrapper<UseDepSpec>::format_disabled;
+ std::string (PythonCanFormatWrapper<UseDepSpec>::* format_use_dep_spec_forced)
+ (const UseDepSpec &) const = &PythonCanFormatWrapper<UseDepSpec>::format_forced;
+ std::string (PythonCanFormatWrapper<UseDepSpec>::* format_use_dep_spec_masked)
+ (const UseDepSpec &) const = &PythonCanFormatWrapper<UseDepSpec>::format_masked;
+
bp::class_<PythonCanFormatWrapper<UseDepSpec>, boost::noncopyable>
(
"CanFormatUseDepSpec",
"Descendents of this class implement the necessary methods to format a UseDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_use_dep_spec_plain", format_use_dep_spec_plain)
+ .def("format_use_dep_spec_enabled", format_use_dep_spec_enabled)
+ .def("format_use_dep_spec_disabled", format_use_dep_spec_disabled)
+ .def("format_use_dep_spec_forced", format_use_dep_spec_forced)
+ .def("format_use_dep_spec_masked", format_use_dep_spec_masked)
+ ;
/**
* CanFormatNamedSetDepSpec
*/
+ std::string (PythonCanFormatWrapper<NamedSetDepSpec>::* format_named_set_dep_spec_plain)
+ (const NamedSetDepSpec &) const = &PythonCanFormatWrapper<NamedSetDepSpec>::format_plain;
+
bp::class_<PythonCanFormatWrapper<NamedSetDepSpec>, boost::noncopyable>
(
"CanFormatNamedSetDepSpec",
"Descendents of this class implement the necessary methods to format a NamedSetDepSpec.",
bp::init<>("__init__()")
- );
+ )
+ .def("format_named_set_dep_spec_plain", format_named_set_dep_spec_plain)
+ ;
/**
* CanSpace
@@ -407,6 +645,182 @@ void expose_formatter()
"CanSpace",
"Descendents of this class implement the necessary methods to format whitespace.",
bp::init<>("__init__()")
+ )
+ .def("newline", &CanSpace::newline,
+ "newline() -> string\n"
+ "Output a newline."
+ )
+
+ .def("indent", &CanSpace::newline,
+ "indent(int) -> string\n"
+ "Output an indent marker of the specified indent level."
+ )
+ ;
+
+ /**
+ * StringFormatter
+ */
+ bp::class_<Formatter<std::string>, bp::bases<CanFormat<std::string> >, boost::noncopyable>
+ (
+ "StringFormatter",
+ "A formatter that can handle Strings.",
+ bp::no_init
+ );
+
+ /**
+ * KeywordNameFormatter
+ */
+ bp::class_<Formatter<KeywordName>, bp::bases<CanFormat<KeywordName> >, boost::noncopyable>
+ (
+ "KeywordNameFormatter",
+ "A formatter that can handle KeywordNames.",
+ bp::no_init
+ );
+
+ /**
+ * UseFlagNameFormatter
+ */
+ bp::class_<Formatter<UseFlagName>, bp::bases<CanFormat<UseFlagName> >, boost::noncopyable>
+ (
+ "UseFlagNameFormatter",
+ "A formatter that can handle UseFlagNames.",
+ bp::no_init
+ );
+
+ /**
+ * IUseFlagFormatter
+ */
+ bp::class_<Formatter<IUseFlag>, bp::bases<CanFormat<IUseFlag> >, boost::noncopyable>
+ (
+ "IUseFlagFormatter",
+ "A formatter that can handle IUseFlags.",
+ bp::no_init
+ );
+
+ /**
+ * LicenseSpecTreeFormatter
+ */
+ bp::class_<LicenseSpecTree::ItemFormatter,
+ bp::bases<
+ CanFormat<UseDepSpec>,
+ CanFormat<LicenseDepSpec> >,
+ boost::noncopyable>
+ (
+ "LicenseSpecTreeFormatter",
+ "A formatter that can handle any formattable type found in a\n"
+ "LicenseSpecTree.",
+ bp::no_init
+ );
+
+ /**
+ * ProvideSpecTreeFormatter
+ */
+ bp::class_<ProvideSpecTree::ItemFormatter,
+ bp::bases<
+ CanFormat<UseDepSpec>,
+ CanFormat<PackageDepSpec> >,
+ boost::noncopyable>
+ (
+ "ProvideSpecTreeFormatter",
+ "A formatter that can handle any formattable type found in a\n"
+ "ProvideSpecTree.",
+ bp::no_init
+ );
+
+ /**
+ * DependencySpecTreeFormatter
+ */
+ bp::class_<DependencySpecTree::ItemFormatter,
+ bp::bases<
+ CanFormat<UseDepSpec>,
+ CanFormat<PackageDepSpec>,
+ CanFormat<NamedSetDepSpec>,
+ CanFormat<DependencyLabelsDepSpec> >,
+ boost::noncopyable>
+ (
+ "DependencySpecTreeFormatter",
+ "A formatter that can handle any formattable type found in a\n"
+ "DependencySpecTree.",
+ bp::no_init
+ );
+
+ /**
+ * RestrictSpecTreeFormatter
+ */
+ bp::class_<RestrictSpecTree::ItemFormatter,
+ bp::bases<
+ CanFormat<UseDepSpec>,
+ CanFormat<PlainTextDepSpec> >,
+ boost::noncopyable>
+ (
+ "RestrictSpecTreeFormatter",
+ "A formatter that can handle any formattable type found in a\n"
+ "RestrictSpecTree.",
+ bp::no_init
+ );
+
+ /**
+ * SimpleURISpecTreeFormatter
+ */
+ bp::class_<SimpleURISpecTree::ItemFormatter,
+ bp::bases<
+ CanFormat<UseDepSpec>,
+ CanFormat<SimpleURIDepSpec> >,
+ boost::noncopyable>
+ (
+ "SimpleURISpecTreeFormatter",
+ "A formatter that can handle any formattable type found in a\n"
+ "SimpleURISpecTree.",
+ bp::no_init
+ );
+
+ /**
+ * FetchableURISpecTreeFormatter
+ */
+ bp::class_<FetchableURISpecTree::ItemFormatter,
+ bp::bases<
+ CanFormat<UseDepSpec>,
+ CanFormat<FetchableURIDepSpec>,
+ CanFormat<URILabelsDepSpec> >,
+ boost::noncopyable>
+ (
+ "FetchableURISpecTreeFormatter",
+ "A formatter that can handle any formattable type found in a\n"
+ "FetchableURISpecTree.",
+ bp::no_init
+ );
+
+ /**
+ * StringifyFormatter
+ */
+ bp::class_<StringifyFormatter,
+ bp::bases<
+ CanFormat<UseFlagName>,
+ CanFormat<IUseFlag>,
+ CanFormat<KeywordName>,
+ CanFormat<PackageDepSpec>,
+ CanFormat<BlockDepSpec>,
+ CanFormat<FetchableURIDepSpec>,
+ CanFormat<SimpleURIDepSpec>,
+ CanFormat<DependencyLabelsDepSpec>,
+ CanFormat<URILabelsDepSpec>,
+ CanFormat<PlainTextDepSpec>,
+ CanFormat<LicenseDepSpec>,
+ CanFormat<UseDepSpec>,
+ CanFormat<NamedSetDepSpec>,
+ CanSpace>,
+ boost::noncopyable>
+ (
+ "StringifyFormatter",
+ "A StringifyFormatter is a Formatter that implements every format function\n"
+ "by calling paludis::stringify().\n\n"
+
+ "Indenting is done via simple spaces; newlines are done via a newline\n"
+ "character. Again, when used as a wrapper, this can be overridden by the\n"
+ "wrapped class.\n\n"
+
+ "This class can be subclassed in Python.",
+ bp::init<>("__init__()")
);
/**
diff --git a/python/mask.cc b/python/mask.cc
index f571a3c..5789a9b 100644
--- a/python/mask.cc
+++ b/python/mask.cc
@@ -290,13 +290,13 @@ void expose_mask()
.add_property("mask_file", bp::make_getter(&RepositoryMaskInfo::mask_file,
bp::return_value_policy<bp::return_by_value>()),
"[ro] str\n"
- "NEED_DOC"
+ "Holds the file whence the mask originates."
)
.add_property("comment", bp::make_getter(&RepositoryMaskInfo::comment,
bp::return_value_policy<bp::return_by_value>()),
"[ro] Iterable of str\n"
- "NEED_DOC"
+ "Sequence of lines explaining the mask."
)
;
@@ -308,17 +308,28 @@ void expose_mask()
bp::class_<MaskWrapper, boost::noncopyable>
(
"Mask",
- "NEED_DOC",
+ "A Mask represents one reason why a PackageID is masked (not available to\n"
+ "be installed).\n\n"
+
+ "A basic Mask has:\n\n"
+
+ "- A single character key, which can be used by clients if they need a\n"
+ " very compact way of representing a mask.\n\n"
+
+ "- A description.\n\n"
+
+ "Subclasses provide additional information.",
bp::no_init
)
.def("key", bp::pure_virtual(&Mask::key),
"key() -> string\n"
- "NEED_DOC"
+ "A single character key, which can be used by clients if they need\n"
+ "a very compact way of representing a mask."
)
.def("description", bp::pure_virtual(&Mask::description),
"description() -> string\n"
- "NEED_DOC"
+ "A description of the mask."
)
;
@@ -331,17 +342,20 @@ void expose_mask()
bp::bases<Mask>, boost::noncopyable>
(
"UserMask",
- "NEED_DOC",
+ "A UserMask is a Mask due to user configuration.\n\n"
+
+ "Can be subclassed in Python.",
bp::init<>()
)
.def("key", bp::pure_virtual(&Mask::key),
- "[ro] str\n"
- "NEED_DOC"
+ "key() -> string\n"
+ "A single character key, which can be used by clients if they need\n"
+ "a very compact way of representing a mask."
)
.def("description", bp::pure_virtual(&Mask::description),
- "[ro] str\n"
- "NEED_DOC"
+ "description() -> string\n"
+ "A description of the mask."
)
;
@@ -354,22 +368,27 @@ void expose_mask()
bp::bases<Mask>, boost::noncopyable>
(
"UnacceptedMask",
- "NEED_DOC",
+ "An UnacceptedMask is a Mask that signifies that a particular value or\n"
+ "combination of values in (for example) a MetadataSetKey or\n"
+ "MetadataSpecTreeKey is not accepted by user configuration.\n\n"
+
+ "Can be subclassed in Python.",
bp::init<>()
)
.def("unaccepted_key", bp::pure_virtual(&UnacceptedMask::unaccepted_key),
- "[ro] MetadataKey\n"
- "NEED_DOC"
+ "unaccepted_key() -> MetadataKey\n"
+ "Fetch the metadata key that is not accepted."
)
.def("key", bp::pure_virtual(&Mask::key),
- "[ro] str\n"
- "NEED_DOC"
+ "key() -> string\n"
+ "A single character key, which can be used by clients if they need\n"
+ "a very compact way of representing a mask."
)
.def("description", bp::pure_virtual(&Mask::description),
- "[ro] str\n"
- "NEED_DOC"
+ "description() -> string\n"
+ "A description of the mask."
)
;
@@ -382,22 +401,27 @@ void expose_mask()
bp::bases<Mask>, boost::noncopyable>
(
"RepositoryMask",
- "NEED_DOC",
+ "A RepositoryMask is a Mask that signifies that a PackageID has been\n"
+ "marked as masked by a Repository.\n\n"
+
+ "Can be subclassed in Python.",
bp::init<>()
)
.def("mask_key", bp::pure_virtual(&RepositoryMask::mask_key),
- "[ro] MetadataKey\n"
- "NEED_DOC"
+ "mask_key() -> MetadataKey\n"
+ "Fetch a metadata key explaining the mask. May return None,\n"
+ "if no more information is available."
)
.def("key", bp::pure_virtual(&Mask::key),
- "[ro] str\n"
- "NEED_DOC"
+ "key() -> string\n"
+ "A single character key, which can be used by clients if they need\n"
+ "a very compact way of representing a mask."
)
.def("description", bp::pure_virtual(&Mask::description),
- "[ro] str\n"
- "NEED_DOC"
+ "description() -> string\n"
+ "A description of the mask."
)
;
@@ -410,22 +434,27 @@ void expose_mask()
bp::bases<Mask>, boost::noncopyable>
(
"UnsupportedMask",
- "NEED_DOC",
+ "An UnsupportedMask is a Mask that signifies that a PackageID is not\n"
+ "supported, for example because it is broken or because it uses an\n"
+ "unrecognised EAPI.\n\n"
+
+ "Can be subclassed in Python.",
bp::init<>()
)
.def("explanation", bp::pure_virtual(&UnsupportedMask::explanation),
- "[ro] str\n"
- "NEED_DOC"
+ "explanation() -> str\n"
+ "An explanation of why we are unsupported."
)
.def("key", bp::pure_virtual(&Mask::key),
- "[ro] str\n"
- "NEED_DOC"
+ "key() -> string\n"
+ "A single character key, which can be used by clients if they need\n"
+ "a very compact way of representing a mask."
)
.def("description", bp::pure_virtual(&Mask::description),
- "[ro] str\n"
- "NEED_DOC"
+ "description() -> string\n"
+ "A description of the mask."
)
;
@@ -438,22 +467,29 @@ void expose_mask()
bp::bases<Mask>, boost::noncopyable>
(
"AssociationMask",
- "NEED_DOC",
+ "An AssociationMask is a Mask that signifies that a PackageID is masked\n"
+ "because of its association with another PackageID that is itself masked.\n\n"
+
+ "This is used by old-style virtuals. If the provider of a virtual is\n"
+ "masked then the virtual itself is masked by association.\n\n"
+
+ "Can be subclassed in Python.",
bp::init<>()
)
.def("associated_package", bp::pure_virtual(&AssociationMask::associated_package),
- "[ro] PackageID\n"
- "NEED_DOC"
+ "associated_package() -> PackageID\n"
+ "Fetch the associated package."
)
.def("key", bp::pure_virtual(&Mask::key),
- "[ro] str\n"
- "NEED_DOC"
+ "key() -> string\n"
+ "A single character key, which can be used by clients if they need\n"
+ "a very compact way of representing a mask."
)
.def("description", bp::pure_virtual(&Mask::description),
- "[ro] str\n"
- "NEED_DOC"
+ "description() -> string\n"
+ "A description of the mask."
)
;
}
diff --git a/python/metadata_key.cc b/python/metadata_key.cc
index 90c4dfb..93cf650 100644
--- a/python/metadata_key.cc
+++ b/python/metadata_key.cc
@@ -24,9 +24,9 @@
#include <paludis/name.hh>
#include <paludis/formatter.hh>
#include <paludis/dep_label.hh>
+#include <paludis/environment.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/visitor-impl.hh>
-#include <paludis/util/join.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
@@ -298,13 +298,15 @@ struct MetadataSetKeyWrapper :
throw PythonMethodNotImplemented("MetadataSetKey", "value");
}
- std::string pretty_print_flat(const Formatter<typename C_::value_type> &) const
+ std::string pretty_print_flat(const Formatter<typename C_::value_type> & formatter) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
Lock l(get_mutex());
- /* todo: make an override */
- return join(value()->begin(), value()->end(), " ");
+ if (bp::override f = this->get_override("pretty_print_flat"))
+ return f(boost::cref(formatter));
+ else
+ throw PythonMethodNotImplemented("MetadataSetKey", "pretty_print_flat");
}
};
@@ -329,25 +331,29 @@ struct MetadataSetKeyWrapper<IUseFlagSet> :
throw PythonMethodNotImplemented("MetadataSetKey", "value");
}
- std::string pretty_print_flat(const Formatter<IUseFlag> &) const
+ std::string pretty_print_flat(const Formatter<IUseFlag> & formatter) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
Lock l(get_mutex());
- /* todo: make an override */
- return join(value()->begin(), value()->end(), " ");
+ if (bp::override f = this->get_override("pretty_print_flat"))
+ return f(boost::cref(formatter));
+ else
+ throw PythonMethodNotImplemented("MetadataSetKey", "pretty_print_flat");
}
std::string pretty_print_flat_with_comparison(
- const Environment * const,
- const tr1::shared_ptr<const PackageID> &,
- const Formatter<IUseFlag> &) const
+ const Environment * const e,
+ const tr1::shared_ptr<const PackageID> & pid,
+ const Formatter<IUseFlag> & formatter) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
Lock l(get_mutex());
- /* todo: make an override */
- return join(value()->begin(), value()->end(), " ");
+ if (bp::override f = this->get_override("pretty_print_flat_with_comparison"))
+ return f(boost::cref(e), pid, boost::cref(formatter));
+ else
+ throw PythonMethodNotImplemented("MetadataSetKey", "pretty_print_flat_with_comparison");
}
};
@@ -372,26 +378,24 @@ struct MetadataSpecTreeKeyWrapper :
throw PythonMethodNotImplemented("MetadataSpecTreeKey", "value");
}
- virtual std::string pretty_print(const typename C_::ItemFormatter &) const
+ virtual std::string pretty_print(const typename C_::ItemFormatter & formatter) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
Lock l(get_mutex());
- // todo: use the formatter
if (bp::override f = this->get_override("pretty_print"))
- return f();
+ return f(boost::cref(formatter));
else
throw PythonMethodNotImplemented("MetadataSpecTreeKey", "pretty_print");
}
- virtual std::string pretty_print_flat(const typename C_::ItemFormatter &) const
+ virtual std::string pretty_print_flat(const typename C_::ItemFormatter & formatter) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
Lock l(get_mutex());
- // todo: use the formatter
if (bp::override f = this->get_override("pretty_print_flat"))
- return f();
+ return f(boost::cref(formatter));
else
throw PythonMethodNotImplemented("MetadataSpecTreeKey", "pretty_print_flat");
}
@@ -418,26 +422,24 @@ struct MetadataSpecTreeKeyWrapper<FetchableURISpecTree> :
throw PythonMethodNotImplemented("MetadataSpecTreeKey", "value");
}
- virtual std::string pretty_print(const FetchableURISpecTree::ItemFormatter &) const
+ virtual std::string pretty_print(const FetchableURISpecTree::ItemFormatter & formatter) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
Lock l(get_mutex());
- // todo: use the formatter
if (bp::override f = this->get_override("pretty_print"))
- return f();
+ return f(boost::cref(formatter));
else
throw PythonMethodNotImplemented("MetadataSpecTreeKey", "pretty_print");
}
- virtual std::string pretty_print_flat(const FetchableURISpecTree::ItemFormatter &) const
+ virtual std::string pretty_print_flat(const FetchableURISpecTree::ItemFormatter & formatter) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
Lock l(get_mutex());
- // todo: use the formatter
if (bp::override f = this->get_override("pretty_print_flat"))
- return f();
+ return f(boost::cref(formatter));
else
throw PythonMethodNotImplemented("MetadataSpecTreeKey", "pretty_print_flat");
}
@@ -447,8 +449,10 @@ struct MetadataSpecTreeKeyWrapper<FetchableURISpecTree> :
{
Lock l(get_mutex());
- // todo: override
- return make_shared_ptr(new URIListedThenMirrorsLabel("listed-then-mirrors"));
+ if (bp::override f = this->get_override("initial_label"))
+ return f();
+ else
+ throw PythonMethodNotImplemented("MetadataSpecTreeKey", "initial_label");
}
};
@@ -461,7 +465,9 @@ struct class_set_key :
bp::class_<MetadataSetKeyWrapper<C_>, tr1::shared_ptr<MetadataSetKeyWrapper<C_> >,
bp::bases<MetadataKey>, boost::noncopyable>(
("Metadata" + set + "Key").c_str(),
- "NEED_DOC\n"
+ "A MetadataSetKey is a MetadataKey that holds a Set of some kind of item\n"
+ "as its value.\n\n"
+
"This class can be subclassed in Python.",
bp::init<const std::string &, const std::string &, MetadataKeyType>(
"__init__(raw_name, human_name, MetadataKeyType)"
@@ -473,7 +479,59 @@ struct class_set_key :
tr1::shared_ptr<MetadataKey> >();
def("value", bp::pure_virtual(&MetadataSetKey<C_>::value),
- ("[ro] " + set + "\n").c_str());
+ ("value() -> " + set + "\n"
+ "Fetch our value.").c_str()
+ );
+
+ def("pretty_print_flat", bp::pure_virtual(&MetadataSetKey<C_>::pretty_print_flat),
+ ("pretty_print_flat(" + set +"Formatter) -> string\n"
+ "Return a single-line formatted version of our value, using the\n"
+ "supplied Formatter to format individual items.").c_str()
+ );
+ }
+};
+
+template <>
+struct class_set_key<IUseFlagSet> :
+ bp::class_<MetadataSetKeyWrapper<IUseFlagSet>, tr1::shared_ptr<MetadataSetKeyWrapper<IUseFlagSet> >,
+ bp::bases<MetadataKey>, boost::noncopyable>
+{
+ class_set_key(const std::string & set) :
+ bp::class_<MetadataSetKeyWrapper<IUseFlagSet>, tr1::shared_ptr<MetadataSetKeyWrapper<IUseFlagSet> >,
+ bp::bases<MetadataKey>, boost::noncopyable>(
+ ("Metadata" + set + "Key").c_str(),
+ "A MetadataSetKey is a MetadataKey that holds a Set of some kind of item\n"
+ "as its value.\n\n"
+
+ "This class can be subclassed in Python.",
+ bp::init<const std::string &, const std::string &, MetadataKeyType>(
+ "__init__(raw_name, human_name, MetadataKeyType)"
+ )
+ )
+ {
+ bp::register_ptr_to_python<tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > >();
+ bp::implicitly_convertible<tr1::shared_ptr<MetadataSetKeyWrapper<IUseFlagSet> >,
+ tr1::shared_ptr<MetadataKey> >();
+
+ def("value", bp::pure_virtual(&MetadataSetKey<IUseFlagSet>::value),
+ ("value() -> " + set + "\n"
+ "Fetch our value.").c_str()
+ );
+
+ def("pretty_print_flat", bp::pure_virtual(&MetadataSetKey<IUseFlagSet>::pretty_print_flat),
+ ("pretty_print_flat(" + set +"Formatter) -> string\n"
+ "Return a single-line formatted version of our value, using the\n"
+ "supplied Formatter to format individual items.").c_str()
+ );
+
+ def("pretty_print_flat_with_comparison",
+ bp::pure_virtual(&MetadataSetKey<IUseFlagSet>::pretty_print_flat_with_comparison),
+ ("pretty_print_flat_with_comparison(Environment, PackageID, " + set +"Formatter) -> string\n"
+ "Return a single-line formatted version of our value, using the\n"
+ "supplied Formatter to format individual items, and the supplied\n"
+ "PackageID to decorate using format::Added and format::Changed as\n"
+ "appropriate.").c_str()
+ );
}
};
@@ -486,7 +544,9 @@ struct class_spec_tree_key :
bp::class_<MetadataSpecTreeKeyWrapper<C_>, tr1::shared_ptr<MetadataSpecTreeKeyWrapper<C_> >,
bp::bases<MetadataKey>, boost::noncopyable>(
("Metadata" + spec_tree + "Key").c_str(),
- "NEED_DOC\n"
+ "A MetadataSpecTreeKey is a MetadataKey that holds a spec tree of some\n"
+ "kind as its value.\n\n"
+
"This class can be subclassed in Python.",
bp::init<const std::string &, const std::string &, MetadataKeyType>(
"__init__(raw_name, human_name, MetadataKeyType)"
@@ -498,9 +558,70 @@ struct class_spec_tree_key :
tr1::shared_ptr<MetadataKey> >();
def("value", bp::pure_virtual(&MetadataSpecTreeKey<C_>::value),
- ("[ro] " + spec_tree + "\n").c_str());
- def("pretty_print", bp::pure_virtual(&MetadataSpecTreeKey<C_>::pretty_print));
- def("pretty_print_flat", bp::pure_virtual(&MetadataSpecTreeKey<C_>::pretty_print_flat));
+ ("value() -> " + spec_tree + "\n"
+ "Fetch our value").c_str()
+ );
+
+ def("pretty_print", bp::pure_virtual(&MetadataSpecTreeKey<C_>::pretty_print),
+ ("pretty_print(" + spec_tree + "Formatter) -> string\n"
+ "Return a multiline-line indented and formatted version of our\n"
+ "value, using the supplied Formatter to format individual items.").c_str()
+ );
+
+ def("pretty_print_flat", bp::pure_virtual(&MetadataSpecTreeKey<C_>::pretty_print_flat),
+ ("pretty_print_flat(" + spec_tree + "Formatter) -> string\n"
+ "Return a single-line formatted version of our value, using the\n"
+ "supplied Formatter to format individual items.").c_str()
+ );
+ }
+};
+
+template <>
+struct class_spec_tree_key<FetchableURISpecTree> :
+ bp::class_<MetadataSpecTreeKeyWrapper<FetchableURISpecTree>,
+ tr1::shared_ptr<MetadataSpecTreeKeyWrapper<FetchableURISpecTree> >,
+ bp::bases<MetadataKey>, boost::noncopyable>
+{
+ class_spec_tree_key(const std::string & spec_tree) :
+ bp::class_<MetadataSpecTreeKeyWrapper<FetchableURISpecTree>,
+ tr1::shared_ptr<MetadataSpecTreeKeyWrapper<FetchableURISpecTree> >,
+ bp::bases<MetadataKey>, boost::noncopyable>(
+ ("Metadata" + spec_tree + "Key").c_str(),
+ "A MetadataSpecTreeKey is a MetadataKey that holds a spec tree of some\n"
+ "kind as its value.\n\n"
+
+ "This class can be subclassed in Python.",
+ bp::init<const std::string &, const std::string &, MetadataKeyType>(
+ "__init__(raw_name, human_name, MetadataKeyType)"
+ )
+ )
+ {
+ bp::register_ptr_to_python<tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > >();
+ bp::implicitly_convertible<tr1::shared_ptr<MetadataSpecTreeKeyWrapper<FetchableURISpecTree> >,
+ tr1::shared_ptr<MetadataKey> >();
+
+ def("value", bp::pure_virtual(&MetadataSpecTreeKey<FetchableURISpecTree>::value),
+ ("value() -> " + spec_tree + "\n"
+ "Fetch our value").c_str()
+ );
+
+ def("pretty_print", bp::pure_virtual(&MetadataSpecTreeKey<FetchableURISpecTree>::pretty_print),
+ ("pretty_print(" + spec_tree + "Formatter) -> string\n"
+ "Return a multiline-line indented and formatted version of our\n"
+ "value, using the supplied Formatter to format individual items.").c_str()
+ );
+
+ def("pretty_print_flat", bp::pure_virtual(&MetadataSpecTreeKey<FetchableURISpecTree>::pretty_print_flat),
+ ("pretty_print_flat(" + spec_tree + "Formatter) -> string\n"
+ "Return a single-line formatted version of our value, using the\n"
+ "supplied Formatter to format individual items.").c_str()
+ );
+
+ def("initial_label", bp::pure_virtual(&MetadataSpecTreeKey<FetchableURISpecTree>::initial_label),
+ "initial_label() -> URILabel\n"
+ "Return a URILabel that represents the initial label to use when\n"
+ "deciding the behaviour of individual items in the heirarchy."
+ );
}
};
@@ -520,16 +641,40 @@ void expose_metadata_key()
bp::class_<MetadataKey, boost::noncopyable>
(
"MetadataKey",
+ "A MetadataKey is a generic key that contains a particular piece of\n"
+ "information about a PackageID instance.\n\n"
+
+ "A basic MetadataKey has:\n\n"
+
+ "- A raw name. This is in a repository-defined format designed to closely\n"
+ " represent the internal name. For example, ebuilds and VDB IDs use\n"
+ " raw names like 'DESCRIPTION' and 'KEYWORDS', whereas CRAN uses names\n"
+ " like 'Title' and 'BundleDescription'. The raw name is unique in a\n"
+ " PackageID.\n\n"
+
+ "- A human name. This is the name that should be used when outputting\n"
+ " normally for a human to read.\n\n"
+
+ "- A MetadataKeyType. This is a hint to clients as to whether the key\n"
+ " should be displayed when outputting information about a package ID.\n\n"
+
+ "Subclasses provide additional information, including the 'value' of the\n"
+ "key.",
bp::no_init
)
- .def("raw_name", &MetadataKey::raw_name,
+ .def("raw_name", bp::pure_virtual(&MetadataKey::raw_name),
"raw_name() -> string\n"
- "NEED_DOC"
+ "Fetch our raw name."
)
- .def("human_name", &MetadataKey::human_name,
+ .def("human_name", bp::pure_virtual(&MetadataKey::human_name),
"human_name() -> string\n"
- "NEED_DOC"
+ "Fetch our human name."
+ )
+
+ .def("type", bp::pure_virtual(&MetadataKey::type),
+ "type() -> MetadataKeyType\n"
+ "Fetch our key type."
)
;
@@ -543,7 +688,9 @@ void expose_metadata_key()
bp::bases<MetadataKey>, boost::noncopyable>
(
"MetadataPackageIDKey",
- "NEED_DOC\n"
+ "A MetadataPackageIDKey is a MetadataKey that has a PackageID as its\n"
+ "value.\n\n"
+
"This class can be subclassed in Python.",
bp::init<const std::string &, const std::string &, MetadataKeyType>(
"__init__(raw_name, human_name, MetadataKeyType)"
@@ -551,7 +698,7 @@ void expose_metadata_key()
)
.def("value", bp::pure_virtual(&MetadataPackageIDKey::value),
"value() -> PackageID\n"
- "NEED_DOC"
+ "Fetch our value."
)
;
@@ -565,15 +712,17 @@ void expose_metadata_key()
bp::bases<MetadataKey>, boost::noncopyable>
(
"MetadataStringKey",
- "NEED_DOC\n"
+ "A MetadataStringKey is a MetadataKey that has a std::string as its\n"
+ "value.\n\n"
+
"This class can be subclassed in Python.",
bp::init<const std::string &, const std::string &, MetadataKeyType>(
"__init__(raw_name, human_name, MetadataKeyType)"
)
)
- .def("value", &MetadataStringKey::value,
+ .def("value", bp::pure_virtual(&MetadataStringKey::value),
"value() -> string\n"
- "NEED_DOC"
+ "Fetch our value."
)
;
@@ -587,7 +736,8 @@ void expose_metadata_key()
bp::bases<MetadataKey>, boost::noncopyable>
(
"MetadataTimeKey",
- "NEED_DOC\n"
+ "A MetadataTimeKey is a MetadataKey that has a int(time_t) as its value.\n\n"
+
"This class can be subclassed in Python.",
bp::init<const std::string &, const std::string &, MetadataKeyType>(
"__init__(raw_name, human_name, MetadataKeyType)"
@@ -595,6 +745,7 @@ void expose_metadata_key()
)
.def("value", bp::pure_virtual(&MetadataTimeKey::value),
"value() -> int\n"
+ "Fetch our value."
)
;
@@ -608,7 +759,8 @@ void expose_metadata_key()
bp::bases<MetadataKey>, boost::noncopyable>
(
"MetadataFSEntryKey",
- "NEED_DOC\n"
+ "A MetadataFSEntryKey is a MetadataKey that has an string(FSEntry) as its value.\n\n"
+
"This class can be subclassed in Python.",
bp::init<const std::string &, const std::string &, MetadataKeyType>(
"__init__(raw_name, human_name, MetadataKeyType)"
@@ -616,6 +768,7 @@ void expose_metadata_key()
)
.def("value", bp::pure_virtual(&MetadataFSEntryKey::value),
"value() -> FSEntry\n"
+ "Fetch our value."
)
;
@@ -629,7 +782,8 @@ void expose_metadata_key()
bp::bases<MetadataKey>, boost::noncopyable>
(
"MetadataContentsKey",
- "NEED_DOC\n"
+ "A MetadataContentsKey is a MetadataKey that holds a Contents heirarchy.\n\n"
+
"This class can be subclassed in Python.",
bp::init<const std::string &, const std::string &, MetadataKeyType>(
"__init__(raw_name, human_name, MetadataKeyType)"
@@ -637,19 +791,25 @@ void expose_metadata_key()
)
.def("value", bp::pure_virtual(&MetadataContentsKey::value),
"value() -> Contents\n"
- "NEED_DOC"
+ "Fetch our value."
)
//Work around epydoc bug
- .def("raw_name", &MetadataKey::raw_name,
+ .def("raw_name", bp::pure_virtual(&MetadataKey::raw_name),
"raw_name() -> string\n"
- "NEED_DOC"
+ "Fetch our raw name."
)
//Work around epydoc bug
- .def("human_name", &MetadataKey::human_name,
+ .def("human_name", bp::pure_virtual(&MetadataKey::human_name),
"human_name() -> string\n"
- "NEED_DOC"
+ "Fetch our human name."
+ )
+
+ //Work around epydoc bug
+ .def("type", bp::pure_virtual(&MetadataKey::type),
+ "type() -> MetadataKeyType\n"
+ "Fetch our key type."
)
;
@@ -663,7 +823,9 @@ void expose_metadata_key()
bp::bases<MetadataKey>, boost::noncopyable>
(
"MetadataRepositoryMaskInfoKey",
- "NEED_DOC\n"
+ "A MetadataRepositoryMaskInfoKey is a MetadataKey that holds\n"
+ "RepositoryMaskInfo as its value.\n\n"
+
"This class can be subclassed in Python.",
bp::init<const std::string &, const std::string &, MetadataKeyType>(
"__init__(raw_name, human_name, MetadataKeyType)"
@@ -671,6 +833,7 @@ void expose_metadata_key()
)
.def("value", bp::pure_virtual(&MetadataRepositoryMaskInfoKey::value),
"value() -> RepositoryMaskInfo\n"
+ "Fetch our value."
)
;
diff --git a/python/metadata_key_TEST.py b/python/metadata_key_TEST.py
index 57c41dd..eb9ceab 100755
--- a/python/metadata_key_TEST.py
+++ b/python/metadata_key_TEST.py
@@ -131,6 +131,9 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return ["keyword"]
+ def pretty_print_flat(self, f):
+ return "foo"
+
test_metadata_keyword_name_set_key(TestKey())
def test_07_use_flag_name_iterable(self):
@@ -141,6 +144,9 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return ["use"]
+ def pretty_print_flat(self, f):
+ return "foo"
+
test_metadata_use_flag_name_set_key(TestKey())
def test_08_iuse_flag_iterable(self):
@@ -151,6 +157,12 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return [IUseFlag("iuse", IUseFlagParseMode.PERMISSIVE, -1)]
+ def pretty_print_flat(self, f):
+ return "foo"
+
+ def pretty_print_flat_with_comparison(self, e, pid, f):
+ return "foo"
+
test_metadata_iuse_flag_set_key(TestKey())
def test_09_string_iterable(self):
@@ -159,7 +171,10 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
MetadataStringIterableKey.__init__(self, "raw", "human", MetadataKeyType.NORMAL)
def value(self):
- return ["keyword"]
+ return ["string"]
+
+ def pretty_print_flat(self, f):
+ return "foo"
test_metadata_string_set_key(TestKey())
@@ -171,10 +186,10 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return AllDepSpec()
- def pretty_print(self):
+ def pretty_print(self, f):
return "str"
- def pretty_print_flat(self):
+ def pretty_print_flat(self, f):
return "str"
test_metadata_license_spec_tree_key(TestKey())
@@ -187,10 +202,10 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return AllDepSpec()
- def pretty_print(self):
+ def pretty_print(self, f):
return "str"
- def pretty_print_flat(self):
+ def pretty_print_flat(self, f):
return "str"
test_metadata_provide_spec_tree_key(TestKey())
@@ -203,10 +218,10 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return AllDepSpec()
- def pretty_print(self):
+ def pretty_print(self, f):
return "str"
- def pretty_print_flat(self):
+ def pretty_print_flat(self, f):
return "str"
test_metadata_dependency_spec_tree_key(TestKey())
@@ -220,10 +235,10 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return AllDepSpec()
- def pretty_print(self):
+ def pretty_print(self, f):
return "str"
- def pretty_print_flat(self):
+ def pretty_print_flat(self, f):
return "str"
test_metadata_restrict_spec_tree_key(TestKey())
@@ -236,12 +251,15 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return AllDepSpec()
- def pretty_print(self):
+ def pretty_print(self, f):
return "str"
- def pretty_print_flat(self):
+ def pretty_print_flat(self, f):
return "str"
+ def initial_label(self):
+ return URIMirrorsOnlyLabel("foo")
+
test_metadata_fetchable_uri_spec_tree_key(TestKey())
def test_15_simple_uri_spec_tree(self):
@@ -252,10 +270,10 @@ class TestCase_02_MetadataKeys_suclassing(unittest.TestCase):
def value(self):
return AllDepSpec()
- def pretty_print(self):
+ def pretty_print(self, f):
return "str"
- def pretty_print_flat(self):
+ def pretty_print_flat(self, f):
return "str"
test_metadata_simple_uri_spec_tree_key(TestKey())
diff --git a/python/nice_names.nn b/python/nice_names.nn
index c22e2cd..36ce9b6 100644
--- a/python/nice_names.nn
+++ b/python/nice_names.nn
@@ -16,6 +16,8 @@ use_namespace "paludis"
make_nn_NiceNames() {
namespace "paludis::python"
+ name "std::string" "String"
+
# paludis/dep_spec-fwd.hh
name "DepSpec"
name "PackageDepSpec"
@@ -67,6 +69,8 @@ make_nn_NiceNames() {
make_nn_LowercaseNiceNames() {
namespace "paludis::python"
+ name "std::string" "string"
+
name "UseFlagName" "use_flag_name"
name "IUseFlag" "iuse_flag"
name "KeywordName" "keyword_name"
diff --git a/python/paludis_python.hh b/python/paludis_python.hh
index 14aa645..795593c 100644
--- a/python/paludis_python.hh
+++ b/python/paludis_python.hh
@@ -159,6 +159,7 @@ namespace paludis
void expose_action() PALUDIS_VISIBLE;
void expose_contents() PALUDIS_VISIBLE;
+void expose_dep_label() PALUDIS_VISIBLE;
void expose_dep_list() PALUDIS_VISIBLE;
void expose_dep_spec() PALUDIS_VISIBLE;
void expose_dep_tag() PALUDIS_VISIBLE;
diff --git a/python/paludis_python_so.cc b/python/paludis_python_so.cc
index 1b06d55..8d2b25b 100644
--- a/python/paludis_python_so.cc
+++ b/python/paludis_python_so.cc
@@ -37,6 +37,7 @@ BOOST_PYTHON_MODULE(paludis)
expose_contents();
expose_dep_spec();
expose_dep_tag();
+ expose_dep_label();
expose_dep_list();
expose_name();
expose_log();