You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
865 B
31 lines
865 B
#!/usr/bin/python
|
|
# -*- python -*-
|
|
|
|
import os
|
|
import re
|
|
|
|
OUT=os.fdopen(3, 'w')
|
|
|
|
envprint = False
|
|
for var in ['EDITOR', 'VISUAL', 'REPORTBUGEMAIL', 'DEBEMAIL', 'EMAIL',
|
|
'DEBFULLNAME', 'DEBNAME', 'NAME', 'INTERFACE']:
|
|
if var in os.environ:
|
|
if not envprint:
|
|
print >> OUT, '** Environment settings:'
|
|
envprint = True
|
|
print >> OUT, '%s="%s"' % (var, os.environ[var])
|
|
|
|
passwdre = re.compile(r'\s*(smtppasswd)\s+(.*)$')
|
|
|
|
USERFILE = os.path.expanduser('~/.reportbugrc')
|
|
if os.path.exists(USERFILE):
|
|
if envprint:
|
|
print >> OUT
|
|
print >> OUT, '** %s:' % USERFILE
|
|
for line in file(USERFILE):
|
|
line = line.strip()
|
|
if line and not line.startswith('#'):
|
|
m = passwdre.match(line)
|
|
if m:
|
|
line = '%s <omitted>' % m.group(1)
|
|
print >> OUT, line
|
|
|