aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-11 18:45:04 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-11 18:45:04 +0000
commit169409361945a4de3f6ceb229568214d9d07c25a (patch)
treee5b3bc0e2a79a5b50136d480019581367dde14dc /python
parentcce405d54052fa56220320997aa2d560fa0b0932 (diff)
downloadpaludis-169409361945a4de3f6ceb229568214d9d07c25a.tar.gz
paludis-169409361945a4de3f6ceb229568214d9d07c25a.tar.xz
Update bindings
Diffstat (limited to 'python')
-rw-r--r--python/action.cc75
-rwxr-xr-xpython/action_TEST.py6
-rwxr-xr-xpython/package_id_TEST.py6
3 files changed, 78 insertions, 9 deletions
diff --git a/python/action.cc b/python/action.cc
index 5c55ee393..1f32528d2 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -85,6 +85,27 @@ namespace
));
}
+ InfoActionOptions * make_info_action_options()
+ {
+ return new InfoActionOptions(make_named_values<InfoActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+ }
+
+ ConfigActionOptions * make_config_action_options()
+ {
+ return new ConfigActionOptions(make_named_values<ConfigActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+ }
+
+ PretendActionOptions * make_pretend_action_options()
+ {
+ return new PretendActionOptions(make_named_values<PretendActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+ }
+
FetchActionOptions * make_fetch_action_options(
const bool exclude_unmirrorable,
const bool fetch_unneeded,
@@ -170,6 +191,54 @@ void expose_action()
;
/**
+ * ConfigActionOptions
+ */
+ bp::class_<ConfigActionOptions>
+ (
+ "ConfigActionOptions",
+ "Options for ConfigAction.",
+ bp::no_init
+ )
+
+ .def("__init__",
+ bp::make_constructor(&make_config_action_options),
+ "__init__()"
+ )
+ ;
+
+ /**
+ * InfoActionOptions
+ */
+ bp::class_<InfoActionOptions>
+ (
+ "InfoActionOptions",
+ "Options for InfoAction.",
+ bp::no_init
+ )
+
+ .def("__init__",
+ bp::make_constructor(&make_info_action_options),
+ "__init__()"
+ )
+ ;
+
+ /**
+ * PretendActionOptions
+ */
+ bp::class_<PretendActionOptions>
+ (
+ "PretendActionOptions",
+ "Options for PretendAction.",
+ bp::no_init
+ )
+
+ .def("__init__",
+ bp::make_constructor(&make_pretend_action_options),
+ "__init__()"
+ )
+ ;
+
+ /**
* FetchActionOptions
*/
bp::class_<FetchActionOptions>
@@ -265,7 +334,7 @@ void expose_action()
"PretendAction",
"A PretendAction is used by InstallTask to handle install-pretend-phase\n"
"checks on a PackageID.",
- bp::init<>("__init__()")
+ bp::init<const PretendActionOptions &>("__init__(PretendActionOptions)")
)
.add_property("failed", &PretendAction::failed,
"[ro] bool\n"
@@ -282,7 +351,7 @@ void expose_action()
"A ConfigAction is used via PackageID::perform_action to execute\n"
"post-install configuration (for example, via 'paludis --config')\n"
"on a PackageID.",
- bp::init<>("__init__()")
+ bp::init<ConfigActionOptions>("__init__(ConfigActionOptions)")
);
/**
@@ -294,7 +363,7 @@ void expose_action()
"An InfoAction is used via PackageID::perform_action to execute\n"
"additional information (for example, via 'paludis --info')\n"
"on a PackageID.",
- bp::init<>("__init__()")
+ bp::init<InfoActionOptions>("__init__(InfoActionOptions)")
);
/**
diff --git a/python/action_TEST.py b/python/action_TEST.py
index a1239356c..8bee22308 100755
--- a/python/action_TEST.py
+++ b/python/action_TEST.py
@@ -84,15 +84,15 @@ class TestCase_07_InstalledAction(unittest.TestCase):
class TestCase_08_PretendAction(unittest.TestCase):
def test_01_create(self):
- PretendAction()
+ PretendAction(PretendActionOptions())
class TestCase_09_ConfigAction(unittest.TestCase):
def test_01_create(self):
- ConfigAction()
+ ConfigAction(ConfigActionOptions())
class TestCase_10_InfoAction(unittest.TestCase):
def test_01_create(self):
- InfoAction()
+ InfoAction(InfoActionOptions())
class TestCase_10_SupportsActionTests(unittest.TestCase):
def test_01_create(self):
diff --git a/python/package_id_TEST.py b/python/package_id_TEST.py
index 1e243fa32..231094d63 100755
--- a/python/package_id_TEST.py
+++ b/python/package_id_TEST.py
@@ -84,9 +84,9 @@ class TestCase_01_PackageID(unittest.TestCase):
self.assert_(isinstance(self.pid.find_metadata("DEPEND"), MetadataDependencySpecTreeKey))
def test_10_perform_action(self):
- self.pid.perform_action(PretendAction())
- self.assertRaises(UnsupportedActionError, self.pid.perform_action, ConfigAction())
- self.assertRaises(UnsupportedActionError, self.ipid.perform_action, PretendAction())
+ self.pid.perform_action(PretendAction(PretendActionOptions()))
+ self.assertRaises(UnsupportedActionError, self.pid.perform_action, ConfigAction(ConfigActionOptions()))
+ self.assertRaises(UnsupportedActionError, self.ipid.perform_action, PretendAction(PretendActionOptions()))
def test_11_supports_action(self):
self.assert_(self.pid.supports_action(SupportsFetchActionTest()))