|
Brett Smith
|
3fbc14d377ac
|
4 years ago
|
|
Improve organization between modules.
* Rename _typing to beancount_types to better reflect what it is. * LessComparable isn't a Beancount type, so move that to plugin.core with its dependent helper classes. * Errors are a core Beancount concept, so move that module to the top level and have it include appropriate type definitions.
|
|
Brett Smith
|
a41feb94b3e0
|
4 years ago
|
|
plugin: Transform posting hooks into transaction hooks.
I feel like posting hooks a case of premature optimization in early development. This approach reduces the number of special cases in the code and allows us to more strongly reason about hooks in the type system.
|
|
Brett Smith
|
547ae657808f
|
4 years ago
|
|
plugin.core: _meta_set properly handles when post.meta is None.
post is a NamedTuple, so attribute assignment is not allowed. Instead we have to construct a whole new Posting.
|
|
Brett Smith
|
d34db7154257
|
4 years ago
|
|
plugin: Introduce HookRegistry.
This is the layer that keeps track of the different groups of hooks and can filter them before runtime. The idea here is that you'll be able to do things like skip hooks that require network access when you don't have it, or skip CPU-intensive hooks when you don't need them, etc.
|
|
Brett Smith
|
d145e2273483
|
4 years ago
|
|
test_plugin_run: Simplify testing strategy.
Avoid keeping state in the hook classes/instances.
|
|
Brett Smith
|
e9e2bb9b001d
|
4 years ago
|
|
plugin: Rename the main method of hooks from `check` to `run`.
This will be more appropriate when we have hooks that do more than check metadata.
|
|
Brett Smith
|
53329c7a23b8
|
4 years ago
|
|
plugin: Start entry point.
This doesn't integrate with existing hooks but at least sketches out the main loop.
|