Remove the `harvest' command, and all other integration with the Harvest service, since it has been shut down.

This commit is contained in:
Iain Lane 2017-03-31 13:03:15 +01:00 committed by Mattia Rizzolo
parent 88fbffaf49
commit a6043a6ba8
7 changed files with 0 additions and 144 deletions

2
debian/control vendored
View File

@ -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

3
debian/copyright vendored
View File

@ -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 <bdrung@ubuntu.com>
2007-2011, Canonical Ltd.
2008, Jonathan Patrick Davies <jpds@ubuntu.com>

View File

@ -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
<daniel.holbach@ubuntu.com>.
.PP
Both are released under the GNU General Public License, version 3 or
later.

50
harvest
View File

@ -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)

View File

@ -27,7 +27,6 @@ else:
'dch-repeat',
'grab-merge',
'grep-merges',
'harvest',
'hugdaylist',
'import-bug-from-debian',
'merge-changelog',

View File

@ -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))

View File

@ -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.