Kill mathsoclist

We can't reliably filter the membership list, because we don't know who has
paid the MathSOC fee. Better to leave MathSOC to do this. In the case that they
to not verify the list then mathsoclist puts us at a disadvantage, as other
clubs likely do not filter their lists.
master
Michael Spang 14 years ago
parent c51107ae2b
commit 15bbfd0e07
  1. 2
      ceo/console/main.py
  2. 31
      ceo/console/mathsoclist.py
  3. 2
      ceo/members.py
  4. 2
      etc/accounts.cf

@ -5,14 +5,12 @@ from ceo.console.memberlist import MemberList
from ceo.console.updateprograms import UpdatePrograms
from ceo.console.expiredaccounts import ExpiredAccounts
from ceo.console.inactive import Inactive
from ceo.console.mathsoclist import MathSocList
commands = {
'memberlist' : MemberList(),
'updateprograms' : UpdatePrograms(),
'expiredaccounts' : ExpiredAccounts(),
'inactive': Inactive(),
'mathsoclist' : MathSocList(),
}
help_opts = [ '--help', '-h' ]

@ -1,31 +0,0 @@
from ceo import members, terms
import re
class MathSocList:
help = '''
mathsoclist [term]
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.
'''
def main(self, args):
regex = re.compile(members.cfg['mathsoc_regex'])
noinc = members.cfg['mathsoc_dont_count'].split(' ')
if len(args) == 1:
mlist = members.list_term(args[0])
else:
mlist = members.list_term(terms.current())
dns = mlist.keys()
dns.sort()
for dn in dns:
member = mlist[dn]
if member['uid'][0] in noinc:
continue
program = member.get('program', [''])[0]
if regex.match(program.lower()) != None:
print '%s %s %s' % (
member['uid'][0].ljust(12),
member['cn'][0].ljust(30),
member.get('program', [''])[0]
)

@ -25,7 +25,7 @@ def configure():
string_fields = [ 'username_regex', 'shells_file', 'ldap_server_url',
'ldap_users_base', 'ldap_groups_base', 'ldap_sasl_mech', 'ldap_sasl_realm',
'expire_hook', 'mathsoc_regex', 'mathsoc_dont_count' ]
'expire_hook' ]
numeric_fields = [ 'min_password_length' ]
# read configuration file

@ -46,5 +46,3 @@ expire_hook = "/etc/csc/spam/expired-account"
username_regex = "^[a-z][-a-z0-9]*$"
min_password_length = 4
shells_file = "/etc/shells"
mathsoc_regex = ".*(mat/|vpa/se|computer science|math).*"
mathsoc_dont_count = "cpdohert dlgawley dtbartle mbiggs saforres tmyklebu mgregson rridge dbelange"

Loading…
Cancel
Save