Afterware, like Middleware, really gives this BOM generator a leg up over the competition.
It operatres on the file generated by the Formatter (a copy of it actually).
Some examples of cool potential Afterware:
- Upload a BOM to an online service
- Copy the BOM file to an archive or shared folder
The responsibility of Afterware can be whatever you want it to.
Just do not remove the file path that it is handed.
Afterware is the last thing called in the program pipeline. Once the Parser, Middleware, and Formatter have all been ran.
Creating Afteware is just like creating Middleware and a Formatter.
Afterware functions do not need to return anything
The first step is to create a file in the Afterware
folder (the same folder as this README)
The file MUST be in this format: "*_afterware.py
" where *
is the name of your Afterware.
import the Afterware
module into the file just created
import Afterware
Create a function for your Afterware that has registers it using a decorator This function must accept a string that is the path to a file, and is not required to return anything
@Afterware.Register("My-Afterware-Name")
def test_afterware(savedFile):
""" A nice comment about what your Afterware does """
# Code for your Afterware
Note: the Afterware name is not case sensitive
Like Middleware, you now need to add your Afterware to the config.json
file in the afterware
array (the afterware pipeline).