Skip to main content

OverlayModule

This module finder makes it possible to load modules with overlays. This can be useful in cases you try to customize some kind of application in places at moment that is out of your control.

For example, it is useful when you want to customize an application that make extensive uses of global. This module will allow you to load an overlay over a module that is being loaded right after the module has been loaded.

Let say you have this module a.b. You'd want to customize the class a.b:Application. To make sure that something that inherits later from a.b:Application will in fact inherit from o.overlay.a.b:Application.

When the module is being loaded it will first load a.b then it will execute the module o.overlay.a.b on top of the module a.b.

In short, this is more or less monkey patching on steroid.

How to use:

For the script using it:

import importlib
from overlaymodule import OverlayFinder

module_spec = importlib.util.find_spec('a')
module_path = odoo_spec.submodule_search_locations[0]

sys.meta_path.insert(
    0,
    OverlayFinder(
        'a',
        module_path,
        overlays=[
            "o.overlay",
        ]
    )
)

from a.b import Application, OldApplication

A module overlay o.overlay.a.b

# since a.b is already loaded, it's possible to import it within itself!
from a.b import Application as OldApplication

class Application(OldApplication):
    pass

Metadata

Release files for overlaymodule 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for overlaymodule 0.0.3
File Size Uploaded Provenance Actions
overlaymodule-0.0.3.tar.gz 3.4 kB Without provenance Details for overlaymodule-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for overlaymodule 0.0.3
File Interpreter ABI Platform Actions
overlaymodule-0.0.3-py3-none-any.whl Python 3 none any Details for overlaymodule-0.0.3-py3-none-any.whl

Total release size: 7.2 kB

Release files / overlaymodule-0.0.3.tar.gz

Download URL overlaymodule-0.0.3.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
72ab853ca532ff0864cdf6d8d745d6bc39cc2bfc452ca8008074fa8d2dab0cd6
BLAKE2b-256 checksum
How to use checksums
0cfedcc6ae5fa0dce87532e26b2dcb648dd2938eb128222372cddb294ce7172f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / overlaymodule-0.0.3-py3-none-any.whl

Download URL overlaymodule-0.0.3-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f999cf8f151e30380643d7da381f2dcfe1eb648928d6db21b10c5a32634263f1
BLAKE2b-256 checksum
How to use checksums
d0f122aa16cb21ee2ef4ec32419f7ed6eb13e07df190402377dc58bed2b81526
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for overlaymodule 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page