Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

improve how PDFHandler caches single page of pdf #93

@bosd

Description

@bosd

Accross the repos the where some PR's about for the usage of tempfiles.

From: camelot-dev#487

Change the way to share and clean up temp directory.

The WITH clause is contagious. Temp directory cannot be shared across an instance of PDFHandler unless the signature of init is changed. It turns the upper layer's duty to clean up the directory. To hide the implementation details, use finalizers to clean up.

Add _get_temp_path to make sure to access tmp pdf file in the same way.

Hide implementation details. We can reuse the temp pdf after calling parse() now.

Update _save_page parameters to meet the change.

Use properties instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is neededperformancePerformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions