Skip to content

Latest commit

 

History

History

Afterware

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Afterware

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

Responsibilities

The responsibility of Afterware can be whatever you want it to.

Just do not remove the file path that it is handed.

How Afterware Works

Afterware is the last thing called in the program pipeline. Once the Parser, Middleware, and Formatter have all been ran.

Creating Afterware

Creating Afteware is just like creating Middleware and a Formatter.

Afterware functions do not need to return anything

Step 1

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.

Step 2

import the Afterware module into the file just created

import Afterware

Step 3

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

Step 4

Like Middleware, you now need to add your Afterware to the config.json file in the afterware array (the afterware pipeline).