dgetlp: Sort imports.

This commit is contained in:
Benjamin Drung 2011-02-12 23:00:21 +01:00
parent 02c7c47ece
commit 5480d7bcef

20
dgetlp
View File

@ -27,14 +27,16 @@
# Librarian and attempts to download and then unpack them. # Librarian and attempts to download and then unpack them.
# This is a Python rewrite of the original bash script # This is a Python rewrite of the original bash script
import sys, os import cStringIO
from optparse import OptionParser import email.feedparser
import urllib2
import hashlib import hashlib
import optparse
import os
import subprocess import subprocess
import sys
import urllib2
import GnuPGInterface import GnuPGInterface
from cStringIO import StringIO
from email.feedparser import FeedParser
USAGE = u"""Usage: %prog [-d|(-v|-q)] <Launchpad URL> USAGE = u"""Usage: %prog [-d|(-v|-q)] <Launchpad URL>
@ -74,7 +76,7 @@ def unsign(data):
return plain return plain
def get_entries(data): def get_entries(data):
parser = FeedParser() parser = email.feedparser.FeedParser()
parser.feed(data) parser.feed(data)
return parser.close() return parser.close()
@ -236,7 +238,7 @@ def get_host(url):
def main(): def main():
global Debug, Verbose, Quiet global Debug, Verbose, Quiet
parser = OptionParser(usage=USAGE) parser = optparse.OptionParser(usage=USAGE)
parser.add_option("-d", "--debug", action="store_true", dest="debug", parser.add_option("-d", "--debug", action="store_true", dest="debug",
default=False, help="Enable debugging") default=False, help="Enable debugging")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
@ -253,8 +255,8 @@ def main():
if Verbose and Quiet: if Verbose and Quiet:
error(4, "Specifying both --verbose and --quiet does not make sense") error(4, "Specifying both --verbose and --quiet does not make sense")
if Quiet: if Quiet:
sys.stderr = StringIO() sys.stderr = cStringIO.StringIO()
sys.stdout = StringIO() sys.stdout = cStringIO.StringIO()
url = args[0] url = args[0]