Skip to content

Commit

Permalink
Merge pull request #1346 from scieloorg/beta
Browse files Browse the repository at this point in the history
Incorporação de códigos estáveis para release.
  • Loading branch information
gustavofonseca authored Oct 4, 2016
2 parents cb147bb + 7f420b1 commit 7168780
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 42 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ yuicompressor
jsonfield
django-tastypie==0.9.16
django-htmlmin==0.7.0
packtools==1.2
packtools==1.3.1
Celery
django-celery
django-kombu
Expand Down
27 changes: 15 additions & 12 deletions scielomanager/scielomanager/locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: SciELO Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-24 15:07-0300\n"
"POT-Creation-Date: 2016-10-03 17:53-0300\n"
"PO-Revision-Date: 2012-10-23 08:30+0000\n"
"Last-Translator: scielo <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -1057,13 +1057,11 @@ msgid "Journal cover image file size is too large! Please select another file."
msgstr ""

#: journalmanager/forms.py:198
#, python-brace-format
msgid ""
"The image is {image_size}px pixel wide. It's supposed to be {expected_size}px"
msgstr ""

#: journalmanager/forms.py:204
#, python-brace-format
msgid ""
"The image is {image_size}px pixel high. It's supposed to be {expected_size}px"
msgstr ""
Expand All @@ -1080,13 +1078,11 @@ msgid "Journal logo image file size is too large! Please select another file."
msgstr ""

#: journalmanager/forms.py:223
#, python-brace-format
msgid ""
"The image is {logo_size}px pixel wide. It's supposed to be {expected_size}px"
msgstr ""

#: journalmanager/forms.py:227
#, python-brace-format
msgid ""
"The image is {logo_size}px pixel high. It's supposed to be {expected_size}px"
msgstr ""
Expand Down Expand Up @@ -1605,7 +1601,6 @@ msgid "Can't delete, some issues are using this Section"
msgstr "Cant't delete, some issues are using this Section"

#: journalmanager/views.py:1210
#, python-brace-format
msgid "{journal} add to collection {collection}"
msgstr ""

Expand Down Expand Up @@ -2264,7 +2259,6 @@ msgid "Report"
msgstr "Report bug"

#: scielomanager/custom_fields.py:44
#, python-brace-format
msgid "Please keep file size under {maxsize}. Current file size {filesize}"
msgstr ""

Expand Down Expand Up @@ -2508,17 +2502,17 @@ msgstr "Please correct the errors below."
msgid "You will receive an email with a link to activate your account."
msgstr "You will receive an email with a link to activate your account."

#: validator/forms.py:9
#: validator/forms.py:10
#: validator/templates/validator/includes/xml_annotated.html:15
msgid "File"
msgstr ""

#: validator/forms.py:15
#: validator/forms.py:16
#: validator/templates/validator/includes/xml_upload_form_validation.html:25
msgid "This type of file is not allowed! Please select another file."
msgstr ""

#: validator/forms.py:18
#: validator/forms.py:19
msgid "The file's size is too large! Please select a smaller file."
msgstr ""

Expand Down Expand Up @@ -2557,7 +2551,7 @@ msgid "Max. upload size"
msgstr ""

#: validator/templates/validator/preview_html.html:50
#: validator/templates/validator/stylechecker.html:54
#: validator/templates/validator/stylechecker.html:61
msgid "Clear"
msgstr ""

Expand All @@ -2566,7 +2560,7 @@ msgid "Preview"
msgstr ""

#: validator/templates/validator/preview_html.html:57
#: validator/templates/validator/stylechecker.html:61
#: validator/templates/validator/stylechecker.html:68
msgid ""
"\n"
" If you have any problems with the tool or with the SPS Tagging "
Expand Down Expand Up @@ -2605,6 +2599,15 @@ msgid ""
msgstr ""

#: validator/templates/validator/stylechecker.html:55
msgid ""
"\n"
" Also validate against SciELO Brazil's specific rules. <a "
"href=\"http://docs.scielo.org/projects/scielo-publishing-schema/pt_BR/latest/"
"narr/scielo-brasil.html\">Read more.</a>\n"
" "
msgstr ""

#: validator/templates/validator/stylechecker.html:62
msgid "Validate"
msgstr ""

Expand Down
28 changes: 16 additions & 12 deletions scielomanager/scielomanager/locale/es_ES/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ msgid ""
msgstr ""
"Project-Id-Version: SciELO Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-24 15:08-0300\n"
"POT-Creation-Date: 2016-10-03 17:53-0300\n"
"PO-Revision-Date: 2016-07-22 11:49+0000\n"
"Last-Translator: Javani Araujo <[email protected]>\n"
"Language-Team: Spanish (Spain) (http://www.transifex.com/scielo/"
Expand Down Expand Up @@ -1027,15 +1027,13 @@ msgstr ""
"favor seleccione otro archivo."

#: journalmanager/forms.py:198
#, python-brace-format
msgid ""
"The image is {image_size}px pixel wide. It's supposed to be {expected_size}px"
msgstr ""
"La imagen es {image_size}px de ancho. Se supone que debe ser {expected_size}"
"px"

#: journalmanager/forms.py:204
#, python-brace-format
msgid ""
"The image is {image_size}px pixel high. It's supposed to be {expected_size}px"
msgstr ""
Expand All @@ -1058,15 +1056,13 @@ msgstr ""
"seleccione otro archivo."

#: journalmanager/forms.py:223
#, python-brace-format
msgid ""
"The image is {logo_size}px pixel wide. It's supposed to be {expected_size}px"
msgstr ""
"La imagen del logo tiene {logo_size}px de ancho. Se supone que debe ser "
"{expected_size}px"

#: journalmanager/forms.py:227
#, python-brace-format
msgid ""
"The image is {logo_size}px pixel high. It's supposed to be {expected_size}px"
msgstr ""
Expand Down Expand Up @@ -1571,7 +1567,6 @@ msgid "Can't delete, some issues are using this Section"
msgstr "No se puede eliminar, algunas ediciones están usando esta Sección."

#: journalmanager/views.py:1210
#, python-brace-format
msgid "{journal} add to collection {collection}"
msgstr "{journal} agregado a la colección {collection}"

Expand Down Expand Up @@ -2200,7 +2195,7 @@ msgid "Report"
msgstr "Reporte"

#: scielomanager/custom_fields.py:44
#, fuzzy, python-brace-format
#, fuzzy
msgid "Please keep file size under {maxsize}. Current file size {filesize}"
msgstr ""
"Por favor mantenga el tamaño de los archivos menores a %(maxsize)s. Tamaño "
Expand Down Expand Up @@ -2447,18 +2442,18 @@ msgid "You will receive an email with a link to activate your account."
msgstr ""
"Usted recibirá un correo electrónico con un enlace para activar su cuenta."

#: validator/forms.py:9
#: validator/forms.py:10
#: validator/templates/validator/includes/xml_annotated.html:15
msgid "File"
msgstr "Archivo"

#: validator/forms.py:15
#: validator/forms.py:16
#: validator/templates/validator/includes/xml_upload_form_validation.html:25
msgid "This type of file is not allowed! Please select another file."
msgstr ""
"Este tipo de archivo no está permitido! Por favor seleccione otro archivo."

#: validator/forms.py:18
#: validator/forms.py:19
msgid "The file's size is too large! Please select a smaller file."
msgstr ""
"El tamaño de archivo es muy grande! Por favor seleccione otro archivo. "
Expand Down Expand Up @@ -2499,7 +2494,7 @@ msgid "Max. upload size"
msgstr "Tamaño máximo de archivos de subida"

#: validator/templates/validator/preview_html.html:50
#: validator/templates/validator/stylechecker.html:54
#: validator/templates/validator/stylechecker.html:61
msgid "Clear"
msgstr "Limpiar"

Expand All @@ -2508,7 +2503,7 @@ msgid "Preview"
msgstr "Vista previa"

#: validator/templates/validator/preview_html.html:57
#: validator/templates/validator/stylechecker.html:61
#: validator/templates/validator/stylechecker.html:68
msgid ""
"\n"
" If you have any problems with the tool or with the SPS Tagging "
Expand Down Expand Up @@ -2562,6 +2557,15 @@ msgstr ""
" "

#: validator/templates/validator/stylechecker.html:55
msgid ""
"\n"
" Also validate against SciELO Brazil's specific rules. <a "
"href=\"http://docs.scielo.org/projects/scielo-publishing-schema/pt_BR/latest/"
"narr/scielo-brasil.html\">Read more.</a>\n"
" "
msgstr ""

#: validator/templates/validator/stylechecker.html:62
msgid "Validate"
msgstr "Validar"

Expand Down
27 changes: 15 additions & 12 deletions scielomanager/scielomanager/locale/pt_BR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: SciELO Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-24 15:08-0300\n"
"POT-Creation-Date: 2016-10-03 17:53-0300\n"
"PO-Revision-Date: 2015-08-21 21:19+0000\n"
"Last-Translator: Gustavo Fonseca <[email protected]>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/scielo/"
Expand Down Expand Up @@ -985,13 +985,11 @@ msgid "Journal cover image file size is too large! Please select another file."
msgstr ""

#: journalmanager/forms.py:198
#, python-brace-format
msgid ""
"The image is {image_size}px pixel wide. It's supposed to be {expected_size}px"
msgstr ""

#: journalmanager/forms.py:204
#, python-brace-format
msgid ""
"The image is {image_size}px pixel high. It's supposed to be {expected_size}px"
msgstr ""
Expand All @@ -1008,13 +1006,11 @@ msgid "Journal logo image file size is too large! Please select another file."
msgstr ""

#: journalmanager/forms.py:223
#, python-brace-format
msgid ""
"The image is {logo_size}px pixel wide. It's supposed to be {expected_size}px"
msgstr ""

#: journalmanager/forms.py:227
#, python-brace-format
msgid ""
"The image is {logo_size}px pixel high. It's supposed to be {expected_size}px"
msgstr ""
Expand Down Expand Up @@ -1508,7 +1504,6 @@ msgid "Can't delete, some issues are using this Section"
msgstr ""

#: journalmanager/views.py:1210
#, python-brace-format
msgid "{journal} add to collection {collection}"
msgstr ""

Expand Down Expand Up @@ -2131,7 +2126,6 @@ msgid "Report"
msgstr "Relatório"

#: scielomanager/custom_fields.py:44
#, python-brace-format
msgid "Please keep file size under {maxsize}. Current file size {filesize}"
msgstr ""

Expand Down Expand Up @@ -2372,17 +2366,17 @@ msgstr "Por favor, corrija os erros abaixo."
msgid "You will receive an email with a link to activate your account."
msgstr "Você receberá um e-mail com um link para ativar sua conta."

#: validator/forms.py:9
#: validator/forms.py:10
#: validator/templates/validator/includes/xml_annotated.html:15
msgid "File"
msgstr "Arquivo"

#: validator/forms.py:15
#: validator/forms.py:16
#: validator/templates/validator/includes/xml_upload_form_validation.html:25
msgid "This type of file is not allowed! Please select another file."
msgstr "Tipo de arquivo não suportado. Por favor, selecione outro arquivo."

#: validator/forms.py:18
#: validator/forms.py:19
msgid "The file's size is too large! Please select a smaller file."
msgstr "Este arquivo é muito grande! Por favor, selecione um arquivo menor."

Expand Down Expand Up @@ -2425,7 +2419,7 @@ msgid "Max. upload size"
msgstr "Tamanho máximo"

#: validator/templates/validator/preview_html.html:50
#: validator/templates/validator/stylechecker.html:54
#: validator/templates/validator/stylechecker.html:61
msgid "Clear"
msgstr "Limpar"

Expand All @@ -2434,7 +2428,7 @@ msgid "Preview"
msgstr ""

#: validator/templates/validator/preview_html.html:57
#: validator/templates/validator/stylechecker.html:61
#: validator/templates/validator/stylechecker.html:68
msgid ""
"\n"
" If you have any problems with the tool or with the SPS Tagging "
Expand Down Expand Up @@ -2489,6 +2483,15 @@ msgstr ""
" "

#: validator/templates/validator/stylechecker.html:55
msgid ""
"\n"
" Also validate against SciELO Brazil's specific rules. <a "
"href=\"http://docs.scielo.org/projects/scielo-publishing-schema/pt_BR/latest/"
"narr/scielo-brasil.html\">Read more.</a>\n"
" "
msgstr ""

#: validator/templates/validator/stylechecker.html:62
msgid "Validate"
msgstr "Validar"

Expand Down
1 change: 1 addition & 0 deletions scielomanager/validator/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


class XMLUploadForm(forms.Form):
add_scielo_br_rules = forms.BooleanField(required=False, initial=True)
file = forms.FileField(label=_("File"))

def clean_file(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ <h2>{% trans "SciELO Style Checker" %}</h2>
{% endfor %}
</div>
{% endwith %}

<div>
<label class="checkbox">
{{ form.add_scielo_br_rules }}
{% blocktrans %}
Also validate against SciELO Brazil's specific rules. <a href="http://docs.scielo.org/projects/scielo-publishing-schema/pt_BR/latest/narr/scielo-brasil.html">Read more.</a>
{% endblocktrans %}
</label>
</div>
<div class='form-buttons clearfix'>
<input type="button" class="btn btn-danger pull-left" id='form_clear_btn' value="{% trans 'Clear' %}" />
<input type="submit" class="btn btn-success pull-right" value="{% trans 'Validate' %}" />
Expand Down
2 changes: 1 addition & 1 deletion scielomanager/validator/tests/doubles.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def make_stub_analyze_xml(type):
else:
raise ValueError('Unknown type value')

def stub__analyze_xml(f):
def stub__analyze_xml(f, extra_schematron=None):
return result, err

return stub__analyze_xml
5 changes: 3 additions & 2 deletions scielomanager/validator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ def err_filter(err):
return err_filter


def analyze_xml(file):
def analyze_xml(file, extra_schematron=None):
"""Analyzes `file` against packtools' XMLValidator.
"""
result = err = None

try:
xml = packtools.XMLValidator.parse(file)
xml = packtools.XMLValidator.parse(file,
extra_schematron=extra_schematron)

except (lxml.etree.XMLSyntaxError, IOError, ValueError,
packtools.exceptions.XMLDoctypeError) as e:
Expand Down
Loading

0 comments on commit 7168780

Please sign in to comment.