mmulqueen / pyStrich

pyStrich is a Python 3 module to generate 1D and 2D Barcodes
Other
90 stars 24 forks source link

Bugfixes and font inclusion #1

Closed imsickofmaps closed 1 month ago

imsickofmaps commented 9 years ago

There's some tweaks in here that you might want to cherry pick from. Fixes for barcode steam creation and font inclusion in packages.

mmulqueen commented 9 years ago

Many thanks for this. I've made some overlapping changes myself it seems to solve the same problems - it's still early days with this package and all help is greatly appreciated. Sometime in the next few days, I'll go through this, grab the best bits and merge them.

My PyPI package is still broken-ish, which I think your package_data changes will sort out. Were your MANIFEST.in changes for the benefit of source distributions or binary distributions?

You've inserted {"label_border": 1, "bottom_border": 5} in commit 6bf0ef7. It's not immediately clear to me why, would you mind explaining? I just want to decide whether to merge that particular line or not.

Once again, thanks for the pull request.

imsickofmaps commented 9 years ago

Initially the MANIFEST.in changes were to resolve some stuff caused by the missing packages, a better setup.py probably made them redundant!

The {"label_border": 1, "bottom_border": 5} stuff in the example was because the default example crops the bottom off labels (which sucks I think) and finding out about those params is hard in the docs so I thought it better to have examples that help teach the options (people can always exclude them).

BTW - The BytesIO commit (the last one) is critical for a working package on py3.

Hope that helps, thanks for getting the ball rolling.

mmulqueen commented 9 years ago

Thanks for the extra information.

Oddly enough, I've only used this in Python 3.4 from the start and TravisCI has been testing 3.2, 3.3 as well and StringIO was working fine for me. Very early on I tried BytesIO and something failed (but I've since made loads of changes), latest version uses BytesIO per your change (which I agree makes much more sense).

I agree about the cropping, I think I'll make the change so that it becomes a default rather than an example.

I've included your setup.py change and one of my own in the latest version (0.6).

I ended up manually adding the changes in the end rather than attempting a merge and have credited you in the commit message.

The latest version (0.6) is available from PyPI, uses BytesIO and includes fonts and QR code data. I've been able to successfully install and use it in a venv via pip. Please give me some feedback if you try it. If all works well and you're happy, I'll close this pull request.