aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 03:21:44 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 03:28:55 +0100
commit15a3dcd00f4a927a4300326a9f1b7b39dc4e9ee7 (patch)
tree87a63900a7b5bce0a4fd7c6fe34d621e85a49da1
parent6e9dcfc722b454aa93eaf26c7cd31821f334e8c1 (diff)
downloadpaludis-15a3dcd00f4a927a4300326a9f1b7b39dc4e9ee7.tar.gz
paludis-15a3dcd00f4a927a4300326a9f1b7b39dc4e9ee7.tar.xz
(python) Update python for previous (continued)
-rw-r--r--python/dep_spec.cc42
-rw-r--r--python/dep_spec.hh3
-rwxr-xr-xpython/dep_spec_TEST.py5
-rw-r--r--python/generator.cc8
4 files changed, 43 insertions, 15 deletions
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 3992cc8..bc381fa 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -112,7 +112,8 @@ namespace paludis
std::tr1::shared_ptr<VersionRequirements> version_requirements;
VersionRequirementsMode version_requirements_mode;
std::tr1::shared_ptr<const SlotRequirement> slot;
- std::tr1::shared_ptr<const RepositoryName> repository;
+ std::tr1::shared_ptr<const RepositoryName> in_repository;
+ std::tr1::shared_ptr<const RepositoryName> from_repository;
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements;
std::tr1::shared_ptr<const DepTag> tag;
const std::string str;
@@ -124,7 +125,8 @@ namespace paludis
const std::tr1::shared_ptr<VersionRequirements> & v,
const VersionRequirementsMode m,
const std::tr1::shared_ptr<const SlotRequirement> & s,
- const std::tr1::shared_ptr<const RepositoryName> & r,
+ const std::tr1::shared_ptr<const RepositoryName> & ri,
+ const std::tr1::shared_ptr<const RepositoryName> & rf,
const std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirements> & u,
const std::tr1::shared_ptr<const DepTag> & t,
const std::string & st) :
@@ -134,7 +136,8 @@ namespace paludis
version_requirements(v),
version_requirements_mode(m),
slot(s),
- repository(r),
+ in_repository(ri),
+ from_repository(rf),
additional_requirements(u),
tag(t),
str(st)
@@ -260,7 +263,8 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PackageDepSpec & p) :
make_shared_ptr(new VersionRequirements),
p.version_requirements_mode(),
p.slot_requirement_ptr(),
- deep_copy(p.repository_ptr()),
+ deep_copy(p.in_repository_ptr()),
+ deep_copy(p.from_repository_ptr()),
p.additional_requirements_ptr(),
p.tag(),
stringify(p)))
@@ -281,7 +285,8 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PythonPackageDepSpec & p) :
make_shared_ptr(new VersionRequirements),
p.version_requirements_mode(),
p.slot_requirement_ptr(),
- deep_copy(p.repository_ptr()),
+ deep_copy(p.in_repository_ptr()),
+ deep_copy(p.from_repository_ptr()),
p.additional_requirements_ptr(),
p.tag(),
p.py_str()))
@@ -312,8 +317,11 @@ PythonPackageDepSpec::operator PackageDepSpec() const
if (slot_requirement_ptr())
p.slot_requirement(slot_requirement_ptr());
- if (repository_ptr())
- p.repository(*repository_ptr());
+ if (in_repository_ptr())
+ p.in_repository(*in_repository_ptr());
+
+ if (from_repository_ptr())
+ p.from_repository(*from_repository_ptr());
if (additional_requirements_ptr())
{
@@ -395,9 +403,15 @@ PythonPackageDepSpec::slot_requirement_ptr() const
}
std::tr1::shared_ptr<const RepositoryName>
-PythonPackageDepSpec::repository_ptr() const
+PythonPackageDepSpec::in_repository_ptr() const
+{
+ return _imp->in_repository;
+}
+
+std::tr1::shared_ptr<const RepositoryName>
+PythonPackageDepSpec::from_repository_ptr() const
{
- return _imp->repository;
+ return _imp->from_repository;
}
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirements>
@@ -1236,9 +1250,15 @@ void expose_dep_spec()
)
#endif
- .add_property("repository", &PythonPackageDepSpec::repository_ptr,
+ .add_property("in_repository", &PythonPackageDepSpec::in_repository_ptr,
+ "[ro] RepositoryName\n"
+ "In repository name (may be None)."
+
+ )
+
+ .add_property("from_repository", &PythonPackageDepSpec::from_repository_ptr,
"[ro] RepositoryName\n"
- "Repository name (may be None)."
+ "From repository name (may be None)."
)
#if 0
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index a2c64d3..cdad863 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -175,7 +175,8 @@ namespace paludis
VersionRequirementsMode version_requirements_mode() const;
void set_version_requirements_mode(const VersionRequirementsMode m);
std::tr1::shared_ptr<const SlotRequirement> slot_requirement_ptr() const;
- std::tr1::shared_ptr<const RepositoryName> repository_ptr() const;
+ std::tr1::shared_ptr<const RepositoryName> in_repository_ptr() const;
+ std::tr1::shared_ptr<const RepositoryName> from_repository_ptr() const;
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const;
std::tr1::shared_ptr<const DepTag> tag() const;
void set_tag(const std::tr1::shared_ptr<const DepTag> & s);
diff --git a/python/dep_spec_TEST.py b/python/dep_spec_TEST.py
index b675464..eb867cd 100755
--- a/python/dep_spec_TEST.py
+++ b/python/dep_spec_TEST.py
@@ -66,9 +66,10 @@ class TestCase_1_DepSpecs(unittest.TestCase):
self.get_depspecs()
self.assertEqual(str(self.pds.package), "foo/bar")
- def test_06_repository(self):
+ def test_06_in_from_repository(self):
self.get_depspecs()
- self.assertEqual(str(self.pds.repository), "testrepo")
+ self.assertEqual(str(self.pds.in_repository), "testrepo")
+ self.assertEqual(self.pds.from_repository, None)
def test_07_version_requirements(self):
self.get_depspecs()
diff --git a/python/generator.cc b/python/generator.cc
index cf44783..4b7d330 100644
--- a/python/generator.cc
+++ b/python/generator.cc
@@ -83,10 +83,16 @@ void expose_generator()
bp::init<const CategoryNamePart &>("__init__(category)")
);
- bp::class_<generator::Repository, bp::bases<Generator> > generator_repository(
+ bp::class_<generator::InRepository, bp::bases<Generator> > generator_in_repository(
"Repository",
"Generate all packages in a given repository.",
bp::init<const RepositoryName &>("__init__(repository)")
);
+
+ bp::class_<generator::FromRepository, bp::bases<Generator> > generator_from_repository(
+ "Repository",
+ "Generate all packages originally from a given repository.",
+ bp::init<const RepositoryName &>("__init__(repository)")
+ );
}