X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=073b8133ef3174aae090a536b2df337b54dc4e80;hb=b612f3da207fa0d75a5d3b204ac8f02bb244231a;hp=c40fe8e0efafcde03c217151f647c1a1672e3f97;hpb=6237cc158b46ecd9303d1a09bec56b22983bc968;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index c40fe8e0..073b8133 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -43,7 +43,8 @@ import email as modemail from dak_exceptions import * from regexes import re_html_escaping, html_escaping, re_single_line_field, \ re_multi_line_field, re_srchasver, re_verwithext, \ - re_parse_maintainer, re_taint_free, re_gpg_uid, re_re_mark + re_parse_maintainer, re_taint_free, re_gpg_uid, re_re_mark, \ + re_whitespace_comment ################################################################################ @@ -616,10 +617,11 @@ def send_mail (message, filename=""): whitelist_in = open_file(Cnf["Dinstall::MailWhiteList"]) try: for line in whitelist_in: - if re_re_mark.match(line): - whitelist.append(re.compile(re_re_mark.sub("", line.strip(), 1))) - else: - whitelist.append(re.compile(re.escape(line.strip()))) + if not re_whitespace_comment.match(line): + if re_re_mark.match(line): + whitelist.append(re.compile(re_re_mark.sub("", line.strip(), 1))) + else: + whitelist.append(re.compile(re.escape(line.strip()))) finally: whitelist_in.close() @@ -818,6 +820,9 @@ def warn(msg): def whoami (): return pwd.getpwuid(os.getuid())[4].split(',')[0].replace('.', '') +def getusername (): + return pwd.getpwuid(os.getuid())[0] + ################################################################################ def size_type (c):