Skip to content

Commit

Permalink
Ajustes de acordo com #45
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobatalha committed Jul 12, 2017
1 parent 676d9b7 commit effb9d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions legendarium/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def descriptive_format(title='', short_title='', pubdate='', volume='', number='
template.append(translations['volume'][language]+': %v')

if number:
template.append(translations['number'][language]+': %n')
template.append(translations['issue'][language]+': %n')

if suppl:
if suppl == '0':
Expand Down Expand Up @@ -424,7 +424,7 @@ def descriptive_html_format(title='', short_title='', pubdate='', volume='', num
template.append('<span class="prefix volume">'+translations['volume'][language]+':</span> <span class="value volume">%v</span>')

if number:
template.append('<span class="prefix number">'+translations['number'][language]+':</span> <span class="value number">%n</span>')
template.append('<span class="prefix number">'+translations['issue'][language]+':</span> <span class="value number">%n</span>')

if suppl:
template.append('<span class="prefix supplement">'+translations['supplement'][language]+'</span> <span class="value supplement">%s</span>')
Expand Down Expand Up @@ -478,7 +478,7 @@ def descriptive_short_format(title='', short_title='', pubdate='', volume='', nu
template.append(translations['volume'][language]+': %v')

if number:
template.append(translations['number'][language]+': %n')
template.append(translations['issue'][language]+': %n')

if suppl:
if suppl == '0':
Expand Down Expand Up @@ -537,7 +537,7 @@ def descriptive_html_short_format(title='', short_title='', pubdate='', volume='
template.append('<span class="prefix volume">'+translations['volume'][language]+':</span> <span class="value volume">%v</span>')

if number:
template.append('<span class="prefix number">'+translations['number'][language]+':</span> <span class="value number">%n</span>')
template.append('<span class="prefix number">'+translations['issue'][language]+':</span> <span class="value number">%n</span>')

if suppl:
template.append('<span class="prefix supplement">'+translations['supplement'][language]+'</span> <span class="value supplement">%s</span>')
Expand Down Expand Up @@ -582,7 +582,7 @@ def descriptive_very_short_format(pubdate='', volume='', number='', suppl='', la
template.append(translations['volume'][language]+': %v')

if number:
template.append(translations['number'][language]+': %n')
template.append(translations['issue'][language]+': %n')

if suppl:
if suppl == '0':
Expand Down Expand Up @@ -638,7 +638,7 @@ def descriptive_html_very_short_format(pubdate='', volume='', number='', suppl='
template.append('<span class="prefix volume">'+translations['volume'][language]+':</span> <span class="value volume">%v</span>')

if number:
template.append('<span class="prefix number">'+translations['number'][language]+':</span> <span class="value number">%n</span>')
template.append('<span class="prefix number">'+translations['issue'][language]+':</span> <span class="value number">%n</span>')

if suppl:
template.append('<span class="prefix supplement">'+translations['supplement'][language]+'</span> <span class="value supplement">%s</span>')
Expand Down
8 changes: 4 additions & 4 deletions legendarium/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"es": "Volumen",
"en": "Volume"
},
"number": {
"issue": {
"pt": u"Número",
"es": "Numero",
"en": "Number"
"en": "Issue"
},
"pages": {
"pt": u"Páginas",
"es": "Paginas",
"es": "Páginas",
"en": "Pages"
},
"supplement": {
Expand All @@ -28,7 +28,7 @@
},
"article number": {
"pt": "Número do artigo",
"es": "Numero del articulo",
"es": "Numero del artículo",
"en": "Article number"
},
"published": {
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name='legendarium',
version='1.2.2',
version='1.4.0',
description="Python library to handle SciELO's bibliographic legend",
long_description=readme + '\n\n' + history,
author="Jamil Atta Junior",
Expand Down
20 changes: 10 additions & 10 deletions tests/test_legendarium.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def test_descriptive_format(self):
result = descriptive_format(**self.sample)

self.assertEqual(
'Revista Mal-Estar Subjetivo, Volume: 67, Number: 9 Supplement 3, Article number: e00120416, Published: 2011',
'Revista Mal-Estar Subjetivo, Volume: 67, Issue: 9 Supplement 3, Article number: e00120416, Published: 2011',
result
)

Expand All @@ -309,7 +309,7 @@ def test_descriptive_format_1(self):
result = descriptive_format(**self.sample)

self.assertEqual(
'Revista Mal-Estar Subjetivo, Volume: 67, Number: 9 Supplement 3, Pages: 154-200, Published: 2011',
'Revista Mal-Estar Subjetivo, Volume: 67, Issue: 9 Supplement 3, Pages: 154-200, Published: 2011',
result
)

Expand All @@ -330,7 +330,7 @@ def test_descriptive_format_number_only(self):
result = descriptive_format(**data)

self.assertEqual(
'Cadernos Pagu, Number: 50, Article number: e175002, Published: 2017',
'Cadernos Pagu, Issue: 50, Article number: e175002, Published: 2017',
result

)
Expand All @@ -352,7 +352,7 @@ def test_descriptive_format_suppl_number(self):
result = descriptive_format(**data)

self.assertEqual(
'Revista de Odontologia da Universidade de São Paulo, Volume: 11, Number: 21 Supplement 1, Pages: 121-143, Published: 1997',
'Revista de Odontologia da Universidade de São Paulo, Volume: 11, Issue: 21 Supplement 1, Pages: 121-143, Published: 1997',
result

)
Expand All @@ -374,7 +374,7 @@ def test_descriptive_format_suppl_number_1(self):
result = descriptive_format(**data)

self.assertEqual(
'Revista de Odontologia da Universidade de São Paulo, Volume: 11, Number: 21 Supplement, Pages: 121-143, Published: 1997',
'Revista de Odontologia da Universidade de São Paulo, Volume: 11, Issue: 21 Supplement, Pages: 121-143, Published: 1997',
result

)
Expand Down Expand Up @@ -432,7 +432,7 @@ def test_descriptive_short_format(self):
result = descriptive_short_format(**self.sample)

self.assertEqual(
'Revista Mal-Estar Subjetivo, Volume: 67, Number: 9 Supplement 3, Published: 2011',
'Revista Mal-Estar Subjetivo, Volume: 67, Issue: 9 Supplement 3, Published: 2011',
result
)

Expand All @@ -441,7 +441,7 @@ def test_descriptive_html_format(self):
result = descriptive_html_format(**self.sample)

self.assertEqual(
'<div class="biblio_label"><span class="title">Revista Mal-Estar Subjetivo</span><span class="prefix volume">Volume:</span> <span class="value volume">67</span><span class="prefix number">Number:</span> <span class="value number">9</span><span class="prefix supplement">Supplement</span> <span class="value supplement">3</span><span class="prefix pages">Article number:</span> <span class="value pages">e00120416</span><span class="prefix published">Published:</span> <span class="value published">2011</span></div>',
'<div class="biblio_label"><span class="title">Revista Mal-Estar Subjetivo</span><span class="prefix volume">Volume:</span> <span class="value volume">67</span><span class="prefix number">Issue:</span> <span class="value number">9</span><span class="prefix supplement">Supplement</span> <span class="value supplement">3</span><span class="prefix pages">Article number:</span> <span class="value pages">e00120416</span><span class="prefix published">Published:</span> <span class="value published">2011</span></div>',
result
)

Expand All @@ -454,7 +454,7 @@ def test_descriptive_html_short_format(self):
result = descriptive_html_short_format(**self.sample)

self.assertEqual(
'<div class="biblio_label"><span class="title">Revista Mal-Estar Subjetivo</span><span class="prefix volume">Volume:</span> <span class="value volume">67</span><span class="prefix number">Number:</span> <span class="value number">9</span><span class="prefix supplement">Supplement</span> <span class="value supplement">3</span><span class="prefix published">Published:</span> <span class="value published">2011</span></div>',
'<div class="biblio_label"><span class="title">Revista Mal-Estar Subjetivo</span><span class="prefix volume">Volume:</span> <span class="value volume">67</span><span class="prefix number">Issue:</span> <span class="value number">9</span><span class="prefix supplement">Supplement</span> <span class="value supplement">3</span><span class="prefix published">Published:</span> <span class="value published">2011</span></div>',
result
)

Expand All @@ -469,7 +469,7 @@ def test_descriptive_very_short_format(self):
result = descriptive_very_short_format(**self.sample)

self.assertEqual(
'2011, Volume: 67, Number: 9 Supplement 3',
'2011, Volume: 67, Issue: 9 Supplement 3',
result
)

Expand All @@ -484,7 +484,7 @@ def test_descriptive_html_very_short_format(self):
result = descriptive_html_very_short_format(**self.sample)

self.assertEqual(
'<div class="biblio_label"><span class="year">2011</span><span class="prefix volume">Volume:</span> <span class="value volume">67</span><span class="prefix number">Number:</span> <span class="value number">9</span><span class="prefix supplement">Supplement</span> <span class="value supplement">3</span></div>',
'<div class="biblio_label"><span class="year">2011</span><span class="prefix volume">Volume:</span> <span class="value volume">67</span><span class="prefix number">Issue:</span> <span class="value number">9</span><span class="prefix supplement">Supplement</span> <span class="value supplement">3</span></div>',
result
)

Expand Down

0 comments on commit effb9d1

Please sign in to comment.