aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-08-14 16:57:14 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-08-14 16:57:14 +0000
commit6942b864c2286c36077643263cc3b1dc3be1a2ab (patch)
tree18511de22e0a850f4ba76e978ebfc6e0dbeb9b27
parentc6f8d14a5230ab4846833800d37eba9384cbb331 (diff)
downloadpaludis-6942b864c2286c36077643263cc3b1dc3be1a2ab.tar.gz
paludis-6942b864c2286c36077643263cc3b1dc3be1a2ab.tar.xz
(python) Add docs to QueryBase and work around epydoc bug in Mask.
-rw-r--r--python/mask.cc12
-rw-r--r--python/query.cc41
2 files changed, 45 insertions, 8 deletions
diff --git a/python/mask.cc b/python/mask.cc
index cbd5a9c..a2e85ba 100644
--- a/python/mask.cc
+++ b/python/mask.cc
@@ -218,6 +218,18 @@ void PALUDIS_VISIBLE expose_mask()
"[ro] PackageID\n"
"NEED_DOC"
)
+
+ //Work around epydoc bug
+ .add_property("key", &Mask::key,
+ "[ro] str\n"
+ "NEED_DOC"
+ )
+
+ //Work around epydoc bug
+ .add_property("description", &Mask::description,
+ "[ro] str\n"
+ "NEED_DOC"
+ )
;
}
diff --git a/python/query.cc b/python/query.cc
index 8f894fb..1f73221 100644
--- a/python/query.cc
+++ b/python/query.cc
@@ -226,16 +226,41 @@ void PALUDIS_VISIBLE expose_query()
bp::class_<PythonQueryWrapper, bp::bases<Query>, boost::noncopyable>
(
"QueryBase",
- "Parameter for a PackageDatabase query.",
+ "Parameter for a PackageDatabase query.\n"
+ "This class can be subclassed in Python",
bp::init<>()
)
- .def("repositories", &PythonQuery::repositories, &PythonQueryWrapper::default_repositories)
-
- .def("categories", &PythonQuery::categories, &PythonQueryWrapper::default_categories)
-
- .def("packages", &PythonQuery::packages, &PythonQueryWrapper::default_packages)
-
- .def("ids", &PythonQuery::ids, &PythonQueryWrapper::default_ids)
+ .def("repositories", &PythonQuery::repositories, &PythonQueryWrapper::default_repositories,
+ "repositories(Environment) -> list of RepositoryName\n"
+ "Fetch the names of repositories potentially containing matches.\n"
+ "All returned repositories must exist.\n\n"
+ "Default behaviour: return all repositories."
+ )
+
+ .def("categories", &PythonQuery::categories, &PythonQueryWrapper::default_categories,
+ "categories(Environment, RepositoryNameIterable) -> list of CategoryNamePart\n"
+ "Fetch the names of categories potentially containing matches.\n\n"
+ "Default behaviour: return all categories in the provided\n"
+ "repository collection."
+ )
+
+ .def("packages", &PythonQuery::packages, &PythonQueryWrapper::default_packages,
+ "packages(Environment, RepositoryNameIterable, CategoryNamePartIterable) "
+ "-> list of QualifiedPackageName\n"
+ "Fetch the names of packages potentially containing matches.\n\n"
+ "Default behaviour: return all packages in the provided repository\n"
+ "in the provided categories.\n\n"
+ "Note that some entries in the categories collection (but not in\n"
+ "the repositories collection) may not exist."
+ )
+
+ .def("ids", &PythonQuery::ids, &PythonQueryWrapper::default_ids,
+ "ids(Environment, RepositoryNameIterable, QualifiedPackageNameIterable)\n"
+ "Fetch the IDs of matching packages.\n\n"
+ "Default behaviour: return all IDs in the provided packages.\n\n"
+ "Note that some entries in the qualified package name collection\n"
+ "(but not in the repositories collection) may not exist."
+ )
;
/* I need to think about it yet... */