From 15bbfd0e07495220c5e29433bcea90356fddd513 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Thu, 10 Sep 2009 18:59:20 -0400 Subject: [PATCH] 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. --- ceo/console/main.py | 2 -- ceo/console/mathsoclist.py | 31 ------------------------------- ceo/members.py | 2 +- etc/accounts.cf | 2 -- 4 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 ceo/console/mathsoclist.py diff --git a/ceo/console/main.py b/ceo/console/main.py index 434f49b..f43150d 100644 --- a/ceo/console/main.py +++ b/ceo/console/main.py @@ -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' ] diff --git a/ceo/console/mathsoclist.py b/ceo/console/mathsoclist.py deleted file mode 100644 index 1f067aa..0000000 --- a/ceo/console/mathsoclist.py +++ /dev/null @@ -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] - ) diff --git a/ceo/members.py b/ceo/members.py index 5ebf272..8698957 100644 --- a/ceo/members.py +++ b/ceo/members.py @@ -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 diff --git a/etc/accounts.cf b/etc/accounts.cf index 79ae37d..26a1286 100644 --- a/etc/accounts.cf +++ b/etc/accounts.cf @@ -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"