Releasing the bin/ scripts under GPLv3+
This commit is contained in:
parent
d1fa3fa6ea
commit
486163628c
6 changed files with 102 additions and 0 deletions
|
@ -41,6 +41,20 @@ use DBI;
|
||||||
# simple VIEW created like this:
|
# simple VIEW created like this:
|
||||||
# CREATE OR REPLACE VIEW `foundation`.`electorate` AS SELECT id, firstname, lastname, email FROM `foundation`.`foundationmembers` WHERE DATE_SUB(CURDATE(), INTERVAL 2 YEAR) <= foundationmembers.last_renewed_on;
|
# CREATE OR REPLACE VIEW `foundation`.`electorate` AS SELECT id, firstname, lastname, email FROM `foundation`.`foundationmembers` WHERE DATE_SUB(CURDATE(), INTERVAL 2 YEAR) <= foundationmembers.last_renewed_on;
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
die "Usage: create-tmp-tokens.pl <election id> <output file for tokens> <output file for mail data>\n" unless $#ARGV == 2;
|
die "Usage: create-tmp-tokens.pl <election id> <output file for tokens> <output file for mail data>\n" unless $#ARGV == 2;
|
||||||
|
|
||||||
$election_id = $ARGV[0];
|
$election_id = $ARGV[0];
|
||||||
|
|
|
@ -24,6 +24,24 @@ default-character-set=utf8
|
||||||
The reason to call MySQL client and not use the Python library is
|
The reason to call MySQL client and not use the Python library is
|
||||||
mainly, that the MySQL bindings are not installed.
|
mainly, that the MySQL bindings are not installed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
__author__ = "Tobias Mueller"
|
||||||
|
__license__ = "GPLv3+"
|
||||||
|
__email__ = "tobiasmue@gnome.org"
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
try:
|
try:
|
||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
|
|
|
@ -29,6 +29,23 @@
|
||||||
# to ask them if they want to update their registered e-mail address and
|
# to ask them if they want to update their registered e-mail address and
|
||||||
# receive the instructions.
|
# receive the instructions.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
__author__ = "Tobias Mueller"
|
||||||
|
__license__ = "GPLv3+"
|
||||||
|
__email__ = "tobiasmue@gnome.org"
|
||||||
|
|
||||||
import smtplib
|
import smtplib
|
||||||
import sys
|
import sys
|
||||||
import string
|
import string
|
||||||
|
|
|
@ -8,6 +8,23 @@ import sys
|
||||||
|
|
||||||
from get_renewees import get_members_which_need_renewal, send_email
|
from get_renewees import get_members_which_need_renewal, send_email
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
__author__ = "Tobias Mueller"
|
||||||
|
__license__ = "GPLv3+"
|
||||||
|
__email__ = "tobiasmue@gnome.org"
|
||||||
|
|
||||||
TEMPLATE = dedent('''
|
TEMPLATE = dedent('''
|
||||||
Hi,
|
Hi,
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
'''Prints the current member list as JSON'''
|
'''Prints the current member list as JSON'''
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import json
|
import json
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -8,6 +22,10 @@ except ImportError:
|
||||||
|
|
||||||
from get_renewees import execute_query, Member
|
from get_renewees import execute_query, Member
|
||||||
|
|
||||||
|
__author__ = "Tobias Mueller"
|
||||||
|
__license__ = "GPLv3+"
|
||||||
|
__email__ = "tobiasmue@gnome.org"
|
||||||
|
|
||||||
query = ("SET NAMES 'utf8'; "
|
query = ("SET NAMES 'utf8'; "
|
||||||
"SELECT CONCAT(firstname, ';', lastname, ';', email, ';', "
|
"SELECT CONCAT(firstname, ';', lastname, ';', email, ';', "
|
||||||
" last_renewed_on) "
|
" last_renewed_on) "
|
||||||
|
|
|
@ -7,11 +7,29 @@ mysql -h button-back -u anonvoting -p foundation -B -e 'SELECT DATE_FORMAT(first
|
||||||
|
|
||||||
mysql -h button-back -u anonvoting -p foundation -B -e "SET @start = '2009-01-01', @end = '2009-08-30'; SELECT DATE_FORMAT(DATE_ADD(last_renewed_on, INTERVAL 2 YEAR), '%Y-%m') as date, COUNT(*) as dropped_out FROM foundationmembers WHERE last_renewed_on >= DATE_SUB(@start, INTERVAL 2 YEAR) AND last_renewed_on <= DATE_SUB(@end, INTERVAL 2 YEAR) GROUP BY date;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' | awk 'FNR>1'
|
mysql -h button-back -u anonvoting -p foundation -B -e "SET @start = '2009-01-01', @end = '2009-08-30'; SELECT DATE_FORMAT(DATE_ADD(last_renewed_on, INTERVAL 2 YEAR), '%Y-%m') as date, COUNT(*) as dropped_out FROM foundationmembers WHERE last_renewed_on >= DATE_SUB(@start, INTERVAL 2 YEAR) AND last_renewed_on <= DATE_SUB(@end, INTERVAL 2 YEAR) GROUP BY date;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' | awk 'FNR>1'
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import pylab
|
import pylab
|
||||||
from pylab import figure, title, bar, xticks, yticks, gca, savefig
|
from pylab import figure, title, bar, xticks, yticks, gca, savefig
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
__author__ = "Tobias Mueller"
|
||||||
|
__license__ = "GPLv3+"
|
||||||
|
__email__ = "tobiasmue@gnome.org"
|
||||||
|
|
||||||
plot_title = "New Foundation Members"
|
plot_title = "New Foundation Members"
|
||||||
figwidth = 40
|
figwidth = 40
|
||||||
figheight = 3
|
figheight = 3
|
||||||
|
|
Loading…
Reference in a new issue