aboutsummaryrefslogtreecommitdiff
path: root/python/query.cc
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-05-04 21:47:07 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-05-04 21:47:07 +0000
commit02e73e7f00154bdfebac199dd6a6ea1620f83132 (patch)
treeb080378daed0a54623ceddc3bb207298ab81723e /python/query.cc
parent62ca07c8be79011d6eb1640571b1d8cc71908922 (diff)
downloadpaludis-02e73e7f00154bdfebac199dd6a6ea1620f83132.tar.gz
paludis-02e73e7f00154bdfebac199dd6a6ea1620f83132.tar.xz
Initial import of Python bindings.
Diffstat (limited to 'python/query.cc')
-rw-r--r--python/query.cc73
1 files changed, 73 insertions, 0 deletions
diff --git a/python/query.cc b/python/query.cc
new file mode 100644
index 0000000..0cf5d07
--- /dev/null
+++ b/python/query.cc
@@ -0,0 +1,73 @@
+/* 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 <paludis_python.hh>
+
+#include <paludis/query.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/util/fs_entry.hh>
+
+using namespace paludis;
+using namespace paludis::python;
+namespace bp = boost::python;
+
+void expose_query()
+{
+ bp::class_<Query>
+ q("Query", bp::no_init);
+ q.def("__and__", operator&);
+
+ bp::scope query = q;
+
+ bp::class_<query::Matches, bp::bases<Query> >
+ qm("Matches",
+ bp::init<const PackageDepSpec &>("__init__(PackageDepSpec)")
+ );
+
+ bp::class_<query::Package, bp::bases<Query> >
+ qp("Package",
+ bp::init<const QualifiedPackageName &>("__init__(QualifiedPackageName)")
+ );
+
+ bp::class_<query::NotMasked, bp::bases<Query> >
+ qnm("NotMasked",
+ bp::init<>("__init__()")
+ );
+
+ bp::class_<query::RepositoryHasInstalledInterface, bp::bases<Query> >
+ qrhii1("RepositoryHasInstalledInterface",
+ "Matches...",
+ bp::init<>("__init__()")
+ );
+
+ bp::class_<query::RepositoryHasInstallableInterface, bp::bases<Query> >
+ qrhii2("RepositoryHasInstallableInterface",
+ bp::init<>("__init__()")
+ );
+
+ bp::class_<query::RepositoryHasUninstallableInterface, bp::bases<Query> >
+ qrhui("RepositoryHasUninstallableInterface",
+ bp::init<>("__init__()")
+ );
+
+ bp::class_<query::InstalledAtRoot, bp::bases<Query> >
+ qiar("InstalledAtRoot",
+ bp::init<const FSEntry &>("__init__(path)")
+ );
+}