-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from Viagenie/release-3.0.0
Release 3.0.0
- Loading branch information
Showing
98 changed files
with
166,514 additions
and
1,189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
# Core stuff | ||
Django==1.8.4 | ||
django-widget-tweaks==1.4.1 | ||
django-multiupload==0.5.2 | ||
celery[redis]==3.1.23 | ||
django-redis-cache==1.7.1 | ||
Django==2.2.1 | ||
django-widget-tweaks==1.4.3 | ||
#django-multiupload==0.5.2 | ||
-e git+https://github.com/Chive/django-multiupload.git@ba52e161a68ce19062c3655e89544c2d377990a0#egg=django-multiupload | ||
celery[redis]==4.3.0 | ||
django-redis-cache==2.0.0 | ||
django-autocomplete-light==3.5.1 | ||
vine==1.3.0 | ||
|
||
# LGR/Unicode modules | ||
picu==1.0 | ||
picu==1.1 | ||
munidata==2.0.0 | ||
lgr-core==2.0.0 | ||
lgr-core==3.0.0 | ||
|
||
# Natural sorting implementation | ||
natsort==5.0.3 | ||
natsort==6.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setup( | ||
name='lgr-django', | ||
version='2.0.0', | ||
version='3.0.0', | ||
author='Viagenie and Wil Tan', | ||
author_email='[email protected]', | ||
packages=find_packages('src'), | ||
|
@@ -19,15 +19,18 @@ | |
'Framework :: Django :: 1.8', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
], | ||
install_requires=[ | ||
# Core stuff | ||
'Django', | ||
'django-widget-tweaks', | ||
'django-multiupload', | ||
'django-redis-cache', | ||
'django-autocomplete-light', | ||
'celery', | ||
# LGR/Unicode modules | ||
'lgr-core', | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# -*- coding: utf-8 -*- | ||
from django import forms | ||
from django.core.exceptions import ValidationError | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from lgr.tools.utils import parse_label_input | ||
from lgr_editor.api import LGRInfo | ||
from lgr_editor.forms.fields import ROOT_ZONES | ||
from lgr_editor.lgr_exceptions import lgr_exception_to_text | ||
from lgr_editor.repertoires import get_by_name | ||
from lgr_editor.unidb import get_db_by_version | ||
from lgr_tools.forms import UAEmailField | ||
|
||
|
||
class ValidateLabelSimpleForm(forms.Form): | ||
rz_lgr = forms.ChoiceField(label='', required=True, choices=ROOT_ZONES, initial=ROOT_ZONES[-1][0]) | ||
labels = forms.CharField(label='', required=False, | ||
widget=forms.TextInput(attrs={'name': '', | ||
'class': 'form-label form-control', | ||
'onkeyup': 'buttonValidateEnabled()', | ||
'placeholder': _('Label')})) | ||
labels_file = forms.FileField(label='', help_text=_('File must be encoded in UTF-8 and using UNIX line ending.'), | ||
required=False) | ||
email = UAEmailField(label='', required=False, | ||
widget=forms.TextInput(attrs={'id': 'email-task', | ||
'placeholder': _('Email address for tasks results')}), | ||
help_text=_("As the computing may be very long, we will warn by e-mail once the result can " | ||
"be downloaded.")) | ||
collisions = forms.BooleanField(label='', widget=forms.CheckboxInput(attrs={'id': 'check-for-collision'}), | ||
required=False) | ||
|
||
def clean(self): | ||
cleaned_data = super(ValidateLabelSimpleForm, self).clean() | ||
if (self.cleaned_data.get('collisions') and len(cleaned_data.get('labels', [])) > 1) or self.cleaned_data.get( | ||
'labels_file'): | ||
if not self.cleaned_data.get('email'): | ||
self.add_error('email', _('E-mail is mandatory to get the tasks results')) | ||
|
||
if 'labels' not in self.errors and not cleaned_data.get('labels') and not cleaned_data.get('labels_file'): | ||
self.add_error('labels', _('Required')) | ||
self.add_error('labels_file', _('Required')) | ||
|
||
if cleaned_data.get('labels') and cleaned_data.get('labels_file'): | ||
# should not happen | ||
self.add_error('labels', _('Unknown error, please report')) | ||
self.add_error('labels_file', _('Unknown error, please report')) | ||
|
||
return cleaned_data | ||
|
||
def clean_labels(self): | ||
rz_lgr = self.cleaned_data['rz_lgr'] | ||
lgr_info = LGRInfo(rz_lgr, lgr=get_by_name(rz_lgr, with_unidb=True)) | ||
udata = get_db_by_version(lgr_info.lgr.metadata.unicode_version) | ||
|
||
value = self.cleaned_data['labels'] | ||
labels = list() | ||
for label in set(value.split(';')): | ||
if not label: | ||
continue | ||
try: | ||
labels.append(parse_label_input(label, idna_decoder=udata.idna_decode_label)) | ||
except ValueError as e: | ||
raise ValidationError(lgr_exception_to_text(e)) | ||
return labels |
Binary file not shown.
Oops, something went wrong.