From cdfb10502a2b86d709b74977804851b6a142f5dc Mon Sep 17 00:00:00 2001 From: augustin64 Date: Thu, 26 Sep 2024 14:42:44 +0200 Subject: [PATCH] mscz.py: Add comments --- src/modules/mscz.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/mscz.py b/src/modules/mscz.py index 63e070e..69fb5f6 100644 --- a/src/modules/mscz.py +++ b/src/modules/mscz.py @@ -9,6 +9,14 @@ import json Patches """ class Patches: + """ + Is meant to index and simplify the way to access a patch. + Instead of doing apply(.., .., mscz.create_pagebreaks(ext="mscx")) which is redundant and needs to specify mscx, + you can just do apply(.., .., mscz.patches.create_pagebreaks) + + To register a new patch outside of this file, just use @mscz.register_patch(ext=.., filename=..) (one of the two) + You can then access it the same way + """ def __init__(self): self._data = {} def __getattr__(self, key): @@ -18,6 +26,9 @@ class Patches: patches = Patches() def register_patch(ext=None, filename=None): + """ + Register a new patch. One of the two arguments is mandatory + """ if ext is None and filename is None: raise ValueError("You must specify at least one of the two parameters")