From 366b8e0f1fd3d5e704a446926932b944a576781f Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Fri, 14 Dec 2012 14:21:53 +0100 Subject: [PATCH 1/8] Droped support for python 2.5 --- .travis.yml | 1 - INSTALL.txt | 6 +++--- openslides/main.py | 3 --- openslides/motion/views.py | 8 +------- openslides/participant/api.py | 3 --- openslides/participant/views.py | 9 +-------- openslides/utils/pdf.py | 3 +-- openslides/utils/utils.py | 6 +----- openslides/utils/views.py | 6 +----- 9 files changed, 8 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index f91d92918..6839308e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "2.5" - "2.6" - "2.7" install: diff --git a/INSTALL.txt b/INSTALL.txt index f57e7f00e..739431350 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -18,7 +18,7 @@ I. Installation on GNU/Linux and MacOSX using the Python Package Index (PyPI) 1. Check requirements: Make sure that you have installed Python Programming Language 2 - (>= 2.5) on your system. + (>= 2.6) on your system. 2. Setup a virtual environment with virtualenv (optional): @@ -65,7 +65,7 @@ II. Installation on GNU/Linux and MacOSX using the sources OpenSlides requires following programs, which should be installed first: - + Python Programming Language 2 (>= 2.5) + + Python Programming Language 2 (>= 2.6) + virtualenv (>= 1.4.1) + ReportLab Toolkit + Python Imaging Library (PIL) @@ -141,7 +141,7 @@ portable version you should run the following install steps. The OpenSlides install requires following programs, which should be installed first: - + Python Programming Language 2 (>= 2.5) + + Python Programming Language 2 (>= 2.6) + Setuptools a) Download and run 32bit MSI installer from http://www.python.org/: diff --git a/openslides/main.py b/openslides/main.py index bc23fb3bd..d25305a4d 100755 --- a/openslides/main.py +++ b/openslides/main.py @@ -10,9 +10,6 @@ :license: GNU GPL, see LICENSE for more details. """ -# for python 2.5 support -from __future__ import with_statement - import base64 import ctypes import optparse diff --git a/openslides/motion/views.py b/openslides/motion/views.py index 76b2ba4c3..deff7eaef 100644 --- a/openslides/motion/views.py +++ b/openslides/motion/views.py @@ -10,16 +10,10 @@ :license: GNU GPL, see LICENSE for more details. """ -# for python 2.5 support -from __future__ import with_statement - import csv import os -try: - from urlparse import parse_qs -except ImportError: # python <= 2.5 - from cgi import parse_qs +from urlparse import parse_qs from reportlab.lib import colors from reportlab.lib.units import cm diff --git a/openslides/participant/api.py b/openslides/participant/api.py index fb5325628..f7b5a80a2 100644 --- a/openslides/participant/api.py +++ b/openslides/participant/api.py @@ -10,9 +10,6 @@ :license: GNU GPL, see LICENSE for more details. """ -# for python 2.5 support -from __future__ import with_statement - from random import choice import csv diff --git a/openslides/participant/views.py b/openslides/participant/views.py index 34cb032a0..9081ec87b 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -10,15 +10,8 @@ :license: GNU GPL, see LICENSE for more details. """ -# for python 2.5 support -from __future__ import with_statement - from urllib import urlencode - -try: - from urlparse import parse_qs -except ImportError: # python <= 2.5 grab it from cgi - from cgi import parse_qs +from urlparse import parse_qs from reportlab.lib import colors from reportlab.lib.units import cm diff --git a/openslides/utils/pdf.py b/openslides/utils/pdf.py index 4064f109e..cf6db3c44 100755 --- a/openslides/utils/pdf.py +++ b/openslides/utils/pdf.py @@ -21,8 +21,7 @@ from reportlab.rl_config import defaultPageSize from django.conf import settings from django.utils import formats -# Import gettext for python 2.5 support -from django.utils.translation import ugettext as _, gettext +from django.utils.translation import ugettext as _ from openslides.config.models import config diff --git a/openslides/utils/utils.py b/openslides/utils/utils.py index fa5f96d5e..3225318fc 100644 --- a/openslides/utils/utils.py +++ b/openslides/utils/utils.py @@ -11,11 +11,7 @@ """ import sys - -try: - import json -except ImportError: # For python 2.5 support - import simplejson as json +import json from django.contrib import messages from django.contrib.auth.models import Permission diff --git a/openslides/utils/views.py b/openslides/utils/views.py index b9d1fc4b9..fbc742bf4 100644 --- a/openslides/utils/views.py +++ b/openslides/utils/views.py @@ -10,11 +10,7 @@ :license: GNU GPL, see LICENSE for more details. """ -try: - import json -except ImportError: - # for python 2.5 support - import simplejson as json +import json try: from cStringIO import StringIO From 804f842650b7c076d2b712a7898afacb21db142f Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Fri, 14 Dec 2012 15:10:14 +0100 Subject: [PATCH 2/8] Updated the url template tag --- .../agenda/templates/agenda/base_agenda.html | 22 ++++----- .../agenda/templates/agenda/config.html | 4 +- openslides/agenda/templates/agenda/edit.html | 4 +- .../agenda/templates/agenda/item_row.html | 6 +-- .../agenda/templates/agenda/overview.html | 4 +- .../agenda/templates/agenda/widget.html | 10 ++-- .../templates/assignment/base_assignment.html | 28 +++++------ .../templates/assignment/config.html | 4 +- .../assignment/templates/assignment/edit.html | 4 +- .../templates/assignment/overview.html | 10 ++-- .../templates/assignment/poll_view.html | 8 ++-- .../assignment/templates/assignment/view.html | 32 ++++++------- .../templates/assignment/widget.html | 4 +- .../config/templates/config/general.html | 4 +- .../motion/templates/motion/base_motion.html | 26 +++++------ .../motion/templates/motion/config.html | 4 +- openslides/motion/templates/motion/edit.html | 4 +- .../motion/templates/motion/import.html | 4 +- .../motion/templates/motion/overview.html | 10 ++-- .../motion/templates/motion/poll_view.html | 8 ++-- openslides/motion/templates/motion/view.html | 46 +++++++++---------- .../motion/templates/motion/widget.html | 4 +- .../participant/base_participant.html | 16 +++---- .../templates/participant/config.html | 4 +- .../templates/participant/edit.html | 6 +-- .../templates/participant/group_edit.html | 4 +- .../templates/participant/group_overview.html | 4 +- .../templates/participant/group_widget.html | 4 +- .../templates/participant/import.html | 4 +- .../templates/participant/login.html | 6 +-- .../templates/participant/overview.html | 8 ++-- .../participant/password_change.html | 4 +- .../templates/participant/settings.html | 4 +- .../templates/participant/user_widget.html | 4 +- .../templates/projector/base_projector.html | 8 ++-- .../projector/control_countdown.html | 14 +++--- .../projector/control_overlay_message.html | 2 +- .../projector/custom_slide_widget.html | 18 ++++---- .../templates/projector/live_view_widget.html | 14 +++--- .../projector/templates/projector/new.html | 4 +- .../templates/projector/overlay_widget.html | 4 +- openslides/templates/base.html | 10 ++-- 42 files changed, 196 insertions(+), 196 deletions(-) diff --git a/openslides/agenda/templates/agenda/base_agenda.html b/openslides/agenda/templates/agenda/base_agenda.html index 1da6ca241..be70f6f40 100644 --- a/openslides/agenda/templates/agenda/base_agenda.html +++ b/openslides/agenda/templates/agenda/base_agenda.html @@ -5,15 +5,15 @@ {% load staticfiles %} {% block submenu %} - {% url item_overview as url_itemoverview %} - {% url item_new as url_itemnew %} + {% url 'item_overview' as url_itemoverview %} + {% url 'item_new' as url_itemnew %}

{% trans "Agenda" %}

{# second submenu #} @@ -22,20 +22,20 @@

{{ item.title }}

{% endif %} diff --git a/openslides/agenda/templates/agenda/config.html b/openslides/agenda/templates/agenda/config.html index 0ef26b8d5..8a0eedb64 100644 --- a/openslides/agenda/templates/agenda/config.html +++ b/openslides/agenda/templates/agenda/config.html @@ -12,8 +12,8 @@ - - diff --git a/openslides/agenda/templates/agenda/edit.html b/openslides/agenda/templates/agenda/edit.html index c91176fe4..f5060d1f0 100644 --- a/openslides/agenda/templates/agenda/edit.html +++ b/openslides/agenda/templates/agenda/edit.html @@ -26,8 +26,8 @@ - - diff --git a/openslides/agenda/templates/agenda/item_row.html b/openslides/agenda/templates/agenda/item_row.html index a198f6bae..b5e3c084c 100644 --- a/openslides/agenda/templates/agenda/item_row.html +++ b/openslides/agenda/templates/agenda/item_row.html @@ -5,7 +5,7 @@ {% if perms.agenda.can_manage_agenda %} - + {% elif item.closed %} @@ -32,7 +32,7 @@ {% if perms.projector.can_manage_projector %} - + {% endif %} @@ -40,7 +40,7 @@ {% if not item.is_leaf_node %} - + {% endif %} diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index f847d9704..24ffaca65 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -44,7 +44,7 @@ {% endif %} @@ -83,7 +83,7 @@ {% if perms.projector.can_manage_projector %} - + diff --git a/openslides/agenda/templates/agenda/widget.html b/openslides/agenda/templates/agenda/widget.html index e638756b8..b1dc4bdd2 100644 --- a/openslides/agenda/templates/agenda/widget.html +++ b/openslides/agenda/templates/agenda/widget.html @@ -4,10 +4,10 @@