Add term argument to mathsoclist

This commit is contained in:
David Bartley 2008-04-08 19:02:00 -04:00
parent fdcff72d83
commit b0dc96ff75
1 changed files with 7 additions and 3 deletions

View File

@ -3,9 +3,10 @@ import re
class MathSocList: class MathSocList:
help = ''' help = '''
mathsoclist mathsoclist [term]
Prints a current list of members that are likely to be paying MathSoc members. 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).*" regex = ".*(mat/|vpa/se|computer science|math).*"
@ -13,7 +14,10 @@ Prints a current list of members that are likely to be paying MathSoc members.
def main(self, args): def main(self, args):
regex = re.compile(self.regex) regex = re.compile(self.regex)
mlist = members.list_term(terms.current()) if len(args) == 1:
mlist = members.list_term(args[0])
else:
mlist = members.list_term(terms.current())
dns = mlist.keys() dns = mlist.keys()
dns.sort() dns.sort()
for dn in dns: for dn in dns: