From a6043a6ba8a5bd8df1f99795f187fbf2be6fa8c4 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Fri, 31 Mar 2017 13:03:15 +0100 Subject: [PATCH] Remove the `harvest' command, and all other integration with the Harvest service, since it has been shut down. --- debian/control | 2 - debian/copyright | 3 - doc/harvest.1 | 19 ------ harvest | 50 ---------------- setup.py | 1 - ubuntutools/harvest.py | 65 --------------------- ubuntutools/sponsor_patch/source_package.py | 4 -- 7 files changed, 144 deletions(-) delete mode 100644 doc/harvest.1 delete mode 100755 harvest delete mode 100644 ubuntutools/harvest.py diff --git a/debian/control b/debian/control index bbd7e47..6e17fdb 100644 --- a/debian/control +++ b/debian/control @@ -91,8 +91,6 @@ Description: useful tools for Ubuntu developers - dch-repeat - used to repeat a change log into an older release. - grab-merge - grabs a merge from merges.ubuntu.com easily. - grep-merges - search for pending merges from Debian. - - harvest - grabs information about development opportunities from - http://harvest.ubuntu.com - hugdaylist - compile HugDay lists from bug list URLs. - import-bug-from-debian - copy a bug from the Debian BTS to Launchpad - merge-changelog - manually merges two Debian changelogs with the same base diff --git a/debian/copyright b/debian/copyright index f2d0c76..57105f4 100644 --- a/debian/copyright +++ b/debian/copyright @@ -74,19 +74,16 @@ License: GPL-2+ Files: doc/bitesize.1 doc/grab-merge.1 - doc/harvest.1 doc/hugdaylist.1 doc/merge-changelog.1 doc/setup-packaging-environment.1 doc/syncpackage.1 bitesize grab-merge - harvest hugdaylist merge-changelog setup-packaging-environment syncpackage - ubuntutools/harvest.py Copyright: 2010, Benjamin Drung 2007-2011, Canonical Ltd. 2008, Jonathan Patrick Davies diff --git a/doc/harvest.1 b/doc/harvest.1 deleted file mode 100644 index b4063bf..0000000 --- a/doc/harvest.1 +++ /dev/null @@ -1,19 +0,0 @@ -.TH harvest 1 "March 21, 2011" "ubuntu-dev-tools" - -.SH NAME -harvest \- grabs information about a given source package from harvest.ubuntu.com. - -.SH SYNOPSIS -\fBharvest\fP <\fIsource package name\fP> - -.SH DESCRIPTION -\fBharvest\fP is a script that downloads information about development -opportunities from harvest.ubuntu.com and gives a summary of the types of -opportunities. - -.SH AUTHORS -\fBharvest\fP and its manpage were written by Daniel Holbach -. -.PP -Both are released under the GNU General Public License, version 3 or -later. diff --git a/harvest b/harvest deleted file mode 100755 index 7938cea..0000000 --- a/harvest +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) 2011 Canonical Ltd., Daniel Holbach -# -# ################################################################## -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; version 3. -# -# This program 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. -# -# See file /usr/share/common-licenses/GPL-3 for more details. -# -# ################################################################## -# -# -# harvest - grabs information about development opportunities from -# harvest.ubuntu.com -# -# -# Daniel Holbach -# (c) 2011 Canonical - -from optparse import OptionParser -import sys - -from ubuntutools.harvest import Harvest -from ubuntutools.logger import Logger - -def main(): - usage = "usage: %prog source-package-name" - opt_parser = OptionParser(usage) - args = opt_parser.parse_args()[1] - if len(args) != 1: - opt_parser.print_help() - sys.exit(1) - pkg = args[0].strip() - - print Harvest(pkg).report() - -if __name__ == '__main__': - try: - main() - except KeyboardInterrupt: - Logger.error("Aborted.") - sys.exit(1) diff --git a/setup.py b/setup.py index 50ad138..bf97add 100755 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ else: 'dch-repeat', 'grab-merge', 'grep-merges', - 'harvest', 'hugdaylist', 'import-bug-from-debian', 'merge-changelog', diff --git a/ubuntutools/harvest.py b/ubuntutools/harvest.py deleted file mode 100644 index 21f6722..0000000 --- a/ubuntutools/harvest.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2011 Canonical Ltd., Daniel Holbach, Stefano Rivera -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; version 3. -# -# This program 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. -# -# See file /usr/share/common-licenses/GPL-3 for more details. - -import json -import os.path -import sys -try: - from urllib.request import urlopen - from urllib.error import URLError -except ImportError: - from urllib2 import urlopen - from urllib2 import URLError - -from ubuntutools.logger import Logger - -BASE_URL = "http://harvest.ubuntu.com/" - -class Harvest(object): - """The harvest data for a package""" - - def __init__(self, package): - self.package = package - self.human_url = os.path.join(BASE_URL, "opportunities", "package", - package) - self.data_url = os.path.join(BASE_URL, "opportunities", "json", package) - self.data = self._get_data() - - def _get_data(self): - try: - sock = urlopen(self.data_url) - except IOError: - try: - urlopen(BASE_URL) - except URLError: - Logger.error("Harvest is down.") - sys.exit(1) - return None - response = sock.read() - sock.close() - return json.loads(response) - - def opportunity_summary(self): - l = ["%s (%s)" % (k,v) for (k,v) in self.data.items() if k != "total"] - return ", ".join(l) - - def report(self): - if self.data is None: - return ("There is no information in Harvest about package '%s'." - % self.package) - return ("%s has %s opportunities: %s\n" - "Find out more: %s" - % (self.package, - self.data["total"], - self.opportunity_summary(), - self.human_url)) diff --git a/ubuntutools/sponsor_patch/source_package.py b/ubuntutools/sponsor_patch/source_package.py index b9fa2a0..91270d8 100644 --- a/ubuntutools/sponsor_patch/source_package.py +++ b/ubuntutools/sponsor_patch/source_package.py @@ -25,7 +25,6 @@ import debian.changelog import debian.deb822 from ubuntutools import subprocess -from ubuntutools.harvest import Harvest from ubuntutools.logger import Logger from ubuntutools.question import Question, YesNoQuestion @@ -379,9 +378,6 @@ class SourcePackage(object): if self._build_log: print("file://" + self._build_log) - harvest = Harvest(self._package) - if harvest.data: - print(harvest.report()) def reload_changelog(self): """Reloads debian/changelog and updates the version.