Skip to content

Commit

Permalink
pep8 spacing on files that haven't been touched in a while
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Sep 14, 2014
1 parent 8650eba commit a12b9bb
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions master/contrib/buildbot_cvs_mail.py
Expand Up @@ -82,56 +82,56 @@ def quotename(name):

def send_mail(options):
# Create the smtp connection to the localhost
conn = options.smtplib.SMTP()
conn.connect(options.mailhost, options.mailport)
if pwd:
pwinfo = pwd.getpwuid(os.getuid())
user = pwinfo[0]
name = pwinfo[4]
conn = options.smtplib.SMTP()
conn.connect(options.mailhost, options.mailport)
if pwd:
pwinfo = pwd.getpwuid(os.getuid())
user = pwinfo[0]
name = pwinfo[4]
else:
user = 'cvs'
name = 'CVS'

domain = options.fromhost
if not domain:
# getfqdn is not good for use in unit tests
if options.amTesting:
domain = 'testing.com'
else:
user = 'cvs'
name = 'CVS'

domain = options.fromhost
if not domain:
# getfqdn is not good for use in unit tests
if options.amTesting:
domain = 'testing.com'
else:
domain = socket.getfqdn()
address = '%s@%s' % (user, domain)
s = StringIO()
datestamp = time.strftime('%a, %d %b %Y %H:%M:%S +0000',
time.gmtime(time.time()))
fileList = ' '.join(map(str, options.files))

vars = {'author': formataddr((name, address)),
'email': options.email,
'subject': 'cvs update for project %s' % options.project,
'version': __version__,
'date': datestamp,
}
print >> s, '''\
domain = socket.getfqdn()
address = '%s@%s' % (user, domain)
s = StringIO()
datestamp = time.strftime('%a, %d %b %Y %H:%M:%S +0000',
time.gmtime(time.time()))
fileList = ' '.join(map(str, options.files))

vars = {'author': formataddr((name, address)),
'email': options.email,
'subject': 'cvs update for project %s' % options.project,
'version': __version__,
'date': datestamp,
}
print >> s, '''\
From: %(author)s
To: %(email)s''' % vars
if options.replyto:
print >> s, 'Reply-To: %s' % options.replyto
print >>s, '''\
if options.replyto:
print >> s, 'Reply-To: %s' % options.replyto
print >>s, '''\
Subject: %(subject)s
Date: %(date)s
X-Mailer: Python buildbot-cvs-mail %(version)s
''' % vars
print >> s, 'Cvsmode: %s' % options.cvsmode
print >> s, 'Category: %s' % options.category
print >> s, 'CVSROOT: %s' % options.cvsroot
print >> s, 'Files: %s' % fileList
if options.path:
print >> s, 'Path: %s' % options.path
print >> s, 'Project: %s' % options.project
s.write(sys.stdin.read())
print >> s
conn.sendmail(address, options.email, s.getvalue())
conn.close()
print >> s, 'Cvsmode: %s' % options.cvsmode
print >> s, 'Category: %s' % options.category
print >> s, 'CVSROOT: %s' % options.cvsroot
print >> s, 'Files: %s' % fileList
if options.path:
print >> s, 'Path: %s' % options.path
print >> s, 'Project: %s' % options.project
s.write(sys.stdin.read())
print >> s
conn.sendmail(address, options.email, s.getvalue())
conn.close()


def fork_and_send_mail(options):
Expand All @@ -156,54 +156,54 @@ def fork_and_send_mail(options):
version=__version__)

parser.add_option("-C", "--category", dest='category', metavar="CAT",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
Category for change. This becomes the Change.category attribute, which
can be used within the buildmaster to filter changes.
"""))
parser.add_option("-c", "--cvsroot", dest='cvsroot', metavar="PATH",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
CVSROOT for use by buildbot slaves to checkout code.
This becomes the Change.repository attribute.
Exmaple: :ext:myhost:/cvsroot
"""))
parser.add_option("-e", "--email", dest='email', metavar="EMAIL",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
Email address of the buildbot.
"""))
parser.add_option("-f", "--fromhost", dest='fromhost', metavar="HOST",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
The hostname that email messages appear to be coming from. The From:
header of the outgoing message will look like user@hostname. By
default, hostname is the machine's fully qualified domain name.
"""))
parser.add_option("-m", "--mailhost", dest='mailhost', metavar="HOST",
default="localhost",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
The hostname of an available SMTP server. The default is
'localhost'.
"""))
parser.add_option("--mailport", dest='mailport', metavar="PORT",
default=25, type="int",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
The port number of SMTP server. The default is '25'.
"""))
parser.add_option("-q", "--quiet", dest='verbose', action="store_false",
default=True,
help=textwrap.dedent("""\
help=textwrap.dedent("""\
Don't print as much status to stdout.
"""))
parser.add_option("-p", "--path", dest='path', metavar="PATH",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
The path for the files in this update. This comes from the %p parameter
in loginfo for CVS version 1.12.x. Do not use this for CVS version 1.11.x
"""))
parser.add_option("-P", "--project", dest='project', metavar="PROJ",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
The project for the source. Often set to the CVS module being modified. This becomes
the Change.project attribute.
"""))
parser.add_option("-R", "--reply-to", dest='replyto', metavar="ADDR",
help=textwrap.dedent("""\
help=textwrap.dedent("""\
Add a "Reply-To: ADDR" header to the email message.
"""))
parser.add_option("-t", "--testing", action="store_true", dest="amTesting", default=False)
Expand Down

0 comments on commit a12b9bb

Please sign in to comment.