aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <p.jaroszynski@gmail.com> 2008-06-16 13:00:21 +0200
committerAvatar Piotr Jaroszyński <p.jaroszynski@gmail.com> 2008-06-16 15:10:06 +0200
commit4bf02ec7bba7b3d01de7b0acdc56e9ebef35a2dd (patch)
tree42e6c6405265c90280466fd5cd390991ded634ca
parent91ec20d3b80b10799585f26cea0aba777c6f61e4 (diff)
downloadpaludis-4bf02ec7bba7b3d01de7b0acdc56e9ebef35a2dd.tar.gz
paludis-4bf02ec7bba7b3d01de7b0acdc56e9ebef35a2dd.tar.xz
(python) Fix EnvironmentImplementation.
-rw-r--r--python/additional_tests.cc2
-rw-r--r--python/environment.cc19
-rwxr-xr-xpython/environment_TEST.py3
3 files changed, 20 insertions, 4 deletions
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index 72b79be..9c37442 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -98,6 +98,8 @@ namespace environment
e.perform_hook(Hook("test"));
e.distribution();
+
+ e.begin_metadata();
}
}
diff --git a/python/environment.cc b/python/environment.cc
index a127eef..cc2401c 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -339,7 +339,7 @@ class EnvironmentImplementationWrapper :
return EnvironmentImplementation::distribution();
}
- std::string distribution() const
+ std::string default_distribution() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
return EnvironmentImplementation::distribution();
@@ -405,6 +405,16 @@ class EnvironmentImplementationWrapper :
{
return EnvironmentImplementation::operator[] (fg);
}
+
+ virtual void need_keys_added() const
+ {
+ Lock l(get_mutex());
+
+ if (bp::override f = get_override("need_keys_added"))
+ f();
+ else
+ throw PythonMethodNotImplemented("EnvironmentImplementation", "need_keys_added");
+ }
};
struct NoConfigEnvironmentWrapper :
@@ -412,8 +422,9 @@ struct NoConfigEnvironmentWrapper :
{
NoConfigEnvironmentWrapper(const FSEntry & env_dir, const FSEntry & cache_dir,
const FSEntry & master_repo_dir) :
- NoConfigEnvironment(no_config_environment::Params(env_dir, cache_dir, false, false,
- no_config_environment::ncer_auto, master_repo_dir, std::tr1::shared_ptr<Map<std::string, std::string> >())
+ NoConfigEnvironment(no_config_environment::Params(env_dir, cache_dir, false, false, "",
+ no_config_environment::ncer_auto, master_repo_dir,
+ std::tr1::shared_ptr<Map<std::string, std::string> >())
)
{
}
@@ -647,7 +658,7 @@ void expose_environment()
"Default destination candidates for installing packages."
)
- .def("distribution", &EnvImp::distribution, &EnvImpW::distribution,
+ .def("distribution", &EnvImp::distribution, &EnvImpW::default_distribution,
"distribution() -> str\n"
"NEED_DOC"
)
diff --git a/python/environment_TEST.py b/python/environment_TEST.py
index fd6f69b..599786a 100755
--- a/python/environment_TEST.py
+++ b/python/environment_TEST.py
@@ -204,6 +204,9 @@ class TestCase_04_Environment_subclassingd(unittest.TestCase):
def distribution(self):
return EnvironmentImplementation.distribution(self)
+ def need_keys_added(self):
+ return
+
def test_01_environment_implementation(self):
test_env(self.SubEnv())