Skip to content

Commit

Permalink
Remove deprecated files and functionalities
Browse files Browse the repository at this point in the history
  • Loading branch information
pietermarsman committed Jul 7, 2024
1 parent b9b75ff commit 01aa27c
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 508 deletions.
24 changes: 0 additions & 24 deletions pdfminer/cmapdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,27 +479,3 @@ def _warn_once(self, msg: str) -> None:
"(cid) values in the output. "
)
log.warning(base_msg + msg)


def main(argv: List[str]) -> None:
from warnings import warn

warn(
"The function main() from cmapdb.py will be removed in 2023. It was probably "
"introduced for testing purposes a long time ago, and no longer relevant. "
"Feel free to create a GitHub issue if you disagree.",
DeprecationWarning,
)

args = argv[1:]
for fname in args:
fp = open(fname, "rb")
cmap = FileUnicodeMap()
CMapParser(cmap, fp).run()
fp.close()
cmap.dump()
return


if __name__ == "__main__":
main(sys.argv)
5 changes: 4 additions & 1 deletion pdfminer/glyphlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
The following data was taken by
$ wget https://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
$ python tools/conv_glyphlist.py glyphlist.txt > glyphlist.py
```python
from pdfminer.glyphlist import convert_glyphlist
convert_glyphlist("glyphlist.txt")
"""

# ###################################################################################
Expand Down
12 changes: 0 additions & 12 deletions pdfminer/pdfdocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,6 @@ class PDFTextExtractionNotAllowed(PDFEncryptionError):
pass


class PDFTextExtractionNotAllowedError(PDFTextExtractionNotAllowed):
def __init__(self, *args: object) -> None:
from warnings import warn

warn(
"PDFTextExtractionNotAllowedError will be removed in the future. "
"Use PDFTextExtractionNotAllowed instead.",
DeprecationWarning,
)
super().__init__(*args)


# some predefined literals and keywords.
LITERAL_OBJSTM = LIT("ObjStm")
LITERAL_XREF = LIT("XRef")
Expand Down
23 changes: 0 additions & 23 deletions pdfminer/pdffont.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import struct
import sys
from io import BytesIO
from typing import (
Any,
Expand Down Expand Up @@ -1191,25 +1190,3 @@ def to_unichr(self, cid: int) -> str:
return self.unicode_map.get_unichr(cid)
except KeyError:
raise PDFUnicodeNotDefined(self.cidcoding, cid)


def main(argv: List[str]) -> None:
from warnings import warn

warn(
"The function main() from pdffont.py will be removed in 2023. It was probably "
"introduced for testing purposes a long time ago, and no longer relevant. "
"Feel free to create a GitHub issue if you disagree.",
DeprecationWarning,
)

for fname in argv[1:]:
fp = open(fname, "rb")
font = CFFFont(fname, fp)
print(font)
fp.close()
return


if __name__ == "__main__":
main(sys.argv)
52 changes: 0 additions & 52 deletions tools/conv_afm.py

This file was deleted.

33 changes: 0 additions & 33 deletions tools/conv_glyphlist.py

This file was deleted.

Loading

0 comments on commit 01aa27c

Please sign in to comment.