[foundation-web] Prepare the field for the 2019 elections



commit 3cb599189b81499450420faf3a5f66d2e18c92d5
Author: Andrea Veri <averi redhat com>
Date:   Fri Apr 26 14:59:49 2019 +0200

    Prepare the field for the 2019 elections

 foundation.gnome.org/vote/2019/Makefile.am  |  12 ++
 foundation.gnome.org/vote/2019/index.wml    |  43 +++++
 foundation.gnome.org/vote/2019/mkical.py    | 256 ++++++++++++++++++++++++++++
 foundation.gnome.org/vote/2019/rules.wml    | 137 +++++++++++++++
 foundation.gnome.org/vote/2019/timeline.ics |  83 +++++++++
 foundation.gnome.org/vote/Makefile.am       |   2 +-
 6 files changed, 532 insertions(+), 1 deletion(-)
---
diff --git a/foundation.gnome.org/vote/2019/Makefile.am b/foundation.gnome.org/vote/2019/Makefile.am
new file mode 100644
index 0000000..5a003ed
--- /dev/null
+++ b/foundation.gnome.org/vote/2019/Makefile.am
@@ -0,0 +1,12 @@
+SUBDIRS =
+
+urlpath = /vote/2019
+ 
+page_SCRIPTS = \
+       index.html \
+       rules.html
+
+page_DATA = \
+       timeline.ics
+
+include $(top_srcdir)/rules.common
diff --git a/foundation.gnome.org/vote/2019/index.wml b/foundation.gnome.org/vote/2019/index.wml
new file mode 100644
index 0000000..b177a5f
--- /dev/null
+++ b/foundation.gnome.org/vote/2019/index.wml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<html>
+
+  <head>
+    <title>GNOME Foundation 2019 Elections</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="author" content="Andrea Veri" />
+  </head>
+
+  <body>
+
+    <div id="content">
+    <h1>GNOME Foundation 2019 Elections</h1>
+
+    <p>
+      The GNOME Foundation Membership currently elects the Board of 
+      Directors each year for July, 1st. Any member can nominate 
+      themself to run in the elections. The overall elections process 
+      is overseen by the Membership and Elections Committee, which can 
+      be reached at <a
+      href="mailto:membership-committee&#64;gnome&#46;org";>membership-committee&#64;gnome&#46;org</a>.
+    </p>
+
+    <p>
+      The elections results from the 2019 Board of Directors elections 
+      will be archived here for public access.
+    </p>
+
+    <h2>2019 Elections Materials:</h2>
+    <ul>
+        <li>
+            <a href="rules.html">Elections Rules and Timeline</a> (webcal <a
+            href="webcal://vote.gnome.org/2019/timeline.ics">timeline</a>)
+        </li>
+    
+        <li>
+            <a href="../overview.html">Overview of the Board of Directors role</a>
+        </li>
+    </ul>
+
+  </body>
+</html>
diff --git a/foundation.gnome.org/vote/2019/mkical.py b/foundation.gnome.org/vote/2019/mkical.py
new file mode 100755
index 0000000..e095a8d
--- /dev/null
+++ b/foundation.gnome.org/vote/2019/mkical.py
@@ -0,0 +1,256 @@
+#!/usr/bin/env python
+'''
+This Python script creates a simple iCal file based on hardcoded events
+in this file.
+'''
+
+import calendar
+import datetime
+import logging
+import math
+import os
+import vobject
+
+
+#### Configure these variables
+YEAR = 2019
+CANDIDATES_OPENED_DATE    = (YEAR, 5, 12)
+CANDIDATES_CLOSED_DATE    = (YEAR, 5, 26)
+CANDIDATES_ANNOUNCED_DATE = (YEAR, 5, 27)
+VOTING_OPENED_DATE        = (YEAR, 5, 28)
+VOTING_CLOSED_DATE        = (YEAR, 6, 11)
+PRELIMINARY_RESULTS_DATE  = (YEAR, 6, 12)
+CHALLENGE_CLOSED_DATE     = (YEAR, 6, 19)
+
+
+
+### I'm sorry that these functions clutter your calendar-creating experience
+### Please scroll down a bit to edit the description texts
+
+#### Application Data
+def c(multilinestring):
+    '''
+    A helper functions which cleans up a multiline string, so that
+    it doesn't contain any newlines or multiple whitespaces
+    '''
+    stripped = [l.strip() for l in multilinestring.splitlines()]
+    ret = " ".join (stripped)
+    return ret
+
+def d(year, month, day):
+    '''
+    Just a tiny wrapper around datetime.datetime to create a datetime object
+    '''
+    return datetime.date(year, month, day)
+
+
+
+CANDIDATES_OPENED = (
+    d(*CANDIDATES_OPENED_DATE),
+    'Announcements and list of candidates opens',
+    c("""If you are a member of the GNOME Foundation and are interested
+    in running for election, you may nominate yourself by sending an
+    e-mail to foundation-announce gnome org with your name, e-mail
+    address, corporate affiliation (if any), and a description of why
+    you'd like to serve, before
+    %s (23:59 UTC).""" % d(*CANDIDATES_CLOSED_DATE)) + '''
+    ''' + c("""
+    If you are not yet a GNOME Foundation member and would like to stand
+    for election, you must first apply for membership and be accepted to be
+    eligible to run. (You may, however, announce your candidacy prior to formal
+    acceptance of your application;
+    should your application not be accepted, you will not be included in
+    the list of candidates.)""") + '''
+    '''
+)
+
+CANDIDATES_CLOSED = (
+    d(*CANDIDATES_CLOSED_DATE),
+    'List of candidates closed',
+    CANDIDATES_OPENED[2] # Get the same text again
+)
+
+CANDIDATES_ANNOUNCED = (
+    d(*CANDIDATES_ANNOUNCED_DATE),
+    'List of candidates announced',
+    'You may now start to send your questions to the candidates'
+)
+
+VOTING_OPENED = (
+    d(*VOTING_OPENED_DATE),
+    'Instructions to vote are sent',
+    'Please read your email and follow these instructions and submit your vote by %s' % 
d(*VOTING_CLOSED_DATE)
+)
+VOTING_CLOSED = (
+    d(*VOTING_CLOSED_DATE),
+    'Votes must be returned',
+    'Preliminary results are announced on %s' % d(*PRELIMINARY_RESULTS_DATE)
+)
+
+
+PRELIMINARY_RESULTS = (
+    d(*PRELIMINARY_RESULTS_DATE),
+    'Preliminary results are announced',
+    'The preliminary results can be challenged until %s' % d(*CHALLENGE_CLOSED_DATE)
+)
+
+CHALLENGE_CLOSED = (
+    d(*CHALLENGE_CLOSED_DATE),
+    'Challenges to the results closed',
+    "If there weren't any challenges, preliminary results are valid"
+)
+
+
+
+
+def create_ical(eventlist):
+    '''Generates an ical stream based on the list given as eventlist.
+    The list shall contain elements with a tuple with a
+    (date, string, string) object, serving as date when the event takes place,
+    summary and description respectively.
+    '''
+    log = logging.getLogger('create_ical')
+
+    cal = vobject.iCalendar()
+    cal.add('method').value = 'PUBLISH'
+    cal.add('calscale').value = 'GREGORIAN'
+    cal.add('x-wr-timezone').value = 'UTC'
+
+    for (timestamp, summary, description) in eventlist:
+        log.debug('creating %s, %s', timestamp, description)
+        vevent = cal.add('vevent')
+        vevent.add('dtstart').value = timestamp
+        vevent.add('dtend').value = timestamp + datetime.timedelta(1)
+        vevent.add('summary').value = summary
+        vevent.add('description').value = description
+
+    stream = cal.serialize()
+    return stream
+
+
+def wraptext(s, width):
+    '''Wraps a string @s at @width characters.
+
+    >>> wraptext('fooo', 2)
+    ['fo','oo']
+    '''
+    l = len(s)
+    nr_frames = int(math.ceil(float(l)/width))
+    print nr_frames
+    frames = []
+    for i in xrange(nr_frames):
+        start, end = i*width, (i+1) * width
+        frames.append(s[start:end])
+        # One could (and prolly should) yield that
+    return frames
+
+def ordinal(n):
+    n = int(n)
+    if 10 <= n % 100 < 20:
+        return str(n) + 'th'
+    else:
+       return  str(n) + {1 : 'st', 2 : 'nd', 3 : 'rd'}.get(n % 10, "th")
+
+
+def cal_for_month(month, events, width=80, year=datetime.datetime.now().year):
+    '''Generates a textual calendar for the @month in @year.
+    It will return a string with the calendar on the left hand side and the
+    events on the right hand side.
+    @events shall be a list with tuples: timestamp, summary, description.
+
+    Returns a string with the calendar
+    '''
+    log = logging.getLogger('cal_for_month')
+
+    cal = calendar.TextCalendar()
+    calstrings = cal.formatmonth(year, month, 3).splitlines()
+
+    for (timestamp, summary, description) in events:
+        log.debug('creating %s, %s', timestamp, summary)
+        year, month, day = timestamp.year, timestamp.month, timestamp.day
+        maxwidth = max([len(cs) for cs in calstrings])
+        rightwidth = 80 - maxwidth
+        for i, line in enumerate(calstrings):
+            needles =      (" %d " % day,
+                           " %d\n" % day)
+            replacement = "(%d)" % day
+            # Find the day so that we can highlight it and add a comment
+            day_in_week = False
+            for needle in needles:
+                if needle in line+"\n":
+                    # k, this looks a bit weird but we have that corner
+                    # case with the day being at the end of the line
+                    # which in turn will have been split off
+                    day_in_week = True
+                    break # Set the needle to the found one
+            if day_in_week == False: # Nothing found, try next week
+                log.debug('Day (%d) not found in %s', day, line)
+                continue
+            else:
+                log.debug('Day (%d) found in %s', day, line)
+                new_line = (line+"\n").replace(needle, replacement).rstrip()
+                new_line += "   %s (%s)" % (summary, ordinal(day))
+                # Replace in-place for two events in the same week
+                # FIXME: This has bugs :-(
+                calstrings[i] = new_line
+
+    return os.linesep.join(calstrings)
+
+def create_textcal(eventlist):
+    '''Generates a multiline string containing a calendar with the
+    events written on the side
+    The list shall contain elements with a tuple with a
+    (date, string, string) object, serving as date when the event takes place,
+    summary and description respectively.
+    '''
+    log = logging.getLogger('textcal')
+    log.debug('Generating from %s', eventlist)
+    months = set(map(lambda x: x[0].month, eventlist))
+    year = set(map(lambda x: x[0].year, eventlist)).pop()
+
+    final_cal = []
+    for month in months:
+        events = filter(lambda x: x[0].month == month, eventlist)
+        log.debug('Events for %d: %s', month, events)
+        month_cal = cal_for_month(month, events, year=year)
+        final_cal.append(month_cal)
+
+    return os.linesep.join(final_cal)
+
+if __name__ == "__main__":
+    from optparse import OptionParser
+    parser = OptionParser("usage: %prog [options]")
+    parser.add_option("-l", "--loglevel", dest="loglevel", help="Sets the loglevel to one of debug, info, 
warn, error, critical",
+                      default=None)
+    parser.add_option("-i", "--ical",
+                      action="store_true", dest="ical", default=False,
+                      help="print iCal file to stdout")
+    parser.add_option("-t", "--textcal",
+                      action="store_true", dest="tcal", default=False,
+                      help="print textual calendar to stdout")
+    (options, args) = parser.parse_args()
+
+    loglevel = {'debug': logging.DEBUG, 'info': logging.INFO,
+                'warn': logging.WARN, 'error': logging.ERROR,
+                'critical': logging.CRITICAL}.get(options.loglevel, logging.WARN)
+    logging.basicConfig( level=loglevel )
+    log = logging.getLogger()
+
+    eventlist = [
+        CANDIDATES_OPENED,
+        CANDIDATES_CLOSED,
+        CANDIDATES_ANNOUNCED,
+        VOTING_OPENED,
+        VOTING_CLOSED,
+        PRELIMINARY_RESULTS,
+        CHALLENGE_CLOSED,
+    ]
+
+    if not any([options.ical, options.tcal]):
+        parser.error("You want to select either ical or textcal output. See --help for details")
+    if options.ical:
+        ical = create_ical( eventlist )
+        print ical
+    if options.tcal:
+        tcal = create_textcal( eventlist )
+        print tcal
diff --git a/foundation.gnome.org/vote/2019/rules.wml b/foundation.gnome.org/vote/2019/rules.wml
new file mode 100644
index 0000000..cef52c4
--- /dev/null
+++ b/foundation.gnome.org/vote/2019/rules.wml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<html>
+
+  <head>
+    <title>GNOME Foundation 2019 Elections Rules</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  </head>
+
+  <body>
+
+    <div id="content">
+    <h1>Rules &amp; Timeline for the GNOME Foundation 2019 Elections</h1>
+
+    <h2>Elections Rules</h2> 
+
+    <ol>
+      <li>
+        See the <a 
href="https://gitlab.gnome.org/Infrastructure/foundation-web/blob/master/foundation.gnome.org/about/bylaws.rst";>GNOME
 Foundation Bylaws</a> (<a href="https://www.gnome.org/foundation/governance/attachment/bylaws-2/";>PDF</a>) 
for
+        general rules.
+      </li>
+      <li>
+       There are 7 board slots that are to be filled during these elections.
+      </li>
+      <li>
+        Members of the GNOME Foundation as of
+        <!-- CANDIDATES_ANNOUNCED_DATE -->2019-05-27
+        
+        are eligible to vote in the elections. Members without voting rights
+        such as <a 
href="https://mail.gnome.org/archives/foundation-announce/2012-May/msg00015.html";>Emeritus members</a>
+        are not eligible to vote.
+        Anyone who has made a 
+        contribution to GNOME can apply for membership by completing the
+        <a href="https://foundation.gnome.org/membership/apply/";>application</a>.
+      </li>
+      <li>
+        Any eligible voter is eligible to be elected to the Board of Directors.
+        To announce your candidacy, send a message to
+        <a 
href="https://mail.gnome.org/archives/foundation-announce/";>foundation-announce&#64;gnome&#46;org</a>
+        with your full name, e-mail, corporate affiliation (if any), and a
+        description of your reasons for wanting to serve as a director.
+        Candidacies must be announced prior to
+        <!-- CANDIDATES_CLOSED_DATE -->2019-05-26, 23:59 UTC.
+        
+      </li>
+      <li>
+        All discussion related to the elections should be held on
+        <a href="https://mail.gnome.org/archives/foundation-list/";>foundation-list&#64;gnome&#46;org</a>.
+        Members are invited to ask questions to one or all candidates on that
+        list.
+      </li>
+      <li>
+       Instructions explaining how to vote will be sent via e-mail to all
+       eligible voters on
+       <!-- VOTING_OPENED_DATE -->2019-05-28,
+       
+       and votes must be returned by
+       <!-- VOTING_CLOSED_DATE -->2019-06-11, 23:59 UTC.
+      </li>
+      <li>
+        Votes will be held confidential during the elections, but an 
+        anonymized archive of all submitted votes will be made publicly 
+        accessible at its conclusion.
+      </li>
+      <li>
+        The GNOME Foundation Membership and Elections Committee is
+        responsible for counting the votes.
+        The committee serves at the pleasure of the GNOME Board of Directors
+        as per Section 9.1 of the bylaws.
+      </li>
+      <li>
+       The 7 candidates voted for most as counted by a <a 
href="http://mail.gnome.org/archives/foundation-list/2009-March/msg00012.html";>single transferable
+       vote system</a> will be elected, except that no more than two
+       individuals affiliated with any one corporation may be elected. Should
+       more than two of the top seven vote-getters be affiliated with the
+       same company, only the two with the most votes will be considered
+       elected. For a full definition of corporate affiliation, see the
+       <a href="https://wiki.gnome.org/Foundation/Charter";>GNOME Foundation charter</a>.
+      </li>
+      <li>
+        In the event of a tie for the final slot on the board, the Elections
+        Committee will schedule run-off elections as soon as possible. 
+      </li>
+      <li>
+        The Elections Committee will announce preliminary results as soon as
+        possible after the elections close, along with instructions on how to
+        access the votes archive and how to independently verify the vote
+        count.
+      </li>
+      <li>
+        Any eligible voter may challenge the preliminary results by e-mailing
+        <a
+        href="mailto:membership-committee gnome org">membership-committee gnome org</a>
+        prior to
+        <!-- PRELIMINARY_RESULTS_DATE -->2019-06-19.
+        
+        The decision of the Elections Committee as
+        to any challenge shall be final. Once any challenges have been
+        resolved, the Elections Committee shall announce the final results.
+      </li>
+      <li>
+        Any questions regarding these procedures should be directed to the
+        Elections Committee by e-mail to <a
+        href="mailto:membership-committee gnome org">membership-committee gnome org</a>.
+        The committee shall have the power to make any necessary changes or
+        clarifications to these rules at any point during the elections.
+      </li>
+    </ol>
+
+    <h2>Timeline</h2>
+    <p><small>(all deadlines are 23:59 UTC)</small></p> 
+    <ul>
+      <li>
+        <!-- CANDIDATES_OPENED_DATE -->2019-05-12: Announcements and list of candidates opens.
+      </li>
+      <li>
+        <!-- CANDIDATES_CLOSED_DATE -->2019-05-26: Last day to announce candidacies, submit summary 
statements.
+      </li>
+      <li>
+        <!-- CANDIDATES_ANNOUNCED_DATE -->2019-05-27: Final list of candidates.
+      </li>
+      <li>
+        <!-- VOTING_OPENED_DATE -->2019-05-28: Instructions mailed to eligible voters, voting begins.
+      </li>
+      <li>
+        <!-- VOTING_CLOSED_DATE -->2019-06-11: Voting closes.
+      </li>
+      <li>
+        <!-- PRELIMINARY_RESULTS_DATE -->2019-06-12: Preliminary results are announced.
+      </li>
+      <li>
+        <!-- CHALLENGE_CLOSED_DATE -->2019-06-19: Last day to challenge preliminary results.
+      </li>
+    </ul>
+
+  </body>
+</html>
diff --git a/foundation.gnome.org/vote/2019/timeline.ics b/foundation.gnome.org/vote/2019/timeline.ics
new file mode 100644
index 0000000..2eafeb1
--- /dev/null
+++ b/foundation.gnome.org/vote/2019/timeline.ics
@@ -0,0 +1,83 @@
+BEGIN:VCALENDAR
+VERSION:2.0
+CALSCALE:GREGORIAN
+METHOD:PUBLISH
+PRODID:-//PYVOBJECT//NONSGML Version 1//EN
+X-WR-TIMEZONE:UTC
+BEGIN:VEVENT
+UID:20190426T125223Z - 19271@honneamise
+DTSTART;VALUE=DATE:20190512
+DTEND;VALUE=DATE:20190513
+DESCRIPTION:If you are a member of the GNOME Foundation and are interested 
+ in running for election\, you may nominate yourself by sending an e-mail t
+ o foundation-announce gnome org with your name\, e-mail address\, corporat
+ e affiliation (if any)\, and a description of why you'd like to serve\, be
+ fore 2019-05-26 (23:59 UTC).\n     If you are not yet a GNOME Foundation m
+ ember and would like to stand for election\, you must first apply for memb
+ ership and be accepted to be eligible to run. (You may\, however\, announc
+ e your candidacy prior to formal acceptance of your application\; should y
+ our application not be accepted\, you will not be included in the list of 
+ candidates.)\n    
+DTSTAMP:20190426T125223Z
+SUMMARY:Announcements and list of candidates opens
+END:VEVENT
+BEGIN:VEVENT
+UID:20190426T125223Z - 4281@honneamise
+DTSTART;VALUE=DATE:20190526
+DTEND;VALUE=DATE:20190527
+DESCRIPTION:If you are a member of the GNOME Foundation and are interested 
+ in running for election\, you may nominate yourself by sending an e-mail t
+ o foundation-announce gnome org with your name\, e-mail address\, corporat
+ e affiliation (if any)\, and a description of why you'd like to serve\, be
+ fore 2019-05-26 (23:59 UTC).\n     If you are not yet a GNOME Foundation m
+ ember and would like to stand for election\, you must first apply for memb
+ ership and be accepted to be eligible to run. (You may\, however\, announc
+ e your candidacy prior to formal acceptance of your application\; should y
+ our application not be accepted\, you will not be included in the list of 
+ candidates.)\n    
+DTSTAMP:20190426T125223Z
+SUMMARY:List of candidates closed
+END:VEVENT
+BEGIN:VEVENT
+UID:20190426T125223Z - 76727@honneamise
+DTSTART;VALUE=DATE:20190527
+DTEND;VALUE=DATE:20190528
+DESCRIPTION:You may now start to send your questions to the candidates
+DTSTAMP:20190426T125223Z
+SUMMARY:List of candidates announced
+END:VEVENT
+BEGIN:VEVENT
+UID:20190426T125223Z - 33505@honneamise
+DTSTART;VALUE=DATE:20190528
+DTEND;VALUE=DATE:20190529
+DESCRIPTION:Please read your email and follow these instructions and submit
+  your vote by 2019-06-11
+DTSTAMP:20190426T125223Z
+SUMMARY:Instructions to vote are sent
+END:VEVENT
+BEGIN:VEVENT
+UID:20190426T125223Z - 13973@honneamise
+DTSTART;VALUE=DATE:20190611
+DTEND;VALUE=DATE:20190612
+DESCRIPTION:Preliminary results are announced on 2019-06-12
+DTSTAMP:20190426T125223Z
+SUMMARY:Votes must be returned
+END:VEVENT
+BEGIN:VEVENT
+UID:20190426T125223Z - 83191@honneamise
+DTSTART;VALUE=DATE:20190612
+DTEND;VALUE=DATE:20190613
+DESCRIPTION:The preliminary results can be challenged until 2019-06-19
+DTSTAMP:20190426T125223Z
+SUMMARY:Preliminary results are announced
+END:VEVENT
+BEGIN:VEVENT
+UID:20190426T125223Z - 70984@honneamise
+DTSTART;VALUE=DATE:20190619
+DTEND;VALUE=DATE:20190620
+DESCRIPTION:If there weren't any challenges\, preliminary results are valid
+DTSTAMP:20190426T125223Z
+SUMMARY:Challenges to the results closed
+END:VEVENT
+END:VCALENDAR
+
diff --git a/foundation.gnome.org/vote/Makefile.am b/foundation.gnome.org/vote/Makefile.am
index 46caaee..d1010c0 100644
--- a/foundation.gnome.org/vote/Makefile.am
+++ b/foundation.gnome.org/vote/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = include 2004-10 2005-10 2000 2001 2002 2003 2004 2005 2006 2007 2007-10 2009 2010 2011 2012 2013 
2014 2015 2016 2017 2018
+SUBDIRS = include 2004-10 2005-10 2000 2001 2002 2003 2004 2005 2006 2007 2007-10 2009 2010 2011 2012 2013 
2014 2015 2016 2017 2018 2019
 
 urlpath = /vote
  


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]