aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-22 22:52:48 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-22 22:52:48 +0000
commitf946430c361864a353707eb91b48209ba7b52550 (patch)
treecb29a164a4756b92b23d97e40cef7ac880ef08c1 /python
parent01456e93f0e6e5dd4ce3632b1590e3cf4609b646 (diff)
downloadpaludis-f946430c361864a353707eb91b48209ba7b52550.tar.gz
paludis-f946430c361864a353707eb91b48209ba7b52550.tar.xz
Split up fetching, and give it its own job
Diffstat (limited to 'python')
-rw-r--r--python/action.cc14
-rwxr-xr-xpython/action_TEST.py3
2 files changed, 6 insertions, 11 deletions
diff --git a/python/action.cc b/python/action.cc
index 53ef9d662..dc9d9434c 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -123,11 +123,15 @@ namespace
const bool safe_resume
)
{
+ FetchParts parts;
+ parts = parts + fp_regulars + fp_extras;
+ if (fetch_unneeded)
+ parts += fp_unneeded;
+
return new FetchActionOptions(make_named_values<FetchActionOptions>(
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(exclude_unmirrorable),
- value_for<n::fetch_regulars_only>(false),
- value_for<n::fetch_unneeded>(fetch_unneeded),
+ value_for<n::fetch_parts>(parts),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(&make_standard_output_manager),
value_for<n::safe_resume>(safe_resume)
@@ -261,12 +265,6 @@ void expose_action()
"[rw] bool"
)
- .add_property("fetch_unneeded",
- &named_values_getter<FetchActionOptions, n::fetch_unneeded, bool, &FetchActionOptions::fetch_unneeded>,
- &named_values_setter<FetchActionOptions, n::fetch_unneeded, bool, &FetchActionOptions::fetch_unneeded>,
- "[rw] bool"
- )
-
.add_property("safe_resume",
&named_values_getter<FetchActionOptions, n::safe_resume, bool, &FetchActionOptions::safe_resume>,
&named_values_setter<FetchActionOptions, n::safe_resume, bool, &FetchActionOptions::safe_resume>,
diff --git a/python/action_TEST.py b/python/action_TEST.py
index 6b86b0e7d..900b0a1b8 100755
--- a/python/action_TEST.py
+++ b/python/action_TEST.py
@@ -52,15 +52,12 @@ class TestCase_02_FetchActionOptions(unittest.TestCase):
fao = FetchActionOptions(True, True, True)
self.assertEquals(fao.exclude_unmirrorable, True)
- self.assertEquals(fao.fetch_unneeded, True)
self.assertEquals(fao.safe_resume, True)
fao.exclude_unmirrorable = False
- fao.fetch_unneeded = False
fao.safe_resume = False
self.assertEquals(fao.exclude_unmirrorable, False)
- self.assertEquals(fao.fetch_unneeded, False)
self.assertEquals(fao.safe_resume, False)
class TestCase_04_InstallAction(unittest.TestCase):