Files
meson/docs/refman/loaderpickle.py
T
Dylan Baker e991c4d454 Use SPDX-License-Identifier consistently
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.

This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.

SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
2023-12-13 15:19:21 -05:00

23 lines
630 B
Python

# SPDX-License-Identifier: Apache-2.0
# Copyright 2021 The Meson development team
from pathlib import Path
import pickle
from .loaderbase import LoaderBase
from .model import ReferenceManual
class LoaderPickle(LoaderBase):
def __init__(self, in_file: Path) -> None:
super().__init__()
self.in_file = in_file
def load_impl(self) -> ReferenceManual:
res = pickle.loads(self.in_file.read_bytes())
assert isinstance(res, ReferenceManual)
return res
# Assume that the pickled data is OK and skip validation
def load(self) -> ReferenceManual:
return self.load_impl()