Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate bibtex.py #4

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/dendropy/datamodel/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,11 @@ def add_citation(self,
annotation : |Annotation|
The new |Annotation| created.
"""

deprecate.dendropy_deprecation_warning(
message="Deprecated since DendroPy 5: BibTexEntry is broken. If this is important, open an issue on GitHub."
mmore500 marked this conversation as resolved.
Show resolved Hide resolved
)

if read_as == "bibtex":
return self.add_bibtex(citation=citation,
store_as=store_as,
Expand Down Expand Up @@ -1247,6 +1252,11 @@ def add_bibtex(self,
annotation : |Annotation|
The new |Annotation| created.
"""

deprecate.dendropy_deprecation_warning(
message="Deprecated since DendroPy 5: BibTexEntry is broken. If this is important, open an issue on GitHub."
mmore500 marked this conversation as resolved.
Show resolved Hide resolved
)

bt = bibtex.BibTexEntry(citation)
bt_dict = bt.fields_as_dict()

Expand Down
12 changes: 12 additions & 0 deletions src/dendropy/utility/bibtex.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import textwrap
import sys
from dendropy.utility.container import OrderedCaselessDict
from dendropy.utility import deprecate

# default order of fields
BIBTEX_FIELDS = [
Expand Down Expand Up @@ -109,6 +110,11 @@ def __init__(self, citation=None):
Sets up internal dictionary of BibTeX fields, and initializes
if argument is given.
"""

deprecate.dendropy_deprecation_warning(
message="Deprecated since DendroPy 5: BibTexEntry is broken. If this is important, open an issue on GitHub."
mmore500 marked this conversation as resolved.
Show resolved Hide resolved
)

self.bibtype = None
self.citekey = None
if isinstance(citation, BibTexEntry):
Expand Down Expand Up @@ -300,10 +306,16 @@ class BibTexDb(object):
A BibTeX database.
"""


def __init__(self, bibfilepath=None):
"""
Initializes database, optionally from file.
"""

deprecate.dendropy_deprecation_warning(
message="Deprecated since DendroPy 5: BibTexEntry is broken. If this is important, open an issue on GitHub."
mmore500 marked this conversation as resolved.
Show resolved Hide resolved
)

self.entries = []
if bibfilepath:
self.add_from_file(bibfilepath)
Expand Down
Loading