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.
 
 
 
 
 

32 lines
988 B

  1. #! /usr/bin/python3
  2. # -*- python -*-
  3. import os
  4. import re
  5. OUT = os.fdopen(3, 'w', encoding='utf-8', errors='backslashreplace')
  6. envprint = False
  7. for var in ['EDITOR', 'PAGER', 'VISUAL', 'REPORTBUGEMAIL', 'DEBEMAIL', 'EMAIL',
  8. 'DEBFULLNAME', 'DEBNAME', 'NAME', 'INTERFACE']:
  9. if var in os.environ:
  10. if not envprint:
  11. print('** Environment settings:', file=OUT)
  12. envprint = True
  13. print('%s="%s"' % (var, os.environ[var]), file=OUT)
  14. passwdre = re.compile(r'\s*(smtppasswd)\s+(.*)$')
  15. USERFILE = os.path.expanduser('~/.reportbugrc')
  16. if os.path.exists(USERFILE):
  17. if envprint:
  18. print(file=OUT)
  19. print('** %s:' % USERFILE, file=OUT)
  20. for line in open(USERFILE, 'r', encoding='utf-8', errors='backslashreplace'):
  21. line = line.strip()
  22. if line and not line.startswith('#'):
  23. m = passwdre.match(line)
  24. if m:
  25. line = '%s <omitted>' % m.group(1)
  26. print(line, file=OUT)