aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-06 14:08:54 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-06 18:35:00 +0000
commit40281ddc9fcadf6c196d435339c75934a3c876af (patch)
treec11f7407f653568c8fa0b8c7c917b27ea736ae4e /python
parenta360e94b28c1bbd9c3c0f3cf6046428fcdecba25 (diff)
downloadpaludis-40281ddc9fcadf6c196d435339c75934a3c876af.tar.gz
paludis-40281ddc9fcadf6c196d435339c75934a3c876af.tar.xz
Expose less about profiles
Diffstat (limited to 'python')
-rw-r--r--python/environment.cc1
-rw-r--r--python/repository.cc74
-rwxr-xr-xpython/repository_TEST.py21
3 files changed, 1 insertions, 95 deletions
diff --git a/python/environment.cc b/python/environment.cc
index 043bb39fe..403004ecc 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -452,6 +452,7 @@ struct NoConfigEnvironmentWrapper :
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)
diff --git a/python/repository.cc b/python/repository.cc
index d950aa83b..661b238f1 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -69,12 +69,6 @@ struct RepositoryWrapper :
return self.destination_interface();
}
- static RepositoryEInterface *
- get_e_interface(const Repository & self)
- {
- return self.e_interface();
- }
-
static PyObject *
find_metadata(const Repository & self, const std::string & key)
{
@@ -95,24 +89,6 @@ struct FakeRepositoryWrapper
}
};
-struct RepositoryEInterfaceWrapper
-{
- static bp::object
- my_find_profile(const RepositoryEInterface & self, const FSEntry & location)
- {
- RepositoryEInterface::ProfilesConstIterator p(self.find_profile(location));
- if (p == self.end_profiles())
- return bp::object();
- return bp::object(bp::ptr(&*p));
- }
-
- static void
- my_set_profile(RepositoryEInterface & self, const RepositoryEInterface::ProfilesDescLine & pdl)
- {
- self.set_profile(self.find_profile(pdl.path()));
- }
-};
-
// FIXME
//template <typename I_>
//struct repository_interface_to_python
@@ -236,11 +212,6 @@ void expose_repository()
"[ro] RepositoryDestinationInterface"
)
- .add_property("e_interface", bp::make_function(&RepositoryWrapper::get_e_interface,
- bp::return_internal_reference<>()),
- "[ro] RepositoryEInterface"
- )
-
.def("format_key", &Repository::format_key,
"The format_key, if not None, holds our repository's format"
)
@@ -267,26 +238,6 @@ void expose_repository()
;
/**
- * RepositoryEInterfaceProfilesDescLine
- */
- bp::class_<RepositoryEInterfaceProfilesDescLine>
- (
- "RepositoryEInterfaceProfilesDescLine",
- "A profiles.desc line in a Repository implementing RepositoryEInterface.",
- bp::no_init
- )
- .add_property("path",
- &named_values_getter<RepositoryEInterfaceProfilesDescLine, n::path, FSEntry, &RepositoryEInterfaceProfilesDescLine::path>
- )
- .add_property("arch",
- &named_values_getter<RepositoryEInterfaceProfilesDescLine, n::arch, std::string, &RepositoryEInterfaceProfilesDescLine::arch>
- )
- .add_property("status",
- &named_values_getter<RepositoryEInterfaceProfilesDescLine, n::status, std::string, &RepositoryEInterfaceProfilesDescLine::status>
- )
- ;
-
- /**
* RepositoryEnvironmentVariableInterface
*/
bp::class_<RepositoryEnvironmentVariableInterface, boost::noncopyable>
@@ -337,31 +288,6 @@ void expose_repository()
);
/**
- * RepositoryEInterface
- */
- bp::class_<RepositoryEInterface, boost::noncopyable>
- (
- "RepositoryEInterface",
- "Interface for handling ERepository specific functionality.",
- bp::no_init
- )
- .add_property("profiles", bp::range(&RepositoryEInterface::begin_profiles,
- &RepositoryEInterface::end_profiles),
- "[ro] Iterable of Profiles"
- )
-
- .def("profile_variable", &RepositoryEInterface::profile_variable)
-
- .def("find_profile", &RepositoryEInterfaceWrapper::my_find_profile,
- "find_profile(path_string) -> RepositoryEInterfaceProfilesDescLine"
- )
-
- .add_property("profile", bp::object(), &RepositoryEInterfaceWrapper::my_set_profile,
- "[wo] RepositoryEInterfaceProfilesDescLine"
- )
- ;
-
- /**
* FakeRepository
*/
bp::implicitly_convertible<std::tr1::shared_ptr<FakeRepository>, std::tr1::shared_ptr<Repository> >();
diff --git a/python/repository_TEST.py b/python/repository_TEST.py
index b6eb20847..52e44cf9b 100755
--- a/python/repository_TEST.py
+++ b/python/repository_TEST.py
@@ -127,27 +127,6 @@ class TestCase_02_RepositoryInterfaces(unittest.TestCase):
di = irepo.destination_interface
self.assert_(isinstance(di, RepositoryDestinationInterface))
- def test_12_e_interface(self):
- ei = nce.main_repository.e_interface
-
- self.assert_(isinstance(ei, RepositoryEInterface))
-
- path = os.path.join(os.getcwd(), "repository_TEST_dir/testrepo/profiles/testprofile")
- profile = ei.find_profile(path)
-
- self.assert_(isinstance(profile, RepositoryEInterfaceProfilesDescLine))
- self.assertEquals(profile.path, path)
- self.assertEquals(profile.arch, "x86")
- self.assertEquals(profile.status, "stable")
-
-
- self.assertEquals(ei.find_profile("broken"), None)
-
- profile = iter(ei.profiles).next()
- ei.profile = profile
-
- self.assertEquals(ei.profile_variable("ARCH"), "test")
-
def test_12_qa_interface(self):
if hasattr(paludis, "QAReporter"):
class PyQAR(QAReporter):