Commit 27f62f0c authored by Justin van der Krieken's avatar Justin van der Krieken
Browse files

Automatically generate sample barcode

runs on `yarn build`
parent 54fd6f94
......@@ -10,6 +10,7 @@ const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
filename: 'index.html',
inject: 'body'
})
const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
entry: './client/index.jsx',
......@@ -27,5 +28,11 @@ module.exports = {
]
},
plugins: [HtmlWebpackPluginConfig]
plugins: [
HtmlWebpackPluginConfig,
new WebpackShellPlugin({
onBuildStart: ['echo "generate sample barcode"'],
onBuildEnd: ['python zesje/helpers/pdf_generation_helper.py']
})
]
}
......@@ -241,3 +241,9 @@ def _add_corner_markers(canv, pagesize, margin=10):
(left, top, left + length, top),
(left, top, left, top - length)
])
if __name__ == "__main__":
output_dir = 'zesje/static'
image = generate_datamatrix('some_id', 1, 0)
image.save(os.path.join(output_dir, 'barcode_example.png'))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment