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

Remove deprecated files and functionalities #974

Merged
merged 2 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Deprecated

- The third argument (generation number) to `PDFObjRef` ([#972](https://github.com/pdfminer/pdfminer.six/pull/972))

### Fixed

- `TypeError` when PDF object reference cannot be parsed as int ([#972](https://github.com/pdfminer/pdfminer.six/pull/972))])

### Removed

- Deprecated tools, functions and classes ([#974](https://github.com/pdfminer/pdfminer.six/pull/974))

## [20240706]

### Added
Expand Down
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
Loading