From fd2fefc64912396e358b9703f8c9835d53e05844 Mon Sep 17 00:00:00 2001 From: Jacob Parker Date: Thu, 23 Feb 2012 00:21:50 -0500 Subject: [PATCH] tidying some stuff up, added elections page --- bin/exec_positions.py | 47 +++++++++++++++++++++++++++++++++ bin/member_info.py | 5 ++++ bin/members.py | 1 + src/config.d | 1 + src/web.d | 4 ++- srv/About/Constitution/index.md | 2 +- 6 files changed, 58 insertions(+), 2 deletions(-) create mode 100755 bin/exec_positions.py diff --git a/bin/exec_positions.py b/bin/exec_positions.py new file mode 100755 index 0000000..2c7489b --- /dev/null +++ b/bin/exec_positions.py @@ -0,0 +1,47 @@ +#!/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 "

" + +print "

The Executive

" +showExec("President", "president") +showExec("Vice-President", "vice-president") +showExec("Treasurer", "treasurer") +showExec("Secretary", "secretary") +showExec("Systems Administrator", "sysadmin") + +print "

Other Positions

" +showExec("Chief Returning Officer", "cro") +showExec("Office Manager", "offsck") +showExec("Librarian", "librarian") + +print "

Elections

" +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 "

" diff --git a/bin/member_info.py b/bin/member_info.py index 72e8274..f285648 100755 --- a/bin/member_info.py +++ b/bin/member_info.py @@ -28,6 +28,11 @@ print "

Profile for " + user['cn'][0] + "

" print "

" print "