Use python3
python3.3 and python3.4 are supported
This commit is contained in:
parent
66426ad29b
commit
32137b6523
11
.travis.yml
11
.travis.yml
@ -1,6 +1,9 @@
|
|||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "2.6"
|
- "3.3"
|
||||||
- "2.7"
|
- "3.4"
|
||||||
install: "pip install --allow-external argparse -r requirements.txt"
|
install: "pip install -r requirements.txt"
|
||||||
script: "fab travis_ci"
|
script:
|
||||||
|
- "DJANGO_SETTINGS_MODULE='tests.settings' coverage run ./manage.py django test"
|
||||||
|
- "coverage report -m --fail-under=80"
|
||||||
|
- "flake8 --max-line-length=150 --statistics openslides tests"
|
||||||
|
@ -4,6 +4,11 @@
|
|||||||
|
|
||||||
http://openslides.org
|
http://openslides.org
|
||||||
|
|
||||||
|
Version 2.0.0 (unreleased)
|
||||||
|
==========================
|
||||||
|
|
||||||
|
- Changed supported Python version to >= 3.3
|
||||||
|
|
||||||
Version 1.6.1 (unreleased)
|
Version 1.6.1 (unreleased)
|
||||||
==========================
|
==========================
|
||||||
[https://github.com/OpenSlides/OpenSlides/issues?milestone=16]
|
[https://github.com/OpenSlides/OpenSlides/issues?milestone=16]
|
||||||
|
22
README.rst
22
README.rst
@ -26,12 +26,12 @@ Installation on GNU/Linux or Mac OS X
|
|||||||
|
|
||||||
1. Check requirements
|
1. Check requirements
|
||||||
|
|
||||||
Make sure that you have installed Python Programming Language 2 (>= 2.6.9)
|
Make sure that you have installed Python Programming Language 3 (>= 3.3)
|
||||||
on your system. You will also need the Python development headers.
|
on your system. You will also need the Python development headers.
|
||||||
|
|
||||||
For example for Ubuntu run::
|
For example for Ubuntu run::
|
||||||
|
|
||||||
$ sudo apt-get install python-dev
|
$ sudo apt-get install python3-dev
|
||||||
|
|
||||||
2. Setup a virtual environment with Virtual Python Environment builder
|
2. Setup a virtual environment with Virtual Python Environment builder
|
||||||
(optional)
|
(optional)
|
||||||
@ -49,7 +49,7 @@ Installation on GNU/Linux or Mac OS X
|
|||||||
|
|
||||||
$ mkdir OpenSlides
|
$ mkdir OpenSlides
|
||||||
$ cd OpenSlides
|
$ cd OpenSlides
|
||||||
$ virtualenv .virtualenv
|
$ virtualenv -p /usr/bin/python3 .virtualenv
|
||||||
$ source .virtualenv/bin/activate
|
$ source .virtualenv/bin/activate
|
||||||
|
|
||||||
3. Install OpenSlides
|
3. Install OpenSlides
|
||||||
@ -67,11 +67,6 @@ Installation on GNU/Linux or Mac OS X
|
|||||||
OpenSlides will install all required python packages (see
|
OpenSlides will install all required python packages (see
|
||||||
requirements_production.txt).
|
requirements_production.txt).
|
||||||
|
|
||||||
If you use Python 2.6.x, you have to add the option `--allow-external
|
|
||||||
argparse` to the pip command::
|
|
||||||
|
|
||||||
$ pip install --allow-external argparse openslides
|
|
||||||
|
|
||||||
|
|
||||||
Installation on Windows
|
Installation on Windows
|
||||||
-----------------------
|
-----------------------
|
||||||
@ -82,18 +77,18 @@ portable version you should observe the following install steps.*
|
|||||||
|
|
||||||
1. Check requirements
|
1. Check requirements
|
||||||
|
|
||||||
Make sure that you have installed Python Programming Language 2 (>= 2.6.9)
|
Make sure that you have installed Python Programming Language 3 (>= 3.3)
|
||||||
and Setuptools on your system.
|
and Setuptools on your system.
|
||||||
|
|
||||||
a. Download and run the `Python 32-bit MSI installer
|
a. Download and run the `Python 32-bit MSI installer
|
||||||
<http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi>`_. Note
|
<https://www.python.org/ftp/python/3.4.1/python-3.4.1.msi>`_. Note
|
||||||
that the 32-bit MSI installer is required even on a 64-bit Windows
|
that the 32-bit MSI installer is required even on a 64-bit Windows
|
||||||
system. If you use the 64-bit MSI installer, step 3 of this
|
system. If you use the 64-bit MSI installer, step 3 of this
|
||||||
instruction will fail unless you installed the package reportlab
|
instruction will fail unless you installed the package reportlab
|
||||||
manually.
|
manually.
|
||||||
|
|
||||||
b. Add python directories to PATH (via Control Panel > System >
|
b. Add python directories to PATH (via Control Panel > System >
|
||||||
Advanced): ``";C:\\Python27;C:\\Python27\\Scripts"``. Note that the path
|
Advanced): ``";C:\\Python34;C:\\Python34\\Scripts"``. Note that the path
|
||||||
can differ if you customized the install of Python in the first step.
|
can differ if you customized the install of Python in the first step.
|
||||||
|
|
||||||
c. Download and run (via double click) the last `install script
|
c. Download and run (via double click) the last `install script
|
||||||
@ -214,11 +209,6 @@ Installation and start of the development version
|
|||||||
|
|
||||||
$ pip install -r requirements.txt
|
$ pip install -r requirements.txt
|
||||||
|
|
||||||
If you use Python 2.6.x, you have to add the option `--allow-external
|
|
||||||
argparse` to the pip command::
|
|
||||||
|
|
||||||
$ pip install --allow-external argparse -r requirements.txt
|
|
||||||
|
|
||||||
For Windows run::
|
For Windows run::
|
||||||
|
|
||||||
> easy_install # Insert all packages from requirements.txt and requirements_production.txt here
|
> easy_install # Insert all packages from requirements.txt and requirements_production.txt here
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
#
|
||||||
# OpenSlides documentation build configuration file, created by
|
# OpenSlides documentation build configuration file, created by
|
||||||
# sphinx-quickstart on Mon Mar 12 08:08:56 2012.
|
# sphinx-quickstart on Mon Mar 12 08:08:56 2012.
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
#
|
||||||
# Extension for Sphinx to add new directive 'autoimage' which works as subclass
|
# Extension for Sphinx to add new directive 'autoimage' which works as subclass
|
||||||
# of the internal Image directive.
|
# of the internal Image directive.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import random
|
import random
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import Queue
|
import Queue
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import csv
|
import csv
|
||||||
import argparse
|
import argparse
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from random import randint, choice
|
from random import randint, choice
|
||||||
|
|
||||||
# Import the openslide settings. Has has to be done before any other openslides
|
# Import the openslide settings. Has has to be done before any other openslides
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import glob
|
import glob
|
||||||
|
1
fabfile.py
vendored
1
fabfile.py
vendored
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
VERSION = (2, 0, 0, 'alpha', 1) # During development it is the next release
|
VERSION = (2, 0, 0, 'alpha', 1) # During development it is the next release
|
||||||
RELEASE = False
|
RELEASE = False
|
||||||
|
|
||||||
@ -38,9 +36,10 @@ def get_git_commit_id():
|
|||||||
try:
|
try:
|
||||||
git_head = open('.git/HEAD', 'r').read().rstrip()
|
git_head = open('.git/HEAD', 'r').read().rstrip()
|
||||||
if git_head[:5] == 'ref: ':
|
if git_head[:5] == 'ref: ':
|
||||||
|
# The file is a reference. We have to follow it to get the commit id
|
||||||
git_commit_id = open('.git/%s' % git_head[5:], 'r').read().rstrip()
|
git_commit_id = open('.git/%s' % git_head[5:], 'r').read().rstrip()
|
||||||
else:
|
else:
|
||||||
git_commit_id = git_head
|
git_commit_id = git_head
|
||||||
|
return git_commit_id
|
||||||
except IOError:
|
except IOError:
|
||||||
git_commit_id = 'unknown'
|
return 'unknown'
|
||||||
return str(git_commit_id)
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
@ -13,7 +12,6 @@ from openslides import get_version
|
|||||||
from openslides.utils.main import (
|
from openslides.utils.main import (
|
||||||
detect_openslides_type,
|
detect_openslides_type,
|
||||||
ensure_settings,
|
ensure_settings,
|
||||||
filesystem2unicode,
|
|
||||||
get_browser_url,
|
get_browser_url,
|
||||||
get_database_path_from_settings,
|
get_database_path_from_settings,
|
||||||
get_default_settings_path,
|
get_default_settings_path,
|
||||||
@ -244,10 +242,9 @@ def syncdb(settings, args):
|
|||||||
Run syncdb to create or update the database.
|
Run syncdb to create or update the database.
|
||||||
"""
|
"""
|
||||||
ensure_settings(settings, args)
|
ensure_settings(settings, args)
|
||||||
# TODO: Check use of filesystem2unicode here.
|
|
||||||
db_file = get_database_path_from_settings()
|
db_file = get_database_path_from_settings()
|
||||||
if db_file is not None:
|
if db_file is not None:
|
||||||
db_dir = filesystem2unicode(os.path.dirname(db_file))
|
db_dir = os.path.dirname(db_file)
|
||||||
if not os.path.exists(db_dir):
|
if not os.path.exists(db_dir):
|
||||||
os.makedirs(db_dir)
|
os.makedirs(db_dir)
|
||||||
if not os.path.exists(db_file):
|
if not os.path.exists(db_file):
|
||||||
|
@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import widgets # noqa
|
from . import widgets # noqa
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.contrib.auth.models import AnonymousUser
|
from django.contrib.auth.models import AnonymousUser
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
|
@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import main_menu, personal_info, signals, slides, widgets # noqa
|
from . import main_menu, personal_info, signals, slides, widgets # noqa
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import csv
|
import csv
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -23,14 +21,15 @@ def import_agenda_items(csvfile):
|
|||||||
else:
|
else:
|
||||||
csvfile.seek(0)
|
csvfile.seek(0)
|
||||||
# Check dialect
|
# Check dialect
|
||||||
dialect = csv.Sniffer().sniff(csvfile.readline())
|
dialect = csv.Sniffer().sniff(csvfile.readline().decode('utf8'))
|
||||||
dialect = csv_ext.patchup(dialect)
|
dialect = csv_ext.patchup(dialect)
|
||||||
csvfile.seek(0)
|
csvfile.seek(0)
|
||||||
# Parse CSV file
|
# Parse CSV file
|
||||||
with transaction.commit_on_success():
|
with transaction.commit_on_success():
|
||||||
success_lines = []
|
success_lines = []
|
||||||
error_lines = []
|
error_lines = []
|
||||||
for (line_no, line) in enumerate(csv.reader(csvfile, dialect=dialect)):
|
for (line_no, line) in enumerate(csv.reader(
|
||||||
|
(line.decode('utf8') for line in csvfile.readlines()), dialect=dialect)):
|
||||||
if line_no == 0:
|
if line_no == 0:
|
||||||
# Do not read the header line
|
# Do not read the header line
|
||||||
continue
|
continue
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from ckeditor.widgets import CKEditorWidget
|
from ckeditor.widgets import CKEditorWidget
|
||||||
|
|
||||||
@ -77,5 +75,5 @@ class AppendSpeakerForm(CssClassMixin, forms.Form):
|
|||||||
if Speaker.objects.filter(person=speaker, item=self.item, begin_time=None).exists():
|
if Speaker.objects.filter(person=speaker, item=self.item, begin_time=None).exists():
|
||||||
raise forms.ValidationError(ugettext_lazy(
|
raise forms.ValidationError(ugettext_lazy(
|
||||||
'%s is already on the list of speakers.'
|
'%s is already on the list of speakers.'
|
||||||
% unicode(speaker)))
|
% str(speaker)))
|
||||||
return speaker
|
return speaker
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.main_menu import MainMenuEntry
|
from openslides.utils.main_menu import MainMenuEntry
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from django.contrib.auth.models import AnonymousUser
|
from django.contrib.auth.models import AnonymousUser
|
||||||
@ -133,7 +131,7 @@ class Item(SlideMixin, AbsoluteUrlMixin, MPTTModel):
|
|||||||
raise ValidationError(_('Organizational items can not have agenda items as child elements.'))
|
raise ValidationError(_('Organizational items can not have agenda items as child elements.'))
|
||||||
return super(Item, self).clean()
|
return super(Item, self).clean()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return self.get_title()
|
return self.get_title()
|
||||||
|
|
||||||
def get_absolute_url(self, link='detail'):
|
def get_absolute_url(self, link='detail'):
|
||||||
@ -397,8 +395,8 @@ class Speaker(AbsoluteUrlMixin, models.Model):
|
|||||||
super(Speaker, self).delete(*args, **kwargs)
|
super(Speaker, self).delete(*args, **kwargs)
|
||||||
self.check_and_update_projector()
|
self.check_and_update_projector()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return unicode(self.person)
|
return str(self.person)
|
||||||
|
|
||||||
def get_absolute_url(self, link='detail'):
|
def get_absolute_url(self, link='detail'):
|
||||||
if link == 'detail':
|
if link == 'detail':
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.personal_info import PersonalInfo
|
from openslides.utils.personal_info import PersonalInfo
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
from haystack import indexes
|
||||||
from .models import Item
|
from .models import Item
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
|
|
||||||
from openslides.config.api import config
|
from openslides.config.api import config
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# TODO: Rename all views and template names
|
# TODO: Rename all views and template names
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
@ -394,7 +393,7 @@ class SpeakerAppendView(SingleObjectMixin, RedirectView):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
Speaker.objects.add(item=self.object, person=request.user)
|
Speaker.objects.add(item=self.object, person=request.user)
|
||||||
except OpenSlidesError, e:
|
except OpenSlidesError as e:
|
||||||
messages.error(request, e)
|
messages.error(request, e)
|
||||||
else:
|
else:
|
||||||
messages.success(request, _('You were successfully added to the list of speakers.'))
|
messages.success(request, _('You were successfully added to the list of speakers.'))
|
||||||
@ -627,7 +626,7 @@ class CurrentListOfSpeakersView(RedirectView):
|
|||||||
if self.request.user.has_perm('agenda.can_be_speaker'):
|
if self.request.user.has_perm('agenda.can_be_speaker'):
|
||||||
try:
|
try:
|
||||||
Speaker.objects.add(self.request.user, item)
|
Speaker.objects.add(self.request.user, item)
|
||||||
except OpenSlidesError, e:
|
except OpenSlidesError as e:
|
||||||
messages.error(request, e)
|
messages.error(request, e)
|
||||||
else:
|
else:
|
||||||
messages.success(request, _('You were successfully added to the list of speakers.'))
|
messages.success(request, _('You were successfully added to the list of speakers.'))
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.widgets import Widget
|
from openslides.utils.widgets import Widget
|
||||||
|
@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import main_menu, personal_info, signals, slides, template, widgets # noqa
|
from . import main_menu, personal_info, signals, slides, template, widgets # noqa
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.main_menu import MainMenuEntry
|
from openslides.utils.main_menu import MainMenuEntry
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.db import models
|
from django.db import models
|
||||||
@ -32,8 +30,8 @@ class AssignmentCandidate(RelatedModelMixin, models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("assignment", "person")
|
unique_together = ("assignment", "person")
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return unicode(self.person)
|
return str(self.person)
|
||||||
|
|
||||||
def get_related_model(self):
|
def get_related_model(self):
|
||||||
"""
|
"""
|
||||||
@ -69,7 +67,7 @@ class Assignment(SlideMixin, AbsoluteUrlMixin, models.Model):
|
|||||||
ordering = ('name',)
|
ordering = ('name',)
|
||||||
verbose_name = ugettext_noop('Election')
|
verbose_name = ugettext_noop('Election')
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def get_absolute_url(self, link='detail'):
|
def get_absolute_url(self, link='detail'):
|
||||||
@ -289,8 +287,8 @@ class AssignmentOption(BaseOption):
|
|||||||
candidate = PersonField()
|
candidate = PersonField()
|
||||||
vote_class = AssignmentVote
|
vote_class = AssignmentVote
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return unicode(self.candidate)
|
return str(self.candidate)
|
||||||
|
|
||||||
|
|
||||||
class AssignmentPoll(SlideMixin, RelatedModelMixin, CollectDefaultVotesMixin,
|
class AssignmentPoll(SlideMixin, RelatedModelMixin, CollectDefaultVotesMixin,
|
||||||
@ -306,7 +304,7 @@ class AssignmentPoll(SlideMixin, RelatedModelMixin, CollectDefaultVotesMixin,
|
|||||||
max_length=79, null=True, blank=True,
|
max_length=79, null=True, blank=True,
|
||||||
verbose_name=ugettext_lazy("Comment on the ballot paper"))
|
verbose_name=ugettext_lazy("Comment on the ballot paper"))
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return _("Ballot %d") % self.get_ballot()
|
return _("Ballot %d") % self.get_ballot()
|
||||||
|
|
||||||
def get_absolute_url(self, link='update'):
|
def get_absolute_url(self, link='update'):
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.personal_info import PersonalInfo
|
from openslides.utils.personal_info import PersonalInfo
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
from haystack import indexes
|
||||||
from .models import Assignment
|
from .models import Assignment
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from openslides.projector.api import register_slide_model
|
from openslides.projector.api import register_slide_model
|
||||||
|
|
||||||
from .models import Assignment, AssignmentPoll
|
from .models import Assignment, AssignmentPoll
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
|
||||||
from openslides.utils.signals import template_manipulation
|
from openslides.utils.signals import template_manipulation
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
@ -68,7 +66,7 @@ class AssignmentDetail(DetailView):
|
|||||||
user = form.cleaned_data['candidate']
|
user = form.cleaned_data['candidate']
|
||||||
try:
|
try:
|
||||||
self.object.run(user, self.request.user)
|
self.object.run(user, self.request.user)
|
||||||
except NameError, e:
|
except NameError as e:
|
||||||
messages.error(self.request, e)
|
messages.error(self.request, e)
|
||||||
else:
|
else:
|
||||||
messages.success(self.request, _(
|
messages.success(self.request, _(
|
||||||
@ -106,7 +104,7 @@ class AssignmentSetStatusView(SingleObjectMixin, RedirectView):
|
|||||||
if status is not None:
|
if status is not None:
|
||||||
try:
|
try:
|
||||||
self.object.set_status(status)
|
self.object.set_status(status)
|
||||||
except ValueError, e:
|
except ValueError as e:
|
||||||
messages.error(self.request, e)
|
messages.error(self.request, e)
|
||||||
else:
|
else:
|
||||||
messages.success(
|
messages.success(
|
||||||
@ -124,7 +122,7 @@ class AssignmentRunView(SingleObjectMixin, PermissionMixin, View):
|
|||||||
assignment = self.get_object()
|
assignment = self.get_object()
|
||||||
try:
|
try:
|
||||||
assignment.run(self.request.user, self.request.user)
|
assignment.run(self.request.user, self.request.user)
|
||||||
except NameError, e:
|
except NameError as e:
|
||||||
messages.error(self.request, e)
|
messages.error(self.request, e)
|
||||||
else:
|
else:
|
||||||
messages.success(
|
messages.success(
|
||||||
@ -142,7 +140,8 @@ class AssignmentRunDeleteView(SingleObjectMixin, RedirectView):
|
|||||||
"assignment.can_manage_assignment"):
|
"assignment.can_manage_assignment"):
|
||||||
try:
|
try:
|
||||||
self.object.delrun(self.request.user, blocked=True)
|
self.object.delrun(self.request.user, blocked=True)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
|
# TODO: only catch relevant exception
|
||||||
messages.error(self.request, e)
|
messages.error(self.request, e)
|
||||||
else:
|
else:
|
||||||
messages.success(self.request, _(
|
messages.success(self.request, _(
|
||||||
@ -168,7 +167,8 @@ class AssignmentRunOtherDeleteView(SingleObjectMixin, QuestionView):
|
|||||||
self._get_person_information()
|
self._get_person_information()
|
||||||
try:
|
try:
|
||||||
self.object.delrun(self.person, blocked=False)
|
self.object.delrun(self.person, blocked=False)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
|
# TODO: only catch relevant exception
|
||||||
self.error = e
|
self.error = e
|
||||||
else:
|
else:
|
||||||
self.error = False
|
self.error = False
|
||||||
@ -400,7 +400,7 @@ class AssignmentPDF(PDFView):
|
|||||||
|
|
||||||
# Add result rows
|
# Add result rows
|
||||||
elected_candidates = list(assignment.elected)
|
elected_candidates = list(assignment.elected)
|
||||||
for candidate, poll_list in vote_results.iteritems():
|
for candidate, poll_list in vote_results.items():
|
||||||
row = []
|
row = []
|
||||||
|
|
||||||
candidate_string = candidate.clean_name
|
candidate_string = candidate.clean_name
|
||||||
@ -595,7 +595,7 @@ class AssignmentPollPDF(PDFView):
|
|||||||
cell.append(Spacer(0, 1.3 * cm))
|
cell.append(Spacer(0, 1.3 * cm))
|
||||||
|
|
||||||
# print ballot papers
|
# print ballot papers
|
||||||
for user in xrange(number / 2):
|
for user in range(number // 2):
|
||||||
if len(options) > 13:
|
if len(options) > 13:
|
||||||
data.append([cellcolumnA, cell])
|
data.append([cellcolumnA, cell])
|
||||||
else:
|
else:
|
||||||
@ -629,7 +629,7 @@ class AssignmentPollPDF(PDFView):
|
|||||||
cell.append(Spacer(0, 0.75 * cm))
|
cell.append(Spacer(0, 0.75 * cm))
|
||||||
|
|
||||||
# print ballot papers
|
# print ballot papers
|
||||||
for user in xrange(number / 2):
|
for user in range(number // 2):
|
||||||
if len(options) > 22:
|
if len(options) > 22:
|
||||||
data.append([cellcolumnA, cell])
|
data.append([cellcolumnA, cell])
|
||||||
else:
|
else:
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.widgets import Widget
|
from openslides.utils.widgets import Widget
|
||||||
|
@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import main_menu # noqa
|
from . import main_menu # noqa
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from .exceptions import ConfigError, ConfigNotFound
|
from .exceptions import ConfigError, ConfigNotFound
|
||||||
from .models import ConfigStore
|
from .models import ConfigStore
|
||||||
from .signals import config_signal
|
from .signals import config_signal
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from openslides.utils.exceptions import OpenSlidesError
|
from openslides.utils.exceptions import OpenSlidesError
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.main_menu import MainMenuEntry
|
from openslides.utils.main_menu import MainMenuEntry
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from openslides.config.api import config
|
from openslides.config.api import config
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import ugettext_noop
|
from django.utils.translation import ugettext_noop
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.dispatch import Signal
|
from django.dispatch import Signal
|
||||||
|
|
||||||
config_signal = Signal(providing_args=[])
|
config_signal = Signal(providing_args=[])
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
from openslides.utils.views import RedirectView
|
from openslides.utils.views import RedirectView
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
|
@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import main_menu, signals, slides, widgets # noqa
|
from . import main_menu, signals, slides, widgets # noqa
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
|
|
||||||
from openslides.utils.forms import CssClassMixin
|
from openslides.utils.forms import CssClassMixin
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.main_menu import MainMenuEntry
|
from openslides.utils.main_menu import MainMenuEntry
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.core.management.commands.syncdb import Command as _Command
|
from django.core.management.commands.syncdb import Command as _Command
|
||||||
|
|
||||||
from openslides.core.signals import post_database_setup
|
from openslides.core.signals import post_database_setup
|
||||||
|
@ -27,7 +27,7 @@ class CustomSlide(SlideMixin, AbsoluteUrlMixin, models.Model):
|
|||||||
('can_use_chat', ugettext_noop('Can use the chat')),
|
('can_use_chat', ugettext_noop('Can use the chat')),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
def get_absolute_url(self, link='update'):
|
def get_absolute_url(self, link='update'):
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.dispatch import receiver, Signal
|
from django.dispatch import receiver, Signal
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from openslides.projector.api import register_slide_model
|
from openslides.projector.api import register_slide_model
|
||||||
|
|
||||||
from .models import CustomSlide
|
from .models import CustomSlide
|
||||||
|
@ -35,9 +35,11 @@
|
|||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
<ol class="searchresults">
|
<ol class="searchresults">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if result.app_label %}
|
||||||
{% with result_template=result.app_label|add:"-results.html" %}
|
{% with result_template=result.app_label|add:"-results.html" %}
|
||||||
{% include "search/"|add:result_template %}
|
{% include "search/"|add:result_template %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
{% if forloop.last %}
|
{% if forloop.last %}
|
||||||
</ol>
|
</ol>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import template
|
from django import template
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
from openslides.utils.views import RedirectView
|
from openslides.utils.views import RedirectView
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.core.exceptions import PermissionDenied
|
from django.core.exceptions import PermissionDenied
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.config.api import config
|
from openslides.config.api import config
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.main import filesystem2unicode
|
|
||||||
from openslides.utils.plugins import collect_plugins
|
from openslides.utils.plugins import collect_plugins
|
||||||
|
|
||||||
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
|
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
|
||||||
@ -36,7 +33,7 @@ USE_I18N = True
|
|||||||
USE_L10N = True
|
USE_L10N = True
|
||||||
|
|
||||||
LOCALE_PATHS = (
|
LOCALE_PATHS = (
|
||||||
filesystem2unicode(os.path.join(SITE_ROOT, 'locale')),
|
os.path.join(SITE_ROOT, 'locale'),
|
||||||
)
|
)
|
||||||
|
|
||||||
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||||
@ -46,7 +43,7 @@ MEDIA_URL = '/media/'
|
|||||||
|
|
||||||
# Absolute path to the directory that holds static media from ``collectstatic``
|
# Absolute path to the directory that holds static media from ``collectstatic``
|
||||||
# Example: "/home/media/static.lawrence.com/"
|
# Example: "/home/media/static.lawrence.com/"
|
||||||
STATIC_ROOT = filesystem2unicode(os.path.join(SITE_ROOT, '../collected-site-static'))
|
STATIC_ROOT = os.path.join(SITE_ROOT, '../collected-site-static')
|
||||||
|
|
||||||
# URL that handles the media served from STATIC_ROOT. Make sure to use a
|
# URL that handles the media served from STATIC_ROOT. Make sure to use a
|
||||||
# trailing slash if there is a path component (optional in other cases).
|
# trailing slash if there is a path component (optional in other cases).
|
||||||
|
@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import main_menu, slides, template, widgets # noqa
|
from . import main_menu, slides, template, widgets # noqa
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.forms import ModelForm
|
from django.forms import ModelForm
|
||||||
|
|
||||||
from openslides.utils.forms import CssClassMixin
|
from openslides.utils.forms import CssClassMixin
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.main_menu import MainMenuEntry
|
from openslides.utils.main_menu import MainMenuEntry
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import mimetypes
|
import mimetypes
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
@ -53,7 +51,7 @@ class Mediafile(SlideMixin, AbsoluteUrlMixin, models.Model):
|
|||||||
('can_upload', ugettext_noop('Can upload files')),
|
('can_upload', ugettext_noop('Can upload files')),
|
||||||
('can_manage', ugettext_noop('Can manage files')),)
|
('can_manage', ugettext_noop('Can manage files')),)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""
|
"""
|
||||||
Method for representation.
|
Method for representation.
|
||||||
"""
|
"""
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
from haystack import indexes
|
||||||
from .models import Mediafile
|
from .models import Mediafile
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
|
||||||
from openslides.utils.signals import template_manipulation
|
from openslides.utils.signals import template_manipulation
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
|
||||||
from openslides.config.api import config
|
from openslides.config.api import config
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.widgets import Widget
|
from openslides.utils.widgets import Widget
|
||||||
|
@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import main_menu, personal_info, signals, slides, widgets # noqa
|
from . import main_menu, personal_info, signals, slides, widgets # noqa
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# TODO: Rename the file to 'csv.py' when we drop python2 support. At the moment
|
# TODO: Rename the file to 'csv.py' when we drop python2 support. At the moment
|
||||||
# the name csv has a conflict with the core-module. See:
|
# the name csv has a conflict with the core-module. See:
|
||||||
# http://docs.python.org/2/tutorial/modules.html#intra-package-references
|
# http://docs.python.org/2/tutorial/modules.html#intra-package-references
|
||||||
@ -38,12 +36,13 @@ def import_motions(csvfile, default_submitter, override, importing_person=None):
|
|||||||
csvfile.seek(0)
|
csvfile.seek(0)
|
||||||
|
|
||||||
with transaction.commit_on_success():
|
with transaction.commit_on_success():
|
||||||
dialect = csv.Sniffer().sniff(csvfile.readline())
|
dialect = csv.Sniffer().sniff(csvfile.readline().decode('utf8'))
|
||||||
dialect = csv_ext.patchup(dialect)
|
dialect = csv_ext.patchup(dialect)
|
||||||
csvfile.seek(0)
|
csvfile.seek(0)
|
||||||
all_error_messages = []
|
all_error_messages = []
|
||||||
all_warning_messages = []
|
all_warning_messages = []
|
||||||
for (line_no, line) in enumerate(csv.reader(csvfile, dialect=dialect)):
|
for (line_no, line) in enumerate(csv.reader(
|
||||||
|
(line.decode('utf8') for line in csvfile.readlines()), dialect=dialect)):
|
||||||
warning = []
|
warning = []
|
||||||
if line_no < 1:
|
if line_no < 1:
|
||||||
# Do not read the header line
|
# Do not read the header line
|
||||||
@ -92,7 +91,7 @@ def import_motions(csvfile, default_submitter, override, importing_person=None):
|
|||||||
person_found = False
|
person_found = False
|
||||||
if submitter:
|
if submitter:
|
||||||
for person in Persons():
|
for person in Persons():
|
||||||
if person.clean_name == submitter.decode('utf8'):
|
if person.clean_name == submitter:
|
||||||
if person_found:
|
if person_found:
|
||||||
warning.append(_('Several suitable submitters found.'))
|
warning.append(_('Several suitable submitters found.'))
|
||||||
person_found = False
|
person_found = False
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from openslides.utils.exceptions import OpenSlidesError
|
from openslides.utils.exceptions import OpenSlidesError
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.main_menu import MainMenuEntry
|
from openslides.utils.main_menu import MainMenuEntry
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models import Max
|
from django.db.models import Max
|
||||||
@ -84,7 +82,7 @@ class Motion(SlideMixin, AbsoluteUrlMixin, models.Model):
|
|||||||
ordering = ('identifier', )
|
ordering = ('identifier', )
|
||||||
verbose_name = ugettext_noop('Motion')
|
verbose_name = ugettext_noop('Motion')
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""
|
"""
|
||||||
Return a human readable name of this motion.
|
Return a human readable name of this motion.
|
||||||
"""
|
"""
|
||||||
@ -125,7 +123,7 @@ class Motion(SlideMixin, AbsoluteUrlMixin, models.Model):
|
|||||||
|
|
||||||
# Solves the problem, that there can only be one motion with an empty
|
# Solves the problem, that there can only be one motion with an empty
|
||||||
# string as identifier.
|
# string as identifier.
|
||||||
if not self.identifier and isinstance(self.identifier, basestring):
|
if not self.identifier and isinstance(self.identifier, str):
|
||||||
self.identifier = None
|
self.identifier = None
|
||||||
|
|
||||||
super(Motion, self).save(*args, **kwargs)
|
super(Motion, self).save(*args, **kwargs)
|
||||||
@ -461,7 +459,7 @@ class Motion(SlideMixin, AbsoluteUrlMixin, models.Model):
|
|||||||
"""
|
"""
|
||||||
Return a title for the agenda.
|
Return a title for the agenda.
|
||||||
"""
|
"""
|
||||||
return unicode(self)
|
return str(self)
|
||||||
|
|
||||||
def get_agenda_title_supplement(self):
|
def get_agenda_title_supplement(self):
|
||||||
"""
|
"""
|
||||||
@ -551,7 +549,7 @@ class MotionVersion(AbsoluteUrlMixin, models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("motion", "version_number")
|
unique_together = ("motion", "version_number")
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Return a string, representing this object."""
|
"""Return a string, representing this object."""
|
||||||
counter = self.version_number or ugettext_lazy('new')
|
counter = self.version_number or ugettext_lazy('new')
|
||||||
return "Motion %s, Version %s" % (self.motion_id, counter)
|
return "Motion %s, Version %s" % (self.motion_id, counter)
|
||||||
@ -587,9 +585,9 @@ class MotionSubmitter(RelatedModelMixin, models.Model):
|
|||||||
person = PersonField()
|
person = PersonField()
|
||||||
"""The person, who is the submitter."""
|
"""The person, who is the submitter."""
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Return the name of the submitter as string."""
|
"""Return the name of the submitter as string."""
|
||||||
return unicode(self.person)
|
return str(self.person)
|
||||||
|
|
||||||
def get_related_model(self):
|
def get_related_model(self):
|
||||||
return self.motion
|
return self.motion
|
||||||
@ -604,9 +602,9 @@ class MotionSupporter(models.Model):
|
|||||||
person = PersonField()
|
person = PersonField()
|
||||||
"""The person, who is the supporter."""
|
"""The person, who is the supporter."""
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Return the name of the supporter as string."""
|
"""Return the name of the supporter as string."""
|
||||||
return unicode(self.person)
|
return str(self.person)
|
||||||
|
|
||||||
|
|
||||||
class Category(AbsoluteUrlMixin, models.Model):
|
class Category(AbsoluteUrlMixin, models.Model):
|
||||||
@ -619,7 +617,7 @@ class Category(AbsoluteUrlMixin, models.Model):
|
|||||||
Used to build the identifier of a motion.
|
Used to build the identifier of a motion.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def get_absolute_url(self, link='update'):
|
def get_absolute_url(self, link='update'):
|
||||||
@ -661,7 +659,7 @@ class MotionLog(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['-time']
|
ordering = ['-time']
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""
|
"""
|
||||||
Return a string, representing the log message.
|
Return a string, representing the log message.
|
||||||
"""
|
"""
|
||||||
@ -721,7 +719,7 @@ class MotionPoll(SlideMixin, RelatedModelMixin, CollectDefaultVotesMixin,
|
|||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("motion", "poll_number")
|
unique_together = ("motion", "poll_number")
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Return a string, representing the poll."""
|
"""Return a string, representing the poll."""
|
||||||
return _('Vote %d') % self.poll_number
|
return _('Vote %d') % self.poll_number
|
||||||
|
|
||||||
@ -808,7 +806,7 @@ class State(models.Model):
|
|||||||
If true, the motion does not get an identifier if the state change to
|
If true, the motion does not get an identifier if the state change to
|
||||||
this one, else it does."""
|
this one, else it does."""
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Returns the name of the state."""
|
"""Returns the name of the state."""
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
@ -843,7 +841,7 @@ class Workflow(models.Model):
|
|||||||
first_state = models.OneToOneField(State, related_name='+', null=True)
|
first_state = models.OneToOneField(State, related_name='+', null=True)
|
||||||
"""A one-to-one relation to a state, the starting point for the workflow."""
|
"""A one-to-one relation to a state, the starting point for the workflow."""
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Returns the name of the workflow."""
|
"""Returns the name of the workflow."""
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
import random
|
import random
|
||||||
|
|
||||||
@ -51,7 +49,7 @@ def motion_to_pdf(pdf, motion):
|
|||||||
cell1b = []
|
cell1b = []
|
||||||
cell1b.append(Spacer(0, 0.2 * cm))
|
cell1b.append(Spacer(0, 0.2 * cm))
|
||||||
for submitter in motion.submitter.all():
|
for submitter in motion.submitter.all():
|
||||||
cell1b.append(Paragraph(unicode(submitter), stylesheet['Normal']))
|
cell1b.append(Paragraph(str(submitter), stylesheet['Normal']))
|
||||||
motion_data.append([cell1a, cell1b])
|
motion_data.append([cell1a, cell1b])
|
||||||
|
|
||||||
# TODO: choose this in workflow
|
# TODO: choose this in workflow
|
||||||
@ -74,7 +72,7 @@ def motion_to_pdf(pdf, motion):
|
|||||||
% _("Supporters"), stylesheet['Heading4']))
|
% _("Supporters"), stylesheet['Heading4']))
|
||||||
supporters = motion.supporter.all()
|
supporters = motion.supporter.all()
|
||||||
for supporter in supporters:
|
for supporter in supporters:
|
||||||
cell3b.append(Paragraph("<seq id='counter'/>. %s" % unicode(supporter),
|
cell3b.append(Paragraph("<seq id='counter'/>. %s" % str(supporter),
|
||||||
stylesheet['Normal']))
|
stylesheet['Normal']))
|
||||||
cell3b.append(Spacer(0, 0.2 * cm))
|
cell3b.append(Spacer(0, 0.2 * cm))
|
||||||
motion_data.append([cell3a, cell3b])
|
motion_data.append([cell3a, cell3b])
|
||||||
@ -200,7 +198,7 @@ def convert_html_to_reportlab(pdf, text):
|
|||||||
text = soup.body.contents
|
text = soup.body.contents
|
||||||
paragraph_number = 1
|
paragraph_number = 1
|
||||||
for paragraph in text:
|
for paragraph in text:
|
||||||
paragraph = unicode(paragraph)
|
paragraph = str(paragraph)
|
||||||
# ignore empty paragraphs (created by newlines/tabs of ckeditor)
|
# ignore empty paragraphs (created by newlines/tabs of ckeditor)
|
||||||
if paragraph == '\n' or paragraph == '\n\n' or paragraph == '\n\t':
|
if paragraph == '\n' or paragraph == '\n\n' or paragraph == '\n\t':
|
||||||
continue
|
continue
|
||||||
@ -271,11 +269,11 @@ def motion_poll_to_pdf(pdf, poll):
|
|||||||
cell.append(Paragraph(_("%d. Vote") % poll.poll_number, stylesheet['Ballot_description']))
|
cell.append(Paragraph(_("%d. Vote") % poll.poll_number, stylesheet['Ballot_description']))
|
||||||
cell.append(Spacer(0, 0.5 * cm))
|
cell.append(Spacer(0, 0.5 * cm))
|
||||||
cell.append(Paragraph("<font name='circlefont' size='15'>%s</font> <font name='Ubuntu'>%s</font>"
|
cell.append(Paragraph("<font name='circlefont' size='15'>%s</font> <font name='Ubuntu'>%s</font>"
|
||||||
% (circle, unicode(_("Yes"))), stylesheet['Ballot_option']))
|
% (circle, _("Yes")), stylesheet['Ballot_option']))
|
||||||
cell.append(Paragraph("<font name='circlefont' size='15'>%s</font> <font name='Ubuntu'>%s</font>"
|
cell.append(Paragraph("<font name='circlefont' size='15'>%s</font> <font name='Ubuntu'>%s</font>"
|
||||||
% (circle, unicode(_("No"))), stylesheet['Ballot_option']))
|
% (circle, _("No")), stylesheet['Ballot_option']))
|
||||||
cell.append(Paragraph("<font name='circlefont' size='15'>%s</font> <font name='Ubuntu'>%s</font>"
|
cell.append(Paragraph("<font name='circlefont' size='15'>%s</font> <font name='Ubuntu'>%s</font>"
|
||||||
% (circle, unicode(_("Abstention"))), stylesheet['Ballot_option']))
|
% (circle, _("Abstention")), stylesheet['Ballot_option']))
|
||||||
data = []
|
data = []
|
||||||
# get ballot papers config values
|
# get ballot papers config values
|
||||||
ballot_papers_selection = config["motion_pdf_ballot_papers_selection"]
|
ballot_papers_selection = config["motion_pdf_ballot_papers_selection"]
|
||||||
@ -299,7 +297,7 @@ def motion_poll_to_pdf(pdf, poll):
|
|||||||
# print ballot papers
|
# print ballot papers
|
||||||
if number > 0:
|
if number > 0:
|
||||||
# TODO: try [cell, cell] * (number / 2)
|
# TODO: try [cell, cell] * (number / 2)
|
||||||
for user in xrange(number / 2):
|
for user in range(number / 2):
|
||||||
data.append([cell, cell])
|
data.append([cell, cell])
|
||||||
rest = number % 2
|
rest = number % 2
|
||||||
if rest:
|
if rest:
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.config.api import config
|
from openslides.config.api import config
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
from haystack import indexes
|
||||||
from .models import Motion
|
from .models import Motion
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from openslides.projector.api import register_slide_model
|
from openslides.projector.api import register_slide_model
|
||||||
|
|
||||||
from .models import Motion, MotionPoll
|
from .models import Motion, MotionPoll
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
# TODO: define the Views inhere
|
# TODO: define the Views inhere
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.http import Http404, HttpResponseRedirect
|
from django.http import Http404, HttpResponseRedirect
|
||||||
@ -121,7 +119,7 @@ class MotionEditMixin(object):
|
|||||||
active_slide = get_active_slide()
|
active_slide = get_active_slide()
|
||||||
active_slide_pk = active_slide.get('pk', None)
|
active_slide_pk = active_slide.get('pk', None)
|
||||||
if (active_slide['callback'] == 'motion' and
|
if (active_slide['callback'] == 'motion' and
|
||||||
unicode(self.object.pk) == unicode(active_slide_pk)):
|
str(self.object.pk) == str(active_slide_pk)):
|
||||||
update_projector()
|
update_projector()
|
||||||
|
|
||||||
messages.success(self.request, self.get_success_message())
|
messages.success(self.request, self.get_success_message())
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.widgets import Widget
|
from openslides.utils.widgets import Widget
|
||||||
|
@ -1,3 +1 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from . import main_menu, signals, slides, widgets # noqa
|
from . import main_menu, signals, slides, widgets # noqa
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from random import choice
|
from random import choice
|
||||||
|
|
||||||
from .models import Group, User
|
from .models import Group, User
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import csv
|
import csv
|
||||||
|
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
@ -21,12 +19,12 @@ def import_users(csvfile):
|
|||||||
csvfile.seek(0)
|
csvfile.seek(0)
|
||||||
|
|
||||||
with transaction.commit_on_success():
|
with transaction.commit_on_success():
|
||||||
dialect = csv.Sniffer().sniff(csvfile.readline())
|
dialect = csv.Sniffer().sniff(csvfile.readline().decode('utf-8'))
|
||||||
dialect = csv_ext.patchup(dialect)
|
dialect = csv_ext.patchup(dialect)
|
||||||
csvfile.seek(0)
|
csvfile.seek(0)
|
||||||
|
|
||||||
for (line_no, line) in enumerate(csv.reader(csvfile,
|
for (line_no, line) in enumerate(csv.reader(
|
||||||
dialect=dialect)):
|
(line.decode('utf8') for line in csvfile.readlines()), dialect=dialect)):
|
||||||
if line_no:
|
if line_no:
|
||||||
try:
|
try:
|
||||||
(title, first_name, last_name, gender, email, groups,
|
(title, first_name, last_name, gender, email, groups,
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import Permission
|
from django.contrib.auth.models import Permission
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy
|
from django.utils.translation import ugettext_lazy
|
||||||
|
|
||||||
from openslides.utils.main_menu import MainMenuEntry
|
from openslides.utils.main_menu import MainMenuEntry
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.contrib.auth.middleware import AuthenticationMiddleware as _AuthenticationMiddleware
|
from django.contrib.auth.middleware import AuthenticationMiddleware as _AuthenticationMiddleware
|
||||||
from django.contrib.auth.models import AnonymousUser
|
from django.contrib.auth.models import AnonymousUser
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.contrib.auth.models import Group as DjangoGroup
|
from django.contrib.auth.models import Group as DjangoGroup
|
||||||
from django.contrib.auth.models import User as DjangoUser
|
from django.contrib.auth.models import User as DjangoUser
|
||||||
from django.contrib.auth.models import Permission
|
from django.contrib.auth.models import Permission
|
||||||
@ -56,7 +54,7 @@ class User(SlideMixin, PersonMixin, Person, AbsoluteUrlMixin, DjangoUser):
|
|||||||
)
|
)
|
||||||
ordering = ('last_name',)
|
ordering = ('last_name',)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
if self.name_suffix:
|
if self.name_suffix:
|
||||||
return u"%s (%s)" % (self.clean_name, self.name_suffix)
|
return u"%s (%s)" % (self.clean_name, self.name_suffix)
|
||||||
return u"%s" % self.clean_name
|
return u"%s" % self.clean_name
|
||||||
@ -125,8 +123,8 @@ class Group(SlideMixin, PersonMixin, Person, AbsoluteUrlMixin, DjangoGroup):
|
|||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('name',)
|
ordering = ('name',)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return unicode(self.name)
|
return str(self.name)
|
||||||
|
|
||||||
def get_absolute_url(self, link='detail'):
|
def get_absolute_url(self, link='detail'):
|
||||||
"""
|
"""
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from reportlab.graphics.barcode.qr import QrCodeWidget
|
from reportlab.graphics.barcode.qr import QrCodeWidget
|
||||||
from reportlab.graphics.shapes import Drawing
|
from reportlab.graphics.shapes import Drawing
|
||||||
@ -30,7 +28,7 @@ def participants_to_pdf(pdf):
|
|||||||
groups = ''
|
groups = ''
|
||||||
for group in user.groups.all():
|
for group in user.groups.all():
|
||||||
if group.pk != 2:
|
if group.pk != 2:
|
||||||
groups += "%s<br/>" % unicode(_(group.name))
|
groups += "%s<br/>" % _(group.name)
|
||||||
data.append([
|
data.append([
|
||||||
counter,
|
counter,
|
||||||
Paragraph(user.title, stylesheet['Tablecell']),
|
Paragraph(user.title, stylesheet['Tablecell']),
|
||||||
@ -82,7 +80,7 @@ def participants_passwords_to_pdf(pdf):
|
|||||||
qrcode_wlan_draw.add(qrcode_wlan)
|
qrcode_wlan_draw.add(qrcode_wlan)
|
||||||
|
|
||||||
for user in User.objects.all().order_by(sort):
|
for user in User.objects.all().order_by(sort):
|
||||||
pdf.append(Paragraph(unicode(user), stylesheet['h1']))
|
pdf.append(Paragraph(user, stylesheet['h1']))
|
||||||
pdf.append(Spacer(0, 1 * cm))
|
pdf.append(Spacer(0, 1 * cm))
|
||||||
data = []
|
data = []
|
||||||
# WLAN access data
|
# WLAN access data
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
from haystack import indexes
|
||||||
from .models import User
|
from .models import User
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.contrib.auth.models import Permission
|
from django.contrib.auth.models import Permission
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from openslides.projector.api import register_slide_model
|
from openslides.projector.api import register_slide_model
|
||||||
|
|
||||||
from .models import Group, User
|
from .models import Group, User
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.contrib.auth.forms import PasswordChangeForm
|
from django.contrib.auth.forms import PasswordChangeForm
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user