Move mathsoc regex and exception userid's into config

This commit is contained in:
David Bartley 2008-05-10 16:57:46 -04:00
parent 0a35be2386
commit 181419ac7a
2 changed files with 7 additions and 8 deletions

View File

@ -9,20 +9,18 @@ Displays a list of members for a term that are likely to be paying MathSoc
members; defaults to the current term if term is not given.
'''
regex = ".*(mat/|vpa/se|computer science|math).*"
noinc = [ "dtbartle", "dlgawley", "cpdohert", "mbiggs", "tmyklebu" ]
def main(self, args):
regex = re.compile(self.regex)
regex = re.compile(members.cfg['mathsoc_regex'])
noinc = members.cfg['mathsoc_dont_count'].split(' ')
if len(args) == 1:
mlist = members.list_term(args[0])
mlist = members.list_term(args[0])
else:
mlist = members.list_term(terms.current())
mlist = members.list_term(terms.current())
dns = mlist.keys()
dns.sort()
for dn in dns:
member = mlist[dn]
if member['uid'][0] in self.noinc:
if member['uid'][0] in noinc:
continue
program = member.get('program', [''])[0]
if regex.match(program.lower()) != None:

View File

@ -26,7 +26,8 @@ def configure():
string_fields = [ 'username_regex', 'shells_file', 'server_url',
'users_base', 'groups_base', 'sasl_mech', 'sasl_realm',
'admin_bind_keytab', 'admin_bind_userid', 'realm',
'admin_principal', 'admin_keytab', 'expired_account_email' ]
'admin_principal', 'admin_keytab', 'expired_account_email',
'mathsoc_regex', 'mathsoc_dont_count' ]
numeric_fields = [ 'min_password_length' ]
# read configuration file