aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/Makefile.am2
-rw-r--r--python/dep_spec.cc18
-rw-r--r--python/dep_spec.hh2
-rw-r--r--python/dep_tag.cc199
-rwxr-xr-xpython/dep_tag_TEST.py114
-rw-r--r--python/paludis_python.hh1
-rw-r--r--python/paludis_python_so.cc1
7 files changed, 0 insertions, 337 deletions
diff --git a/python/Makefile.am b/python/Makefile.am
index 32067bb47..4164596f0 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -30,7 +30,6 @@ IF_PYTHON_TESTS = \
choices_TEST.py \
dep_label_TEST.py \
dep_spec_TEST.py \
- dep_tag_TEST.py \
environment_TEST.py \
filter_TEST.py \
filtered_generator_TEST.py \
@@ -58,7 +57,6 @@ IF_PYTHON_SOURCES = \
contents.cc \
dep_label.cc \
dep_spec.hh dep_spec.cc \
- dep_tag.cc \
environment.cc \
exception.hh exception.cc \
filter.cc \
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index fbe91c781..5d7bb5e8d 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -23,7 +23,6 @@
#include <python/options.hh>
#include <python/nice_names-nn.hh>
-#include <paludis/dep_tag.hh>
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/user_dep_spec.hh>
@@ -82,7 +81,6 @@ namespace paludis
std::shared_ptr<const RepositoryName> in_repository;
std::shared_ptr<const RepositoryName> from_repository;
std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements;
- std::shared_ptr<const DepTag> tag;
const std::string str;
Imp(
@@ -95,7 +93,6 @@ namespace paludis
const std::shared_ptr<const RepositoryName> & ri,
const std::shared_ptr<const RepositoryName> & rf,
const std::shared_ptr<const AdditionalPackageDepSpecRequirements> & u,
- const std::shared_ptr<const DepTag> & t,
const std::string & st) :
package_ptr(q),
category_name_part_ptr(c),
@@ -106,7 +103,6 @@ namespace paludis
in_repository(ri),
from_repository(rf),
additional_requirements(u),
- tag(t),
str(st)
{
}
@@ -235,7 +231,6 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PackageDepSpec & p) :
deep_copy(p.in_repository_ptr()),
deep_copy(p.from_repository_ptr()),
p.additional_requirements_ptr(),
- p.tag(),
stringify(p))
{
if (p.version_requirements_ptr())
@@ -257,7 +252,6 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PythonPackageDepSpec & p) :
deep_copy(p.in_repository_ptr()),
deep_copy(p.from_repository_ptr()),
p.additional_requirements_ptr(),
- p.tag(),
p.py_str())
{
std::copy(p.version_requirements_ptr()->begin(), p.version_requirements_ptr()->end(),
@@ -375,24 +369,12 @@ PythonPackageDepSpec::additional_requirements_ptr() const
return _imp->additional_requirements;
}
-std::shared_ptr<const DepTag>
-PythonPackageDepSpec::tag() const
-{
- return _imp->tag;
-}
-
std::string
PythonPackageDepSpec::py_str() const
{
return _imp->str;
}
-void
-PythonPackageDepSpec::set_tag(const std::shared_ptr<const DepTag> & s)
-{
- _imp->tag = s;
-}
-
PythonPlainTextDepSpec::PythonPlainTextDepSpec(const std::string & s) :
PythonStringDepSpec(s)
{
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index 70b4a792c..a33adb6c7 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -182,8 +182,6 @@ namespace paludis
std::shared_ptr<const RepositoryName> in_repository_ptr() const;
std::shared_ptr<const RepositoryName> from_repository_ptr() const;
std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const;
- std::shared_ptr<const DepTag> tag() const;
- void set_tag(const std::shared_ptr<const DepTag> & s);
std::string py_str() const;
};
diff --git a/python/dep_tag.cc b/python/dep_tag.cc
deleted file mode 100644
index 1ee440568..000000000
--- a/python/dep_tag.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 Piotr Jaroszyński
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <python/paludis_python.hh>
-#include <python/exception.hh>
-#include <python/iterable.hh>
-
-#include <paludis/dep_tag.hh>
-#include <paludis/dep_spec.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-
-using namespace paludis;
-using namespace paludis::python;
-namespace bp = boost::python;
-
-struct DepTagCategoryFactoryWrapper
-{
- // More convenient way of creating DepTagCategories
- static std::shared_ptr<const DepTagCategory>
- create(const DepTagCategoryFactory & self, const std::string & id)
- {
- return self.create(id);
- }
-};
-
-void expose_dep_tag()
-{
- /**
- * DepTagCategory
- */
- register_shared_ptrs_to_python<DepTagCategory>();
- bp::class_<DepTagCategory, boost::noncopyable>
- (
- "DepTagCategory",
- "A DepTagCategory is identified by its name and has associated display "
- "information for a DepTag's category.",
- bp::no_init
- )
- .add_property("visible", &DepTagCategory::visible,
- "[ro] bool\n"
- "Should we be displayed in a tag category summary?"
- )
-
- .add_property("id", &DepTagCategory::id,
- "[ro] string\n"
- "Fetch our short ID (for example, 'GLSA')."
- )
-
- .add_property("title", &DepTagCategory::title,
- "[ro] string\n"
- "Fetch our title (for example, 'Security advisories'), or an "
- "empty string if we're untitled."
- )
-
- .add_property("pre_text", &DepTagCategory::pre_text,
- "[ro] string\n"
- "Fetch our pre list text, or an empty string."
- )
-
- .add_property("post_text", &DepTagCategory::post_text,
- "[ro] string\n"
- "Fetch our post list text, or an empty string."
- )
- ;
-
- /**
- * DepTagCategoryFactory
- */
- bp::class_<DepTagCategoryFactory, boost::noncopyable>
- (
- "DepTagCategoryFactory",
- "Virtual constructor for accessing DepTagCategory instances.",
- bp::no_init
- )
- .add_static_property("instance", bp::make_function(&DepTagCategoryFactory::get_instance,
- bp::return_value_policy<bp::reference_existing_object>()),
- "Singleton instance."
- )
-
- .def("create", &DepTagCategoryFactory::create,
- "create(id_string) -> DepTagCategory\n"
- "Make DepTagCategory from id."
- )
- ;
-
- /**
- * DepTag
- */
- bp::class_<DepTag, boost::noncopyable>
- (
- "DepTag",
- "A DepTag can be associated with a PackageDepSpec, and is transferred "
- "onto any associated DepListEntry instances.",
- bp::no_init
- )
- .add_property("short_text", &DepTag::short_text,
- "[ro] string\n"
- "Our short text (for example, 'GLSA-1234') that is "
- "displayed with the dep list entry."
- )
-
- .add_property("category", &DepTag::category,
- "[ro] string\n"
- "Our DepTagCategory's tag."
- )
-
- .def("__cmp__", &py_cmp<DepTag>)
- ;
-
- /**
- * GLSADepTag
- */
- bp::class_<GLSADepTag, bp::bases<DepTag>, boost::noncopyable>
- (
- "GLSADepTag",
- "DepTag subclass for GLSAs.",
- bp::init<const std::string &, const std::string &, const FSPath &>("__init__(id_str, glsa_title_str, glsa_file_str)")
- )
- .add_property("glsa_title", &GLSADepTag::glsa_title,
- "Our GLSA title (for example, 'Yet another PHP remote access hole')"
- )
- .add_property("glsa_file", &GLSADepTag::glsa_file,
- "Our GLSA filename"
- )
- ;
-
- /**
- * GeneralSetDepTag
- */
- bp::class_<GeneralSetDepTag, bp::bases<DepTag>, boost::noncopyable>
- (
- "GeneralSetDepTag",
- "DepTag subclass for general sets.",
- bp::init<const SetName &, const std::string &>("__init__(SetName, source_str)")
- )
- .add_property("source", &GeneralSetDepTag::source,
- "From which repository or environment did we originate?"
- )
- ;
-
- /**
- * DependencyDepTag
- */
- bp::class_<DependencyDepTag, bp::bases<DepTag>, boost::noncopyable>
- (
- "DependencyDepTag",
- "DepTag subclass for dependencies.",
- bp::init<const std::shared_ptr<const PackageID> &, const PackageDepSpec &>(
- "__init__(PackageID, PackageDepSpec)"
- )
- )
- .add_property("package_id", &DependencyDepTag::package_id,
- "[ro] PackageID\n"
- "The PackageID that contains our dependency."
- )
-
- .add_property("dependency", bp::make_function(&DependencyDepTag::dependency,
- bp::return_value_policy<bp::return_by_value>()),
- "[ro] PackageDepSpec\n"
- "The PackageDepSpec that pulled us in."
- )
- ;
-
- /**
- * TargetDepTag
- */
- bp::class_<TargetDepTag, bp::bases<DepTag>, boost::noncopyable>
- (
- "TargetDepTag",
- "DepTag subclass for explicit targets.",
- bp::init<>("__init__()")
- )
- ;
-
- /**
- * DepListEntryTags
- */
- class_iterable<DepListEntryTags>
- (
- "DepListEntryTags",
- "Tags attached to a DepListEntry."
- );
-}
diff --git a/python/dep_tag_TEST.py b/python/dep_tag_TEST.py
deleted file mode 100755
index d809b0d46..000000000
--- a/python/dep_tag_TEST.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env python
-# vim: set fileencoding=utf-8 sw=4 sts=4 et :
-
-#
-# Copyright (c) 2007 Piotr Jaroszyński
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-from paludis import *
-import unittest
-
-class TestCase_01_DepTag(unittest.TestCase):
- def test_01_no_create(self):
- self.assertRaises(Exception, DepTag)
-
-class TestCase_02_GLSADepTag(unittest.TestCase):
- def setUp(self):
- global dt
- dt = GLSADepTag("id", "title", "/path")
-
- def test_01_instance(self):
- self.assert_(isinstance(dt, DepTag))
-
- def test_02_properties(self):
- self.assertEquals(dt.category, "glsa")
- self.assertEquals(dt.short_text, "GLSA-id")
- self.assertEquals(dt.glsa_title, "title")
- self.assertEquals(dt.glsa_file, "/path")
-
-class TestCase_03_GeneralSetDepTag(unittest.TestCase):
- def setUp(self):
- global dt
- dt = GeneralSetDepTag("set_name", "source")
-
- def test_01_instance(self):
- self.assert_(isinstance(dt, DepTag))
-
- def test_02_properties(self):
- self.assertEquals(dt.category, "general")
- self.assertEquals(dt.short_text, "set_name")
- self.assertEquals(dt.source, "source")
-
-class TestCase_04_DependencyDepTag(unittest.TestCase):
- def setUp(self):
- global dt, pid, pds, cds
- env = TestEnvironment()
- repo = FakeRepository(env, "repo")
- pid = repo.add_version("cat/foo", VersionSpec("1.0"))
- pds = parse_user_package_dep_spec("=cat/boo-1", env, [])
- dt = DependencyDepTag(pid, pds);
-
- def test_01_instance(self):
- self.assert_(isinstance(dt, DepTag))
-
- def test_02_properties(self):
- self.assertEquals(dt.category, "dependency")
- self.assertEquals(dt.short_text, "cat/foo-1.0:0::repo")
- self.assertEquals(dt.package_id, pid)
- self.assertEquals(str(dt.dependency), str(pds))
-
-class TestCase_05_TargetDepTag(unittest.TestCase):
- def setUp(self):
- global dt
- dt = TargetDepTag()
-
- def test_01_instance(self):
- self.assert_(isinstance(dt, DepTag))
-
- def test_02_properties(self):
- self.assertEquals(dt.category, "target")
- self.assertEquals(dt.short_text, "target")
-
-class TestCase_06_DepTagCategoryFactory(unittest.TestCase):
- def test_01_no_create(self):
- self.assertRaises(Exception, DepTagCategoryFactory)
-
- def test_02_instance(self):
- self.assert_(isinstance(DepTagCategoryFactory.instance, DepTagCategoryFactory))
-
- def test_03_create(self):
- cdt = DepTagCategoryFactory.instance.create("glsa")
- self.assert_(isinstance(cdt, DepTagCategory))
-
- self.assertRaises(ConfigurationError, DepTagCategoryFactory.instance.create, "foo")
-
-class TestCase_07_DepTagCategory(unittest.TestCase):
- def setUp(self):
- global cdt
- cdt = DepTagCategoryFactory.instance.create("glsa")
-
- def test_01_no_create(self):
- self.assertRaises(Exception, DepTagCategory)
-
- def test_02_properties(self):
- self.assertEquals(cdt.visible, True)
- self.assertEquals(cdt.id, "glsa")
- self.assertEquals(cdt.title, "Security advisories")
- self.assertEquals(cdt.pre_text, "Your system is potentially affected by these security issues:")
- self.assertEquals(cdt.post_text, "Please read the advisories carefully and take appropriate action.")
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/python/paludis_python.hh b/python/paludis_python.hh
index 2dc5fb38d..496ecc6e1 100644
--- a/python/paludis_python.hh
+++ b/python/paludis_python.hh
@@ -177,7 +177,6 @@ void expose_choices() PALUDIS_VISIBLE;
void expose_contents() PALUDIS_VISIBLE;
void expose_dep_label() PALUDIS_VISIBLE;
void expose_dep_spec() PALUDIS_VISIBLE;
-void expose_dep_tag() PALUDIS_VISIBLE;
void expose_environment() PALUDIS_VISIBLE;
void expose_exception() PALUDIS_VISIBLE;
void expose_filter() PALUDIS_VISIBLE;
diff --git a/python/paludis_python_so.cc b/python/paludis_python_so.cc
index 9517ead30..938043536 100644
--- a/python/paludis_python_so.cc
+++ b/python/paludis_python_so.cc
@@ -38,7 +38,6 @@ BOOST_PYTHON_MODULE(paludis)
expose_contents();
expose_filter(); /* must be before dep_spec */
expose_dep_spec();
- expose_dep_tag();
expose_dep_label();
expose_name();
expose_log();