aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-05-19 16:01:04 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-05-19 16:01:04 +0100
commitcc129190d549f69eccc67407946261544d538a91 (patch)
tree08f0ffe78b5c3f63dfc89d32dba1d828a5107dd0 /python
parentb22056183d6a0e94e28e025c6bae6970979c26c0 (diff)
downloadpaludis-cc129190d549f69eccc67407946261544d538a91.tar.gz
paludis-cc129190d549f69eccc67407946261544d538a91.tar.xz
New improved NamedValue syntax
Diffstat (limited to 'python')
-rw-r--r--python/action.cc42
-rw-r--r--python/additional_tests.cc4
-rw-r--r--python/environment.cc22
-rw-r--r--python/mask.cc4
-rw-r--r--python/repository.cc4
-rw-r--r--python/version_requirements.cc4
6 files changed, 40 insertions, 40 deletions
diff --git a/python/action.cc b/python/action.cc
index b4bb24210..5351ba53d 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -77,11 +77,11 @@ namespace
const std::tr1::shared_ptr<paludis::Repository> & r)
{
return new InstallActionOptions(make_named_values<InstallActionOptions>(
- value_for<n::destination>(r),
- value_for<n::make_output_manager>(&make_standard_output_manager),
- value_for<n::perform_uninstall>(&cannot_perform_uninstall),
- value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
- value_for<n::want_phase>(&want_all_phases)
+ n::destination() = r,
+ n::make_output_manager() = &make_standard_output_manager,
+ n::perform_uninstall() = &cannot_perform_uninstall,
+ n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::want_phase() = &want_all_phases
));
}
@@ -89,32 +89,32 @@ namespace
const std::string & c)
{
return new UninstallActionOptions(make_named_values<UninstallActionOptions>(
- value_for<n::config_protect>(c),
- value_for<n::if_for_install_id>(make_null_shared_ptr()),
- value_for<n::ignore_for_unmerge>(&ignore_nothing),
- value_for<n::is_overwrite>(false),
- value_for<n::make_output_manager>(&make_standard_output_manager)
+ n::config_protect() = c,
+ n::if_for_install_id() = make_null_shared_ptr(),
+ n::ignore_for_unmerge() = &ignore_nothing,
+ n::is_overwrite() = false,
+ n::make_output_manager() = &make_standard_output_manager
));
}
InfoActionOptions * make_info_action_options()
{
return new InfoActionOptions(make_named_values<InfoActionOptions>(
- value_for<n::make_output_manager>(&make_standard_output_manager)
+ 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)
+ 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)
+ n::make_output_manager() = &make_standard_output_manager
));
}
@@ -130,14 +130,14 @@ namespace
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_parts>(parts),
- value_for<n::ignore_not_in_manifest>(false),
- value_for<n::ignore_unfetched>(false),
- value_for<n::make_output_manager>(&make_standard_output_manager),
- value_for<n::safe_resume>(safe_resume),
- value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
+ n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::exclude_unmirrorable() = exclude_unmirrorable,
+ n::fetch_parts() = parts,
+ n::ignore_not_in_manifest() = false,
+ n::ignore_unfetched() = false,
+ n::make_output_manager() = &make_standard_output_manager,
+ n::safe_resume() = safe_resume,
+ n::want_phase() = std::tr1::bind(return_literal_function(wp_yes))
));
}
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index f1abe0787..8a447e96e 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -48,8 +48,8 @@ namespace environment
void test_env(Environment & e)
{
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
- value_for<n::environment>(&e),
- value_for<n::name>(RepositoryName("fakerepo")))));
+ n::environment() = &e,
+ n::name() = RepositoryName("fakerepo"))));
std::tr1::shared_ptr<PackageID> pid(repo->add_version("cat", "pkg", "1.0"));
e.package_database()->add_repository(0, repo);
diff --git a/python/environment.cc b/python/environment.cc
index b3f93a078..69c4ae4e7 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -305,7 +305,7 @@ class EnvironmentImplementationWrapper :
virtual HookResult perform_hook(const Hook & h) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(""));
+ return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
virtual std::string distribution() const
@@ -458,16 +458,16 @@ struct NoConfigEnvironmentWrapper :
const std::string & master_repo_name, const std::tr1::shared_ptr<const FSEntrySequence> & extra_repository_dirs
) :
NoConfigEnvironment(make_named_values<no_config_environment::Params>(
- value_for<n::accept_unstable>(false),
- value_for<n::disable_metadata_cache>(false),
- value_for<n::extra_accept_keywords>(""),
- value_for<n::extra_params>(make_null_shared_ptr()),
- value_for<n::extra_repository_dirs>(extra_repository_dirs),
- value_for<n::master_repository_name>(master_repo_name),
- value_for<n::profiles_if_not_auto>(""),
- value_for<n::repository_dir>(env_dir),
- value_for<n::repository_type>(no_config_environment::ncer_auto),
- value_for<n::write_cache>(cache_dir)
+ n::accept_unstable() = false,
+ n::disable_metadata_cache() = false,
+ n::extra_accept_keywords() = "",
+ n::extra_params() = make_null_shared_ptr(),
+ n::extra_repository_dirs() = extra_repository_dirs,
+ n::master_repository_name() = master_repo_name,
+ n::profiles_if_not_auto() = "",
+ n::repository_dir() = env_dir,
+ n::repository_type() = no_config_environment::ncer_auto,
+ n::write_cache() = cache_dir
))
{
}
diff --git a/python/mask.cc b/python/mask.cc
index 214c9dd1a..22fe6763c 100644
--- a/python/mask.cc
+++ b/python/mask.cc
@@ -34,8 +34,8 @@ namespace
const std::tr1::shared_ptr<const Sequence<std::string> > & s, const FSEntry & f)
{
return make_shared_ptr(new RepositoryMaskInfo(make_named_values<RepositoryMaskInfo>(
- value_for<n::comment>(s),
- value_for<n::mask_file>(f)
+ n::comment() = s,
+ n::mask_file() = f
)));
}
}
diff --git a/python/repository.cc b/python/repository.cc
index 0ca595e20..962f86c17 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -107,8 +107,8 @@ namespace
make_fake_repository(const Environment * const env, const RepositoryName & n)
{
return make_shared_ptr(new FakeRepository(make_named_values<FakeRepositoryParams>(
- value_for<n::environment>(env),
- value_for<n::name>(n)
+ n::environment() = env,
+ n::name() = n
)));
}
}
diff --git a/python/version_requirements.cc b/python/version_requirements.cc
index 19b092c3b..3ec32da3c 100644
--- a/python/version_requirements.cc
+++ b/python/version_requirements.cc
@@ -33,8 +33,8 @@ namespace
VersionRequirement * make_version_requirement(const VersionOperator & op, const VersionSpec & spec)
{
return new VersionRequirement(make_named_values<VersionRequirement>(
- value_for<n::version_operator>(op),
- value_for<n::version_spec>(spec)
+ n::version_operator() = op,
+ n::version_spec() = spec
));
}
}