requestsync: Fix indentation

This commit is contained in:
Daniel Hahler 2008-02-09 04:03:38 +01:00
parent f99fc1109c
commit 5401bffe45

View File

@ -19,11 +19,11 @@ def cur_version_component(sourcepkg, release):
assert (madison.returncode == 0) assert (madison.returncode == 0)
for l in out.splitlines(): for l in out.splitlines():
(pkg, version, rel, builds) = l.split('|') (pkg, version, rel, builds) = l.split('|')
component = 'main' component = 'main'
if rel.find('/') != -1: if rel.find('/') != -1:
component = rel.split('/')[1] component = rel.split('/')[1]
return (version.strip(), component.strip()) return (version.strip(), component.strip())
print "%s doesn't appear to exist in %s, specify -n for a package not in Ubuntu." % (sourcepkg, release) print "%s doesn't appear to exist in %s, specify -n for a package not in Ubuntu." % (sourcepkg, release)
sys.exit(1) sys.exit(1)
@ -89,7 +89,7 @@ def wait_for_enter_or_exit():
raw_input() raw_input()
except KeyboardInterrupt: except KeyboardInterrupt:
print 'Abort requested. No sync request filed.' print 'Abort requested. No sync request filed.'
sys.exit(1) sys.exit(1)
def usage(): def usage():
print '''Usage: requestsync [-h|-n|-s|-k <keyid>|--lp] <source package> <target release> [basever] print '''Usage: requestsync [-h|-n|-s|-k <keyid>|--lp] <source package> <target release> [basever]
@ -171,7 +171,7 @@ def mail_bug(source_package, subscribe, status, bugtitle, bugtext, keyid = None)
mailserver_pass = os.getenv('DEBSMTP_PASS') mailserver_pass = os.getenv('DEBSMTP_PASS')
if mailserver_user and mailserver_pass: if mailserver_user and mailserver_pass:
try: try:
s.login(mailserver_user, mailserver_pass) s.login(mailserver_user, mailserver_pass)
except smtplib.SMTPAuthenticationError: except smtplib.SMTPAuthenticationError:
print 'Error authenticating to the server: invalid username and password.' print 'Error authenticating to the server: invalid username and password.'
s.quit() s.quit()
@ -211,7 +211,7 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
product = {'name': source_package, 'target': 'ubuntu'} product = {'name': source_package, 'target': 'ubuntu'}
else: else:
# new source package # new source package
product = {'name': 'ubuntu'} product = {'name': 'ubuntu'}
print 'Summary:\n%s\n\nDescription:\n%s' % (bugtitle, bugtext) print 'Summary:\n%s\n\nDescription:\n%s' % (bugtitle, bugtext)
@ -346,12 +346,12 @@ if __name__ == '__main__':
srcpkg = not newsource and srcpkg or None srcpkg = not newsource and srcpkg or None
if use_lp_bugs: if use_lp_bugs:
# Map status to the values expected by lp-bugs # Map status to the values expected by lp-bugs
mapping = {'new': 'New', 'confirmed': 'Confirmed'} mapping = {'new': 'New', 'confirmed': 'Confirmed'}
if post_bug(srcpkg, subscribe, mapping[status], title, report): if post_bug(srcpkg, subscribe, mapping[status], title, report):
sys.exit(0) sys.exit(0)
if mail_bug(srcpkg, subscribe, status, title, report, keyid): if mail_bug(srcpkg, subscribe, status, title, report, keyid):
sys.exit(0) sys.exit(0)
print 'Something went wrong. No sync request filed.' print 'Something went wrong. No sync request filed.'
sys.exit(1) sys.exit(1)