Skip to main content

A few bits which are potentially useful to developers of Lektor plugins

Project description

Lektorlib

PyPI version PyPI Supported Python Versions GitHub license GitHub Actions (Tests) Trackgit Views

A few bits which may possibly be useful to developers of Lektor plugins.

Bits Included

lektorlib.query.PrecomputedQuery

A subclass of lektor.db.Query which yields a pre-computed sequence of children.

This is useful in (at least) two circumstances:

First, when the children to be queried are virtual source objects, the standard lektor.db.Query will not work. This version will.

Second, when we would like to generate a query of a pre-computed subset of a resource's children, this prevents intruducing unnecessary build dependencies. If we used a standard query with a filter applied, it still iterates over all of the parent node’s children, registering dependencies on all of them.

lektorlib.context.disable_dependency_recording

A python context manager which (temporarily) disables lektor’s dependency recording system.

lektorlib.recordcache.get_or_create_virtual

This function is a helper to streamline the caching of virtual source objects in the lektor record cache.

Lektor.db.Pad.get() handles caching for regular records. At present, however, it does not appear that it ever caches virtual source objects, even though its record cache is perfectly capable of doing so.

lektorlib.testing.assert_no_dependencies(match=None)

This context manager is a testing helper which can be used to check that no dependencies are recorded with lektor’s dependency tracking system.

Author

Jeff Dairiki dairiki@dairiki.org

Changelog

Release 1.2.0 (2023-06-02)

  • Added type annotations
  • Use PDM instead of setuptools to build distribution
  • Configured pre-commit
  • Run black and reorder-python-imports on the code

Release 1.1.0 (2023-04-20)

Fixes for Lektor 3.4 (in pre-release).

We now test under Lektor 3.3 and Lektor 3.4 (pre-release).

Release 1.0 (2022-01-28)

Drop support for python < 3.7. Test under python 3.10.

Release 0.1 (2021-02-05)

No code changes.

Release is now classified as "production/stable".

Release 0.1a1 (2020-05-05)

Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lektorlib-1.2.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lektorlib-1.2.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file lektorlib-1.2.0.tar.gz.

File metadata

  • Download URL: lektorlib-1.2.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.7.0 CPython/3.10.6

File hashes

Hashes for lektorlib-1.2.0.tar.gz
Algorithm Hash digest
SHA256 29439579f0faea6884689d16e3cde323e0b1cdbd035afedc9112f4240c67a9c6
MD5 902ffdea197cd545420eb6ffdca34358
BLAKE2b-256 5be066ea29490f089151688c576f40e0ca94a408f32930f155e767731c9459f2

See more details on using hashes here.

File details

Details for the file lektorlib-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: lektorlib-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.7.0 CPython/3.10.6

File hashes

Hashes for lektorlib-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93a0fe9374876658655875e4f5553947c38f752013c3da858108779aa888cdf5
MD5 85dc21f4fd536626d96e3d169cb4b4d6
BLAKE2b-256 153adcffaf7ba987471bf6d57f1f4fb7ca7ce573a646afcdac4fd8dcf3ba10dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page