2011-03-21 12:39:25 +01:00
|
|
|
#!/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
|
|
|
|
#
|
|
|
|
#
|
2011-05-23 23:44:45 +02:00
|
|
|
# Daniel Holbach
|
2011-03-21 12:39:25 +01:00
|
|
|
# (c) 2011 Canonical
|
|
|
|
|
|
|
|
from optparse import OptionParser
|
|
|
|
import sys
|
|
|
|
|
2011-09-04 00:24:27 +02:00
|
|
|
from devscripts.logger import Logger
|
2011-03-21 12:39:25 +01:00
|
|
|
|
2011-09-04 00:24:27 +02:00
|
|
|
from ubuntutools.harvest import Harvest
|
2011-03-21 12:39:25 +01:00
|
|
|
|
|
|
|
def main():
|
|
|
|
usage = "usage: %prog source-package-name"
|
|
|
|
opt_parser = OptionParser(usage)
|
2011-09-06 13:11:42 +02:00
|
|
|
args = opt_parser.parse_args()[1]
|
2011-09-04 00:24:27 +02:00
|
|
|
if len(args) != 1:
|
2011-03-21 12:39:25 +01:00
|
|
|
opt_parser.print_help()
|
|
|
|
sys.exit(1)
|
2011-09-04 00:24:27 +02:00
|
|
|
pkg = args[0].strip()
|
|
|
|
|
|
|
|
print Harvest(pkg).report()
|
2011-03-21 12:39:25 +01:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
try:
|
|
|
|
main()
|
|
|
|
except KeyboardInterrupt:
|
2011-09-04 00:24:27 +02:00
|
|
|
Logger.error("Aborted.")
|
2011-03-21 12:39:25 +01:00
|
|
|
sys.exit(1)
|