mscz.py: Add comments
This commit is contained in:
parent
446a914185
commit
cdfb10502a
@ -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")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user