#!/usr/bin/python import ldap, time, operator # # globals # cscUri = "http://csclub.uwaterloo.ca/xsltproc" cscTerms = ["Winter", "Spring", "Fall"] cscShortTerms = ['w', 's', 'f'] cscLdapUri = "ldap://ldap1.csclub.uwaterloo.ca ldap://ldap2.csclub.uwaterloo.ca" cscLdap = None cscPeopleBase = 'ou=People,dc=csclub,dc=uwaterloo,dc=ca' def cscLdapConnect(): global cscLdap cscLdap = ldap.initialize(cscLdapUri) cscLdap.simple_bind_s("", "") cscLdapConnect() def showExec(pretty, short): print "
" + pretty + "
"
members = cscLdap.search_s(cscPeopleBase, ldap.SCOPE_SUBTREE,
'(&(objectClass=member)(position=%s))' % short)
if len(members) > 0:
(_, user) = members[0]
print user['cn'][0]
else:
print 'Seat Empty'
print "
Each term the CSC holds elections to determine the executive council. To find out when and where the next elections will be held, check the homepage and the uw.csc newsgroup.
"
print "
For details on the election rules, see the constitution." print "
"