30 lines
790 B
Python
30 lines
790 B
Python
|
from ceo import members, terms
|
||
|
import re
|
||
|
|
||
|
class MathSocList:
|
||
|
help = '''
|
||
|
mathsoclist
|
||
|
|
||
|
Prints a current list of members that are likely to be paying MathSoc members.
|
||
|
'''
|
||
|
|
||
|
regex = ".*(mat/|vpa/se|computer science|math).*"
|
||
|
noinc = [ "dtbartle", "dlgawley", "cpdohert", "mbiggs", "tmyklebu" ]
|
||
|
|
||
|
def main(self, args):
|
||
|
regex = re.compile(self.regex)
|
||
|
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:
|
||
|
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]
|
||
|
)
|