cleanup _extract_meson_version()

pull/9773/head
Stone Tickle 3 years ago
parent 09f52a3817
commit 95057340b3
No known key found for this signature in database
GPG Key ID: 4DF34BD9C2622309
  1. 5
      docs/refman/generatorbase.py
  2. 7
      docs/refman/generatorjson.py

@ -43,6 +43,11 @@ class GeneratorBase(metaclass=ABCMeta):
return f'0_{fn.name}'
return sorted([x for x in raw if not x.hidden], key=key_fn)
@staticmethod
def _extract_meson_version() -> str:
from mesonbuild.coredata import version
return version
@property
def functions(self) -> T.List[Function]:
return GeneratorBase.sorted_and_filtered(self.manual.functions)

@ -92,13 +92,6 @@ class GeneratorJSON(GeneratorBase):
'methods': {x.name: self._generate_function(x) for x in self.sorted_and_filtered(obj.methods)},
}
def _extract_meson_version(self) -> str:
# Hack around python relative imports to get to the Meson version
import sys
sys.path.append(Path(__file__).resolve().parents[2].as_posix())
from mesonbuild.coredata import version
return version
def generate(self) -> None:
data: J.Root = {
'version_major': J.VERSION_MAJOR,

Loading…
Cancel
Save