diff -Nru pybtex-0.23.0/CHANGES pybtex-0.24.0/CHANGES --- pybtex-0.23.0/CHANGES 2020-10-12 15:23:33.543192000 +0000 +++ pybtex-0.24.0/CHANGES 2021-01-17 19:44:16.152825400 +0000 @@ -1,3 +1,26 @@ +Version 0.24.0 +-------------- +(released on January 17, 2021) + +**This is the last version that supports Python 2. The next version will +require Python 3.6 or above.** + +- Added support for ``sup`` and ``sub`` tags to LaTeX and Markdown backends. + +- Added support for ``@online`` entries and the ``urldate`` field. + +- Restored compatibility with Python 2. + +- Fixed tests on Windows. + +- Fixed bugs in the example plugin. + +- Fixed bad ``get_default_encoding()`` call. + + +Thanks to Matthias Troffaes for his contributions! + + Version 0.23.0 -------------- (released on October 12, 2020) diff -Nru pybtex-0.23.0/debian/changelog pybtex-0.24.0/debian/changelog --- pybtex-0.23.0/debian/changelog 2020-11-03 12:10:16.000000000 +0000 +++ pybtex-0.24.0/debian/changelog 2022-06-12 01:21:54.000000000 +0000 @@ -1,3 +1,17 @@ +pybtex (0.24.0-2) unstable; urgency=medium + + * Team upload. + * New upstream release. + * Rebuild to drop old sphinx from Built-Using field. + * debian/: Apply wrap-and-sort -abst. + * Drop ancient build-dep dpkg-dev. + * debian/control: Bump Standards-Version to 4.6.1. + * debian/control: Bump debhelper compat to v13. + * debian/patches: Refresh patches. + * debian/copyright: Update information. + + -- Boyuan Yang Sat, 11 Jun 2022 21:21:54 -0400 + pybtex (0.23.0-1) unstable; urgency=medium * Team upload. diff -Nru pybtex-0.23.0/debian/control pybtex-0.24.0/debian/control --- pybtex-0.23.0/debian/control 2020-11-03 12:10:16.000000000 +0000 +++ pybtex-0.24.0/debian/control 2022-06-12 01:21:54.000000000 +0000 @@ -1,21 +1,22 @@ Source: pybtex Maintainer: Debian Science Maintainers -Uploaders: Ghislain Antony Vaillant +Uploaders: + Ghislain Antony Vaillant , Section: tex Priority: optional -Build-Depends: debhelper-compat (= 12), - dh-python, - dpkg-dev (>= 1.17.14), - python3-sphinx , - python3-all, - python3-doc , - python3-latexcodec (>= 1.0.4), - python3-pytest , - python3-setuptools, - python3-six, - python3-yaml, - sphinx-common -Standards-Version: 4.5.0 +Build-Depends: + debhelper-compat (= 13), + dh-python, + python3-all, + python3-doc , + python3-latexcodec (>= 1.0.4), + python3-pytest , + python3-setuptools, + python3-six, + python3-sphinx , + python3-yaml, + sphinx-common, +Standards-Version: 4.6.1 Vcs-Browser: https://salsa.debian.org/science-team/pybtex Vcs-Git: https://salsa.debian.org/science-team/pybtex.git Homepage: https://pybtex.org/ @@ -23,9 +24,10 @@ Package: pybtex Architecture: all -Depends: ${misc:Depends}, - ${python3:Depends}, - python3-pybtex (= ${binary:Version}) +Depends: + python3-pybtex (= ${binary:Version}), + ${misc:Depends}, + ${python3:Depends}, Description: BibTeX-compatible bibliography processor Pybtex reads citation information from a file and produces a formatted bibliography. BibTeX style files are supported. Alternatively it is @@ -43,14 +45,18 @@ . This package provides the command-line interface. -Package: python3-pybtex +Package: python-pybtex-doc Architecture: all -Section: python -Depends: ${misc:Depends}, - ${python3:Depends}, - python3-pkg-resources -Suggests: python-pybtex-doc -Description: public modules for pybtex (Python 3) +Multi-Arch: foreign +Section: doc +Depends: + ${misc:Depends}, + ${sphinxdoc:Depends}, +Recommends: + python3-doc, +Built-Using: + ${sphinxdoc:Built-Using}, +Description: documentation for pybtex Pybtex reads citation information from a file and produces a formatted bibliography. BibTeX style files are supported. Alternatively it is possible to write styles in Python. @@ -65,17 +71,19 @@ * HTML * plain text . - This package provides the modules for Python 3. + This package provides the documentation. +Build-Profiles: -Package: python-pybtex-doc +Package: python3-pybtex Architecture: all -Multi-Arch: foreign -Section: doc -Depends: ${misc:Depends}, - ${sphinxdoc:Depends} -Recommends: python3-doc -Built-Using: ${sphinxdoc:Built-Using} -Description: documentation for pybtex +Section: python +Depends: + python3-pkg-resources, + ${misc:Depends}, + ${python3:Depends}, +Suggests: + python-pybtex-doc , +Description: public modules for pybtex (Python 3) Pybtex reads citation information from a file and produces a formatted bibliography. BibTeX style files are supported. Alternatively it is possible to write styles in Python. @@ -90,5 +98,4 @@ * HTML * plain text . - This package provides the documentation. -Build-Profiles: + This package provides the modules for Python 3. diff -Nru pybtex-0.23.0/debian/copyright pybtex-0.24.0/debian/copyright --- pybtex-0.23.0/debian/copyright 2020-11-03 12:10:16.000000000 +0000 +++ pybtex-0.24.0/debian/copyright 2022-06-12 01:21:54.000000000 +0000 @@ -4,7 +4,7 @@ Source: https://pypi.org/project/pybtex/ Files: * -Copyright: 2006-2019 Andrey Golovizin +Copyright: 2006-2021 Andrey Golovizin 2014-2015 Matthias C. M. Troffaes 2015 Jorrit Wronski 2016 Hong Xu diff -Nru pybtex-0.23.0/debian/patches/Use-local-intersphinx-inventory.patch pybtex-0.24.0/debian/patches/Use-local-intersphinx-inventory.patch --- pybtex-0.23.0/debian/patches/Use-local-intersphinx-inventory.patch 2020-11-03 12:10:16.000000000 +0000 +++ pybtex-0.24.0/debian/patches/Use-local-intersphinx-inventory.patch 2022-06-12 01:21:54.000000000 +0000 @@ -9,7 +9,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py -index 40b7bfc..3edcb2f 100644 +index e2133e0..d250978 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -42,7 +42,7 @@ extensions = [ diff -Nru pybtex-0.23.0/debian/tests/control pybtex-0.24.0/debian/tests/control --- pybtex-0.23.0/debian/tests/control 2020-11-03 12:10:16.000000000 +0000 +++ pybtex-0.24.0/debian/tests/control 2022-06-12 01:21:54.000000000 +0000 @@ -5,7 +5,8 @@ ; echo "Testing with $py:" ; $py -m pytest -v ; done -Depends: python3-all, - python3-pybtex, - python3-pytest +Depends: + python3-all, + python3-pybtex, + python3-pytest, Restrictions: allow-stderr diff -Nru pybtex-0.23.0/docs/man1/pybtex.1 pybtex-0.24.0/docs/man1/pybtex.1 --- pybtex-0.23.0/docs/man1/pybtex.1 2020-10-12 15:36:28.944637000 +0000 +++ pybtex-0.24.0/docs/man1/pybtex.1 2021-01-17 19:47:07.457768200 +0000 @@ -1,10 +1,10 @@ .\"Man page for Pybtex (pybtex) .\" -.\" Generation time: 2020-10-12 15:36:28 +0000 +.\" Generation time: 2021-01-17 19:47:07 +0000 .\" Large parts of this file are autogenerated from the output of .\" "pybtex --help" .\" -.TH pybtex 1 "2020-10-12" "0.23.0" "Pybtex" +.TH pybtex 1 "2021-01-17" "0.24.0" "Pybtex" .SH "NAME" pybtex - BibTeX-compatible bibliography processor in Python diff -Nru pybtex-0.23.0/docs/man1/pybtex-convert.1 pybtex-0.24.0/docs/man1/pybtex-convert.1 --- pybtex-0.23.0/docs/man1/pybtex-convert.1 2020-10-12 15:36:28.945637000 +0000 +++ pybtex-0.24.0/docs/man1/pybtex-convert.1 2021-01-17 19:47:07.457768200 +0000 @@ -1,10 +1,10 @@ .\"Man page for Pybtex (pybtex-convert) .\" -.\" Generation time: 2020-10-12 15:36:28 +0000 +.\" Generation time: 2021-01-17 19:47:07 +0000 .\" Large parts of this file are autogenerated from the output of .\" "pybtex-convert --help" .\" -.TH pybtex-convert 1 "2020-10-12" "0.23.0" "Pybtex" +.TH pybtex-convert 1 "2021-01-17" "0.24.0" "Pybtex" .SH "NAME" pybtex-convert - convert between bibliography database formats diff -Nru pybtex-0.23.0/docs/man1/pybtex-format.1 pybtex-0.24.0/docs/man1/pybtex-format.1 --- pybtex-0.23.0/docs/man1/pybtex-format.1 2020-10-12 15:36:28.945637000 +0000 +++ pybtex-0.24.0/docs/man1/pybtex-format.1 2021-01-17 19:47:07.458768100 +0000 @@ -1,10 +1,10 @@ .\"Man page for Pybtex (pybtex-format) .\" -.\" Generation time: 2020-10-12 15:36:28 +0000 +.\" Generation time: 2021-01-17 19:47:07 +0000 .\" Large parts of this file are autogenerated from the output of .\" "pybtex-format --help" .\" -.TH pybtex-format 1 "2020-10-12" "0.23.0" "Pybtex" +.TH pybtex-format 1 "2021-01-17" "0.24.0" "Pybtex" .SH "NAME" pybtex-format - format bibliography database as human-readable text diff -Nru pybtex-0.23.0/docs/pybtex_doctools/__init__.py pybtex-0.24.0/docs/pybtex_doctools/__init__.py --- pybtex-0.23.0/docs/pybtex_doctools/__init__.py 2020-10-12 15:15:57.849808200 +0000 +++ pybtex-0.24.0/docs/pybtex_doctools/__init__.py 2021-01-17 19:26:34.576612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/docs/pybtex_doctools/man.py pybtex-0.24.0/docs/pybtex_doctools/man.py --- pybtex-0.23.0/docs/pybtex_doctools/man.py 2020-10-12 15:15:57.849808200 +0000 +++ pybtex-0.24.0/docs/pybtex_doctools/man.py 2021-01-17 19:26:34.577612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/docs/pybtex_doctools/pygments.py pybtex-0.24.0/docs/pybtex_doctools/pygments.py --- pybtex-0.23.0/docs/pybtex_doctools/pygments.py 2020-10-12 15:15:57.850808100 +0000 +++ pybtex-0.24.0/docs/pybtex_doctools/pygments.py 2021-01-17 19:26:34.576612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/docs/source/conf.py pybtex-0.24.0/docs/source/conf.py --- pybtex-0.23.0/docs/source/conf.py 2020-10-12 15:23:33.544191800 +0000 +++ pybtex-0.24.0/docs/source/conf.py 2021-01-17 19:27:27.733966800 +0000 @@ -63,7 +63,7 @@ # General information about the project. project = u"Pybtex User’s Guide" -copyright = u'2019, Andrey Golovizin' +copyright = u'2021, Andrey Golovizin' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff -Nru pybtex-0.23.0/examples/sample_plugins/toyplugins.py pybtex-0.24.0/examples/sample_plugins/toyplugins.py --- pybtex-0.23.0/examples/sample_plugins/toyplugins.py 2020-10-12 15:15:57.857808000 +0000 +++ pybtex-0.24.0/examples/sample_plugins/toyplugins.py 2021-01-17 19:26:34.563612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -23,9 +23,7 @@ """Sample Pybtex plugins.""" -import imp - -from pybtex.database import BibliographyData, Entry, FieldDict, Person +from pybtex.database import BibliographyData, Entry, Person from pybtex.database.input import BaseParser from pybtex.database.output import BaseWriter from pybtex.utils import OrderedCaseInsensitiveDict @@ -35,7 +33,7 @@ """Bibliography output plugin which formats the data as Python code.""" def write_stream(self, bib_data, stream): - print >>stream, repr(bib_data) + print(repr(bib_data), file=stream) class PythonParser(BaseParser): @@ -47,7 +45,6 @@ 'OrderedCaseInsensitiveDict': OrderedCaseInsensitiveDict, 'Entry': Entry, 'Person': Person, - 'FieldDict': FieldDict, } code = stream.read() self.data = eval(code, context) diff -Nru pybtex-0.23.0/PKG-INFO pybtex-0.24.0/PKG-INFO --- pybtex-0.23.0/PKG-INFO 2020-10-12 15:36:32.162597400 +0000 +++ pybtex-0.24.0/PKG-INFO 2021-01-17 19:47:11.959714000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pybtex -Version: 0.23.0 +Version: 0.24.0 Summary: A BibTeX-compatible bibliography processor in Python Home-page: https://pybtex.org/ Author: Andrey Golovizin diff -Nru pybtex-0.23.0/pybtex/auxfile.py pybtex-0.24.0/pybtex/auxfile.py --- pybtex-0.23.0/pybtex/auxfile.py 2020-10-12 15:15:57.874807800 +0000 +++ pybtex-0.24.0/pybtex/auxfile.py 2021-01-17 19:26:34.556612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/backends/html.py pybtex-0.24.0/pybtex/backends/html.py --- pybtex-0.23.0/pybtex/backends/html.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/backends/html.py 2021-01-17 19:26:34.556612300 +0000 @@ -1,6 +1,6 @@ # vim: fileencoding=utf-8 -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/backends/__init__.py pybtex-0.24.0/pybtex/backends/__init__.py --- pybtex-0.23.0/pybtex/backends/__init__.py 2020-10-12 15:15:57.874807800 +0000 +++ pybtex-0.24.0/pybtex/backends/__init__.py 2021-01-17 19:26:34.557612200 +0000 @@ -1,5 +1,5 @@ from __future__ import unicode_literals -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/backends/latex.py pybtex-0.24.0/pybtex/backends/latex.py --- pybtex-0.23.0/pybtex/backends/latex.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/backends/latex.py 2021-01-17 19:26:34.559612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -35,6 +35,8 @@ \\href{/}{Non-empty} >>> print(HRef('http://example.org/', 'http://example.org/').render(latex)) \\url{http://example.org/} +>>> print(Tag('sup', 'hello').render(latex)) +\\textsuperscript{hello} """ from __future__ import unicode_literals @@ -56,7 +58,9 @@ u'strong': None, u'i': u'textit', u'b': u'textbf', - u'tt': u'texttt' + u'tt': u'texttt', + u'sup': u'textsuperscript', + u'sub': u'textsubscript', } def __init__(self, encoding=None): diff -Nru pybtex-0.23.0/pybtex/backends/markdown.py pybtex-0.24.0/pybtex/backends/markdown.py --- pybtex-0.23.0/pybtex/backends/markdown.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/backends/markdown.py 2021-01-17 19:26:34.558612000 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf8 -*- # -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # Copyright (c) 2014 Jorrit Wronski # # Permission is hereby granted, free of charge, to any person obtaining @@ -32,6 +32,8 @@ >>> print(Tag('em', 'Non-', 'empty').render(markdown)) *Non\-empty* +>>> print(Tag('sup', 'super', 'man').render(markdown)) +superman >>> print(HRef('/', '').render(markdown)) >>> print(HRef('/', 'Non-', 'empty').render(markdown)) @@ -105,8 +107,8 @@ def format_tag(self, tag_name, text): tag = self.tags.get(tag_name) - if tag is None: - return text + if tag is None: # fall back on html tags + return r'<{0}>{1}'.format(tag_name, text) if text else u'' else: return r'{0}{1}{0}'.format(tag, text) if text else u'' diff -Nru pybtex-0.23.0/pybtex/backends/plaintext.py pybtex-0.24.0/pybtex/backends/plaintext.py --- pybtex-0.23.0/pybtex/backends/plaintext.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/backends/plaintext.py 2021-01-17 19:26:34.559612300 +0000 @@ -3,7 +3,7 @@ from pybtex.backends import BaseBackend -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/bibtex/bst.py pybtex-0.24.0/pybtex/bibtex/bst.py --- pybtex-0.23.0/pybtex/bibtex/bst.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/bibtex/bst.py 2021-01-17 19:26:34.560612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/bibtex/builtins.py pybtex-0.24.0/pybtex/bibtex/builtins.py --- pybtex-0.23.0/pybtex/bibtex/builtins.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/bibtex/builtins.py 2021-01-17 19:26:34.567612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/bibtex/exceptions.py pybtex-0.24.0/pybtex/bibtex/exceptions.py --- pybtex-0.23.0/pybtex/bibtex/exceptions.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/bibtex/exceptions.py 2021-01-17 19:26:34.561612100 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/bibtex/__init__.py pybtex-0.24.0/pybtex/bibtex/__init__.py --- pybtex-0.23.0/pybtex/bibtex/__init__.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/bibtex/__init__.py 2021-01-17 19:26:34.561612100 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including diff -Nru pybtex-0.23.0/pybtex/bibtex/interpreter.py pybtex-0.24.0/pybtex/bibtex/interpreter.py --- pybtex-0.23.0/pybtex/bibtex/interpreter.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/bibtex/interpreter.py 2021-01-17 19:26:34.569612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/bibtex/names.py pybtex-0.24.0/pybtex/bibtex/names.py --- pybtex-0.23.0/pybtex/bibtex/names.py 2020-10-12 15:15:57.875807800 +0000 +++ pybtex-0.24.0/pybtex/bibtex/names.py 2021-01-17 19:26:34.560612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/bibtex/runner.py pybtex-0.24.0/pybtex/bibtex/runner.py --- pybtex-0.23.0/pybtex/bibtex/runner.py 2020-10-12 15:23:33.545192000 +0000 +++ pybtex-0.24.0/pybtex/bibtex/runner.py 2021-01-17 19:26:34.568612000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/bibtex/utils.py pybtex-0.24.0/pybtex/bibtex/utils.py --- pybtex-0.23.0/pybtex/bibtex/utils.py 2020-10-12 15:18:57.128599000 +0000 +++ pybtex-0.24.0/pybtex/bibtex/utils.py 2021-01-17 19:26:34.559612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/charwidths/make_charwidths.py pybtex-0.24.0/pybtex/charwidths/make_charwidths.py --- pybtex-0.23.0/pybtex/charwidths/make_charwidths.py 2020-10-12 15:15:57.876807700 +0000 +++ pybtex-0.24.0/pybtex/charwidths/make_charwidths.py 2021-01-17 19:26:34.558612000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/cmdline.py pybtex-0.24.0/pybtex/cmdline.py --- pybtex-0.23.0/pybtex/cmdline.py 2020-10-12 15:15:57.876807700 +0000 +++ pybtex-0.24.0/pybtex/cmdline.py 2021-01-17 19:26:34.561612100 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/convert/__init__.py pybtex-0.24.0/pybtex/database/convert/__init__.py --- pybtex-0.23.0/pybtex/database/convert/__init__.py 2020-10-12 15:15:57.877807900 +0000 +++ pybtex-0.24.0/pybtex/database/convert/__init__.py 2021-01-17 19:26:34.553612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/convert/__main__.py pybtex-0.24.0/pybtex/database/convert/__main__.py --- pybtex-0.23.0/pybtex/database/convert/__main__.py 2020-10-12 15:15:57.877807900 +0000 +++ pybtex-0.24.0/pybtex/database/convert/__main__.py 2021-01-17 19:26:34.554612200 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/format/__init__.py pybtex-0.24.0/pybtex/database/format/__init__.py --- pybtex-0.23.0/pybtex/database/format/__init__.py 2020-10-12 15:15:57.877807900 +0000 +++ pybtex-0.24.0/pybtex/database/format/__init__.py 2021-01-17 19:26:34.554612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/format/__main__.py pybtex-0.24.0/pybtex/database/format/__main__.py --- pybtex-0.23.0/pybtex/database/format/__main__.py 2020-10-12 15:15:57.877807900 +0000 +++ pybtex-0.24.0/pybtex/database/format/__main__.py 2021-01-17 19:26:34.555612300 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/__init__.py pybtex-0.24.0/pybtex/database/__init__.py --- pybtex-0.23.0/pybtex/database/__init__.py 2020-10-12 15:23:33.545192000 +0000 +++ pybtex-0.24.0/pybtex/database/__init__.py 2021-01-17 19:26:34.551612400 +0000 @@ -1,5 +1,5 @@ # vim: fileencoding=utf-8 -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -44,6 +44,13 @@ from pybtex.plugin import find_plugin +# for python2 compatibility +def indent(text, prefix): + if hasattr(textwrap, "indent"): + return textwrap.indent(text, prefix) + else: + return ''.join(prefix + line for line in text.splitlines(True)) + class BibliographyDataError(PybtexError): pass @@ -116,13 +123,13 @@ ind = repr_entry.index(key) - 2 # find first instance repr_entry = repr_entry[:ind] + "\n" + repr_entry[ind:] - repr_entry = textwrap.indent(repr_entry, prefix=" ") + repr_entry = indent(repr_entry, prefix=" ") repr_entry = repr_entry[4:] # drop 1st indent return ( "BibliographyData(\n" - f" entries={repr_entry},\n\n" - f" preamble={repr(self._preamble)})" + " entries={0},\n\n" + " preamble={1})".format(repr_entry, repr(self._preamble)) ) def add_to_preamble(self, *values): @@ -448,13 +455,13 @@ ind = repr_fields.index(key) - 2 # find first instance repr_fields = repr_fields[:ind] + "\n" + repr_fields[ind:] - repr_fields = textwrap.indent(repr_fields, prefix=" ") + repr_fields = indent(repr_fields, prefix=" ") repr_fields = repr_fields[4:] # drop 1st indent return ( - f"Entry({repr(self.type)},\n" - f" fields={repr_fields},\n" - f" persons={repr(self.persons)})" + "Entry({0},\n" + " fields={1},\n" + " persons={2})".format(repr(self.type), repr_fields, repr(self.persons)) ) def add_person(self, person, role): diff -Nru pybtex-0.23.0/pybtex/database/input/bibtexml.py pybtex-0.24.0/pybtex/database/input/bibtexml.py --- pybtex-0.23.0/pybtex/database/input/bibtexml.py 2020-10-12 15:23:33.546192000 +0000 +++ pybtex-0.24.0/pybtex/database/input/bibtexml.py 2021-01-17 19:26:34.552612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/input/bibtex.py pybtex-0.24.0/pybtex/database/input/bibtex.py --- pybtex-0.23.0/pybtex/database/input/bibtex.py 2020-10-12 15:23:33.546192000 +0000 +++ pybtex-0.24.0/pybtex/database/input/bibtex.py 2021-01-17 19:26:34.553612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/input/bibyaml.py pybtex-0.24.0/pybtex/database/input/bibyaml.py --- pybtex-0.23.0/pybtex/database/input/bibyaml.py 2020-10-12 15:15:57.877807900 +0000 +++ pybtex-0.24.0/pybtex/database/input/bibyaml.py 2021-01-17 19:26:34.552612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/input/__init__.py pybtex-0.24.0/pybtex/database/input/__init__.py --- pybtex-0.23.0/pybtex/database/input/__init__.py 2020-10-12 15:15:57.877807900 +0000 +++ pybtex-0.24.0/pybtex/database/input/__init__.py 2021-01-17 19:26:34.553612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/output/bibtexml.py pybtex-0.24.0/pybtex/database/output/bibtexml.py --- pybtex-0.23.0/pybtex/database/output/bibtexml.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/database/output/bibtexml.py 2021-01-17 19:26:34.567612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/output/bibtex.py pybtex-0.24.0/pybtex/database/output/bibtex.py --- pybtex-0.23.0/pybtex/database/output/bibtex.py 2020-10-12 15:23:33.546192000 +0000 +++ pybtex-0.24.0/pybtex/database/output/bibtex.py 2021-01-17 19:26:34.568612000 +0000 @@ -1,6 +1,6 @@ # vim: fileencoding=utf-8 -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/output/bibyaml.py pybtex-0.24.0/pybtex/database/output/bibyaml.py --- pybtex-0.23.0/pybtex/database/output/bibyaml.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/database/output/bibyaml.py 2021-01-17 19:26:34.561612100 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/database/output/__init__.py pybtex-0.24.0/pybtex/database/output/__init__.py --- pybtex-0.23.0/pybtex/database/output/__init__.py 2020-10-12 15:15:57.877807900 +0000 +++ pybtex-0.24.0/pybtex/database/output/__init__.py 2021-01-17 19:26:34.563612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/errors.py pybtex-0.24.0/pybtex/errors.py --- pybtex-0.23.0/pybtex/errors.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/errors.py 2021-01-17 19:26:34.555612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/exceptions.py pybtex-0.24.0/pybtex/exceptions.py --- pybtex-0.23.0/pybtex/exceptions.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/exceptions.py 2021-01-17 19:26:34.551612400 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/__init__.py pybtex-0.24.0/pybtex/__init__.py --- pybtex-0.23.0/pybtex/__init__.py 2020-10-12 15:35:57.011030200 +0000 +++ pybtex-0.24.0/pybtex/__init__.py 2021-01-17 19:46:01.562559400 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -27,7 +27,7 @@ from os import path -__version__ = '0.23.0' +__version__ = '0.24.0' class Engine(object): diff -Nru pybtex-0.23.0/pybtex/io.py pybtex-0.24.0/pybtex/io.py --- pybtex-0.23.0/pybtex/io.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/io.py 2021-01-17 19:26:34.553612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -25,8 +25,9 @@ from __future__ import absolute_import, unicode_literals import io +import posixpath import sys -from os import environ, path +from os import environ from pybtex.exceptions import PybtexError from pybtex.kpathsea import kpsewhich @@ -44,12 +45,12 @@ def _decode_filename(filename, errors='strict'): """Decode byte-encoded filename.""" - encoding = sys.getfilesystemencoding() or self.get_default_encoding() + encoding = sys.getfilesystemencoding() or get_default_encoding() return filename.decode(encoding, errors=errors) def _open_existing(opener, filename, mode, locate, **kwargs): - if not path.isfile(filename): + if not posixpath.isfile(filename): found = locate(filename) if found: filename = found @@ -61,7 +62,7 @@ return opener(filename, mode, **kwargs) except EnvironmentError as error: if 'TEXMFOUTPUT' in environ: - new_filename = path.join(environ['TEXMFOUTPUT'], filename) + new_filename = posixpath.join(environ['TEXMFOUTPUT'], filename) try: return opener(new_filename, mode, **kwargs) except EnvironmentError: diff -Nru pybtex-0.23.0/pybtex/kpathsea.py pybtex-0.24.0/pybtex/kpathsea.py --- pybtex-0.23.0/pybtex/kpathsea.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/kpathsea.py 2021-01-17 19:26:34.561612100 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/__main__.py pybtex-0.24.0/pybtex/__main__.py --- pybtex-0.23.0/pybtex/__main__.py 2020-10-12 15:15:57.874807800 +0000 +++ pybtex-0.24.0/pybtex/__main__.py 2021-01-17 19:26:34.551612400 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/markup/__init__.py pybtex-0.24.0/pybtex/markup/__init__.py --- pybtex-0.23.0/pybtex/markup/__init__.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/markup/__init__.py 2021-01-17 19:26:34.552612300 +0000 @@ -1,5 +1,5 @@ from __future__ import unicode_literals -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/plugin/__init__.py pybtex-0.24.0/pybtex/plugin/__init__.py --- pybtex-0.23.0/pybtex/plugin/__init__.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/plugin/__init__.py 2021-01-17 19:26:34.559612300 +0000 @@ -1,5 +1,5 @@ from __future__ import unicode_literals -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # Copyright (c) 2014 Matthias C. M. Troffaes # # Permission is hereby granted, free of charge, to any person obtaining diff -Nru pybtex-0.23.0/pybtex/py3compat.py pybtex-0.24.0/pybtex/py3compat.py --- pybtex-0.23.0/pybtex/py3compat.py 2020-10-12 15:15:57.878807800 +0000 +++ pybtex-0.24.0/pybtex/py3compat.py 2021-01-17 19:26:34.559612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/richtext.py pybtex-0.24.0/pybtex/richtext.py --- pybtex-0.23.0/pybtex/richtext.py 2020-10-12 15:15:57.879807700 +0000 +++ pybtex-0.24.0/pybtex/richtext.py 2021-01-17 19:26:34.555612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/scanner.py pybtex-0.24.0/pybtex/scanner.py --- pybtex-0.23.0/pybtex/scanner.py 2020-10-12 15:15:57.879807700 +0000 +++ pybtex-0.24.0/pybtex/scanner.py 2021-01-17 19:26:34.554612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/formatting/alpha.py pybtex-0.24.0/pybtex/style/formatting/alpha.py --- pybtex-0.23.0/pybtex/style/formatting/alpha.py 2020-10-12 15:15:57.879807700 +0000 +++ pybtex-0.24.0/pybtex/style/formatting/alpha.py 2021-01-17 19:26:34.556612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/formatting/__init__.py pybtex-0.24.0/pybtex/style/formatting/__init__.py --- pybtex-0.23.0/pybtex/style/formatting/__init__.py 2020-10-12 15:15:57.879807700 +0000 +++ pybtex-0.24.0/pybtex/style/formatting/__init__.py 2021-01-17 19:26:34.559612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/formatting/plain.py pybtex-0.24.0/pybtex/style/formatting/plain.py --- pybtex-0.23.0/pybtex/style/formatting/plain.py 2020-10-12 15:15:57.879807700 +0000 +++ pybtex-0.24.0/pybtex/style/formatting/plain.py 2021-01-17 19:26:34.560612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/formatting/unsrtalpha.py pybtex-0.24.0/pybtex/style/formatting/unsrtalpha.py --- pybtex-0.23.0/pybtex/style/formatting/unsrtalpha.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/formatting/unsrtalpha.py 2021-01-17 19:26:34.557612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/formatting/unsrt.py pybtex-0.24.0/pybtex/style/formatting/unsrt.py --- pybtex-0.23.0/pybtex/style/formatting/unsrt.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/formatting/unsrt.py 2021-01-17 19:26:34.557612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -328,6 +328,9 @@ ] return template + def get_online_template(self, e): + return self.get_misc_template(e) + def get_phdthesis_template(self, e): template = toplevel [ sentence [self.format_names('author')], @@ -410,7 +413,8 @@ def format_web_refs(self, e): # based on urlbst output.web.refs return sentence [ - optional [ self.format_url(e) ], + optional [ self.format_url(e), + optional [ ' (visited on ', field('urldate'), ')' ] ], optional [ self.format_eprint(e) ], optional [ self.format_pubmed(e) ], optional [ self.format_doi(e) ], diff -Nru pybtex-0.23.0/pybtex/style/__init__.py pybtex-0.24.0/pybtex/style/__init__.py --- pybtex-0.23.0/pybtex/style/__init__.py 2020-10-12 15:15:57.879807700 +0000 +++ pybtex-0.24.0/pybtex/style/__init__.py 2021-01-17 19:26:34.558612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/labels/alpha.py pybtex-0.24.0/pybtex/style/labels/alpha.py --- pybtex-0.23.0/pybtex/style/labels/alpha.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/labels/alpha.py 2021-01-17 19:26:34.553612200 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/labels/__init__.py pybtex-0.24.0/pybtex/style/labels/__init__.py --- pybtex-0.23.0/pybtex/style/labels/__init__.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/labels/__init__.py 2021-01-17 19:26:34.552612300 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/labels/number.py pybtex-0.24.0/pybtex/style/labels/number.py --- pybtex-0.23.0/pybtex/style/labels/number.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/labels/number.py 2021-01-17 19:26:34.552612300 +0000 @@ -4,7 +4,7 @@ from pybtex.style.labels import BaseLabelStyle -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/names/__init__.py pybtex-0.24.0/pybtex/style/names/__init__.py --- pybtex-0.23.0/pybtex/style/names/__init__.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/names/__init__.py 2021-01-17 19:26:34.561612100 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/names/lastfirst.py pybtex-0.24.0/pybtex/style/names/lastfirst.py --- pybtex-0.23.0/pybtex/style/names/lastfirst.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/names/lastfirst.py 2021-01-17 19:26:34.562612000 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/names/plain.py pybtex-0.24.0/pybtex/style/names/plain.py --- pybtex-0.23.0/pybtex/style/names/plain.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/names/plain.py 2021-01-17 19:26:34.562612000 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/sorting/author_year_title.py pybtex-0.24.0/pybtex/style/sorting/author_year_title.py --- pybtex-0.23.0/pybtex/style/sorting/author_year_title.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/sorting/author_year_title.py 2021-01-17 19:26:34.558612000 +0000 @@ -3,7 +3,7 @@ from pybtex.style.sorting import BaseSortingStyle -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/sorting/__init__.py pybtex-0.24.0/pybtex/style/sorting/__init__.py --- pybtex-0.23.0/pybtex/style/sorting/__init__.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/sorting/__init__.py 2021-01-17 19:26:34.556612300 +0000 @@ -1,5 +1,5 @@ from __future__ import unicode_literals -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/sorting/none.py pybtex-0.24.0/pybtex/style/sorting/none.py --- pybtex-0.23.0/pybtex/style/sorting/none.py 2020-10-12 15:15:57.880807600 +0000 +++ pybtex-0.24.0/pybtex/style/sorting/none.py 2021-01-17 19:26:34.558612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/style/template.py pybtex-0.24.0/pybtex/style/template.py --- pybtex-0.23.0/pybtex/style/template.py 2020-10-12 15:15:57.881807800 +0000 +++ pybtex-0.24.0/pybtex/style/template.py 2021-01-17 19:26:34.554612200 +0000 @@ -1,6 +1,6 @@ # vim:fileencoding=utf8 -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/textutils.py pybtex-0.24.0/pybtex/textutils.py --- pybtex-0.23.0/pybtex/textutils.py 2020-10-12 15:15:57.881807800 +0000 +++ pybtex-0.24.0/pybtex/textutils.py 2021-01-17 19:26:34.550612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/utils.py pybtex-0.24.0/pybtex/utils.py --- pybtex-0.23.0/pybtex/utils.py 2020-10-12 15:18:57.126598800 +0000 +++ pybtex-0.24.0/pybtex/utils.py 2021-01-17 19:26:34.550612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/pybtex/__version__.py pybtex-0.24.0/pybtex/__version__.py --- pybtex-0.23.0/pybtex/__version__.py 2020-10-12 15:15:57.874807800 +0000 +++ pybtex-0.24.0/pybtex/__version__.py 2021-01-17 19:26:34.548612400 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/setup.py pybtex-0.24.0/setup.py --- pybtex-0.23.0/setup.py 2020-10-12 15:15:57.882807700 +0000 +++ pybtex-0.24.0/setup.py 2021-01-17 19:26:34.521612600 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (C) 2006-2019 Andrey Golovizin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/tests/backend_test.py pybtex-0.24.0/tests/backend_test.py --- pybtex-0.23.0/tests/backend_test.py 1970-01-01 00:00:00.000000000 +0000 +++ pybtex-0.24.0/tests/backend_test.py 2021-01-17 19:26:34.550612200 +0000 @@ -0,0 +1,315 @@ +# Copyright (c) 2006-2021 Andrey Golovizin +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +import pytest + +from pybtex.database import parse_string +from pybtex.backends.html import Backend as HtmlBackend +from pybtex.style.formatting.unsrt import Style as UnsrtStyle + +article_bib = """ +@article{article, + author = {Peter Adams}, + title = {The title of the work}, + journal = {The name of the journal}, + year = 1993, + number = 2, + pages = {201-213}, + month = 7, + note = {An optional note}, + volume = 4 +} +""" + +article_html = """ +Peter Adams. +The title of the work. +The name of the journal, 4(2):201–213, 7 1993. +An optional note. +""" + +book_bib = """@book{book, + author = {Peter Babington}, + title = {The title of the work}, + publisher = {The name of the publisher}, + year = 1993, + volume = 4, + series = 10, + address = {The address}, + edition = {3rd}, + month = 7, + note = {An optional note}, + isbn = {3257227892} +} +""" + +book_html = """ +Peter Babington. +The title of the work. +Volume 4 of 10. +The name of the publisher, The address, 3rd edition, 7 1993. +ISBN 3257227892. +An optional note. +""" + +booklet_bib = """ +@booklet{booklet, + title = {The title of the work}, + author = {Peter Caxton}, + howpublished = {How it was published}, + address = {The address of the publisher}, + month = jul, + year = 1993, + note = {An optional note} +} +""" + +booklet_html = """ +Peter Caxton. +The title of the work. +How it was published, The address of the publisher, July 1993, An optional note. +""" + +inbook_bib = """ +@inbook{inbook, + author = {Peter Eston}, + title = {The title of the work}, + chapter = 8, + pages = {201-213}, + publisher = {The name of the publisher}, + year = 1993, + volume = 4, + series = {The name of the series}, + address = {The address of the publisher}, + edition = {3rd}, + month = 7, + note = {An optional note} +} +""" + +inbook_html = """ +Peter Eston. +The title of the work, chapter 8, pages 201–213. +Volume 4 of The name of the series. +The name of the publisher, The address of the publisher, 3rd edition, 7 1993, An optional note. +""" + +incollection_bib = """ +@incollection{incollection, + author = {Peter Farindon}, + title = {The title of the work}, + booktitle = {The title of the book}, + publisher = {The name of the publisher}, + year = 1993, + editor = {The editor}, + volume = 4, + series = {The name of the series}, + chapter = 8, + pages = {201-213}, + address = {The address of the publisher}, + edition = {3rd}, + month = aug, + note = {An optional note} +} +""" + +incollection_html = """ +Peter Farindon. +The title of the work. +In The editor, editor, The title of the book, volume 4 of The name of the series, chapter 8, pages 201–213. +The name of the publisher, The address of the publisher, 3rd edition, August 1993. +""" + +manual_bib = """ +@manual{manual, + title = {The title of the work}, + author = {Peter Gainsford}, + organization = {The organization}, + address = {The address of the publisher}, + edition = {3rd}, + month = jan, + year = 1993, + note = {An optional note} +} +""" + +manual_html = """ +Peter Gainsford. +The title of the work. +The organization, The address of the publisher, 3rd edition, January 1993. +An optional note. +""" + +masterthesis_bib = """ +@mastersthesis{mastersthesis, + author = {Peter Harwood}, + title = {The title of the work}, + school = {The school of the thesis}, + year = 1993, + address = {The address of the publisher}, + month = feb, + note = {An optional note} +} +""" + +masterthesis_html = """ +Peter Harwood. +The title of the work. +Master's thesis, The school of the thesis, The address of the publisher, February 1993. +An optional note. +""" + +misc_bib = """ +@misc{misc, + author = {Peter Isley}, + title = {The title of the work}, + howpublished = {How it was published}, + month = oct, + year = 1993, + note = {An optional note} +} +""" + +misc_html = """ +Peter Isley. +The title of the work. +How it was published, October 1993. +An optional note. +""" + +phdthesis_bib = """ +@phdthesis{phdthesis, + author = {Peter Joslin}, + title = {The title of the work}, + school = {The school of the thesis}, + year = 1993, + address = {The address of the publisher}, + month = dec, + note = {An optional note} +} +""" + +phdthesis_html = """ +Peter Joslin. +The title of the work. +PhD thesis, The school of the thesis, The address of the publisher, December 1993. +An optional note. +""" + +proceedings_bib = """ +@proceedings{proceedings, + title = {The title of the work}, + year = 1993, + editor = {Peter Kidwelly}, + volume = 4, + series = 5, + address = {The address of the publisher}, + month = oct, + organization = {The organization}, + publisher = {The name of the publisher}, + note = {An optional note} +} +""" + +proceedings_html = """ +Peter Kidwelly, editor. +The title of the work, volume 4 of 5, The address of the publisher, October 1993. The organization, The name of the publisher. +An optional note. +""" + +techreport_bib = """ +@techreport{techreport, + author = {Peter Lambert}, + title = {The title of the work}, + institution = {The institution that published}, + year = 1993, + number = 2, + address = {The address of the publisher}, + month = nov, + note = {An optional note} +} +""" + +techreport_html = """ +Peter Lambert. +The title of the work. +Technical Report 2, The institution that published, The address of the publisher, November 1993. +An optional note. +""" + +unpublished_bib = """ +@unpublished{unpublished, + author = {Peter Marcheford}, + title = {The title of the work}, + note = {An optional note}, + month = mar, + year = 1993 +} +""" + +unpublished_html = """ +Peter Marcheford. +The title of the work. +An optional note, March 1993. +""" + +online_bib = """ +@online{online, + author = {Peter Nash}, + title = {The title of the work}, + year = 1993, + url = {http://www.google.com/}, + urldate = {1993-03-07}, +} +""" + +online_html = """ +Peter Nash. +The title of the work. +1993. +URL: http://www.google.com/ (visited on 1993-03-07). +""" + + +@pytest.mark.parametrize("bib,html", [ + (article_bib, article_html), + (book_bib, book_html), + (booklet_bib, booklet_html), + (inbook_bib, inbook_html), + (incollection_bib, incollection_html), + (manual_bib, manual_html), + (masterthesis_bib, masterthesis_html), + (misc_bib, misc_html), + (online_bib, online_html), + (phdthesis_bib, phdthesis_html), + (proceedings_bib, proceedings_html), + (techreport_bib, techreport_html), + (unpublished_bib, unpublished_html), +]) +def test_backend_html(bib, html): + style = UnsrtStyle() + backend = HtmlBackend() + bib_data = parse_string(bib, 'bibtex') + for formatted_entry in style.format_entries(bib_data.entries.values()): + render = formatted_entry.text.render(backend) + print(render) + assert render.strip() == html.strip() diff -Nru pybtex-0.23.0/tests/bibtex_parser_test.py pybtex-0.24.0/tests/bibtex_parser_test.py --- pybtex-0.23.0/tests/bibtex_parser_test.py 2020-10-12 15:23:33.547191900 +0000 +++ pybtex-0.24.0/tests/bibtex_parser_test.py 2021-01-17 19:26:34.568612000 +0000 @@ -1,6 +1,6 @@ # vim:fileencoding=utf-8 -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/tests/bst_parser_test/bst_parser_test.py pybtex-0.24.0/tests/bst_parser_test/bst_parser_test.py --- pybtex-0.23.0/tests/bst_parser_test/bst_parser_test.py 2020-10-12 15:15:57.883807700 +0000 +++ pybtex-0.24.0/tests/bst_parser_test/bst_parser_test.py 2021-01-17 19:26:34.568612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/tests/database_test/database_test.py pybtex-0.24.0/tests/database_test/database_test.py --- pybtex-0.23.0/tests/database_test/database_test.py 2020-10-12 15:23:33.547191900 +0000 +++ pybtex-0.24.0/tests/database_test/database_test.py 2021-01-17 19:26:34.560612200 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -95,7 +95,7 @@ class PybtexEntryStringIO(PybtexDatabaseIO): # the first entry in reference_data def __init__(self, bib_format): - super().__init__(bib_format) + super(PybtexEntryStringIO, self).__init__(bib_format) # get 1st key self.key = list(reference_data.entries.keys())[0] # make Entry as single-item BibliographyData diff -Nru pybtex-0.23.0/tests/general_engine_test.py pybtex-0.24.0/tests/general_engine_test.py --- pybtex-0.23.0/tests/general_engine_test.py 2020-10-12 15:15:57.890807600 +0000 +++ pybtex-0.24.0/tests/general_engine_test.py 2021-01-17 19:26:34.570612000 +0000 @@ -1,6 +1,6 @@ # vim:fileencoding=utf-8 -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -95,7 +95,7 @@ with errors.capture(): # FIXME check error messages result = engine.format_from_string(bib_string, style=style, citations=citations) correct_result_name = '{0}_{1}.{2}.bbl'.format(bib_name, style, engine_name) - correct_result = get_data(correct_result_name) + correct_result = get_data(correct_result_name).replace('\r\n', '\n') assert result == correct_result, diff(correct_result, result) @@ -123,7 +123,7 @@ with io.open_unicode(result_name) as result_file: result = result_file.read() correct_result_name = '{0}_{1}.{2}.bbl'.format(bib_name, bst_name, engine_name) - correct_result = get_data(correct_result_name) + correct_result = get_data(correct_result_name).replace('\r\n', '\n') assert result == correct_result, diff(correct_result, result) diff -Nru pybtex-0.23.0/tests/__init__.py pybtex-0.24.0/tests/__init__.py --- pybtex-0.23.0/tests/__init__.py 2020-10-12 15:15:57.882807700 +0000 +++ pybtex-0.24.0/tests/__init__.py 2021-01-17 19:26:34.568612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/tests/io_test.py pybtex-0.24.0/tests/io_test.py --- pybtex-0.23.0/tests/io_test.py 2020-10-12 15:15:57.890807600 +0000 +++ pybtex-0.24.0/tests/io_test.py 2021-01-17 19:26:34.570612000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/tests/parse_name_test.py pybtex-0.24.0/tests/parse_name_test.py --- pybtex-0.23.0/tests/parse_name_test.py 2020-10-12 15:15:57.891807600 +0000 +++ pybtex-0.24.0/tests/parse_name_test.py 2021-01-17 19:26:34.569612000 +0000 @@ -1,6 +1,6 @@ # vim:fileencoding=utf-8 -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/tests/richtext_test.py pybtex-0.24.0/tests/richtext_test.py --- pybtex-0.23.0/tests/richtext_test.py 2020-10-12 15:15:57.892807700 +0000 +++ pybtex-0.24.0/tests/richtext_test.py 2021-01-17 19:26:34.549612300 +0000 @@ -1,6 +1,6 @@ # vim:fileencoding=utf-8 -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff -Nru pybtex-0.23.0/tests/utils.py pybtex-0.24.0/tests/utils.py --- pybtex-0.23.0/tests/utils.py 2020-10-12 15:15:57.892807700 +0000 +++ pybtex-0.24.0/tests/utils.py 2021-01-17 19:26:34.522612600 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2019 Andrey Golovigin +# Copyright (c) 2006-2021 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the