Skip to content

Commit a5c296a

Browse files
committed
ready for release!
1 parent 6875e23 commit a5c296a

File tree

4 files changed

+40
-35
lines changed

4 files changed

+40
-35
lines changed

.github/workflows/github-deploy.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ jobs:
5151
steps:
5252
- uses: actions/download-artifact@v3
5353
with:
54-
# unpacks default artifact into dist/
55-
# if `name: artifact` is omitted, the action will create extra parent dir
5654
name: artifact
5755
path: dist
5856

5957
- uses: pypa/gh-action-pypi-publish@release/v1
60-
with:
61-
repository_url: https://test.pypi.org/legacy/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ This is a python module for encoding, decoding, and correcting data using [BCH c
1010
$ pip install bchlib
1111

1212
## Installing from source:
13-
Make sure you have python-dev setup. For Windows, this means you need [Visual Studio 2015](https://stackoverflow.com/a/44290942/6844002).
13+
On Linux, you will need python-dev or equivalent package. Windows, you need Microsoft Visual C++. I've tested this manually using [Visual Studio 2015](https://stackoverflow.com/a/44290942/6844002).
1414

1515
$ pip install .
1616

1717
## Usage Example
1818

19-
See [the tests directory](tests) for usage examles.
19+
See Python's built-in help `import bchlib; help(bchlib)` and the module's [tests](tests) for usage examples.

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
NAME = 'bchlib'
88
VERSION = '1.0.0'
9-
DESCRIPTION = 'A python wrapper module for the Linux kernel BCH library.',
9+
DESCRIPTION = 'A python wrapper module for the Linux kernel BCH library.'
1010
URL = 'https://github.com/jkent/python-bchlib'
1111
EMAIL = 'jeff@jkent.net'
1212
AUTHOR = 'Jeff Kent'
@@ -40,7 +40,6 @@
4040
url=URL,
4141
ext_modules=[BCHLIB_EXT],
4242
include_package_data=True,
43-
license='GNU GPLv2',
4443
classifiers=[
4544
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
4645
'Programming Language :: Python',

src/bchlib.c

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -386,26 +386,33 @@ static PyMemberDef BCH_members[] = {
386386
};
387387

388388
static PyMethodDef BCH_methods[] = {
389-
{"encode", (PyCFunction) BCH_encode, METH_VARARGS | METH_KEYWORDS,
390-
"\b\b\b\bencode(data[, ecc]) → ecc\nEncodes 'data' with an "
391-
"optional starting 'ecc'. Returns the calculated\necc."},
392-
{"decode", (PyCFunction) BCH_decode, METH_VARARGS | METH_KEYWORDS,
393-
"\b\b\b\bdecode(data=None, recv_ecc=None, calc_ecc=None, "
394-
"syn=None) → nerr\nCalculates error locations and returns "
395-
"the number of errors found or\nnegative if decoding failed.\n\n"
396-
"There are four ways that 'decode' can function by providing "
397-
"different\ninput parameters:\n\n 'data' and 'recv_ecc'\n"
398-
" 'recv_ecc' and 'calc_ecc'\n 'calc_ecc' (as recv_ecc XOR "
399-
"calc_ecc)\n 'syn' (a sequence of 2*t values)\n\n'data_len' "
400-
"SHOULD be set before calling this function."},
401-
{"correct", (PyCFunction) BCH_correct, METH_VARARGS | METH_KEYWORDS,
402-
"\b\b\b\bcorrect(data=None, ecc=None) → None\nCorrects 'data' "
403-
"and 'ecc' if provided. Buffers must not be readonly."},
389+
{"encode", (PyCFunction) BCH_encode, METH_VARARGS | METH_KEYWORDS, "\b\b\b\b"
390+
"encode(data[, ecc]) → ecc\n"
391+
"Encodes 'data' with an optional starting 'ecc'. Returns the\n"
392+
"calculated ecc."},
393+
{"decode", (PyCFunction) BCH_decode, METH_VARARGS | METH_KEYWORDS, "\b\b\b\b"
394+
"decode(data=None, recv_ecc=None, calc_ecc=None, syn=None) → nerr\n"
395+
"Calculates error locations and returns the number of errors found\n"
396+
"or negative if decoding failed.\n\n"
397+
398+
"There are four ways that 'decode' can function by providing\n"
399+
"different input parameters:\n\n"
400+
401+
" 'data' and 'recv_ecc'\n"
402+
" 'recv_ecc' and 'calc_ecc'\n"
403+
" 'calc_ecc' (as recv_ecc XOR calc_ecc)\n"
404+
" 'syn' (a sequence of 2*t values)\n\n"
405+
406+
"'data_len' SHOULD be set before calling this function."},
407+
{"correct", (PyCFunction) BCH_correct, METH_VARARGS | METH_KEYWORDS, "\b\b\b\b"
408+
"correct(data=None, ecc=None) → None\n"
409+
"Corrects 'data' and 'ecc' if provided. Buffers must not be\n"
410+
"readonly."},
404411
{"compute_even_syn", (PyCFunction) BCH_compute_even_syn,
405-
METH_VARARGS | METH_KEYWORDS,
406-
"\b\b\b\bcompute_even_syn(syn) → syn\nComputes even syndromes "
407-
"from odd ones. Takes a sequence of 2*t values\nand returns a "
408-
"tuple of 2*t elements."},
412+
METH_VARARGS | METH_KEYWORDS, "\b\b\b\b"
413+
"compute_even_syn(syn) → syn\n"
414+
"Computes even syndromes from odd ones. Takes a sequence of\n"
415+
"2*t values and returns a tuple of 2*t elements."},
409416
{NULL}
410417
};
411418

@@ -416,14 +423,17 @@ static PyTypeObject BCHType = {
416423
.tp_dealloc = (destructor) BCH_dealloc,
417424
.tp_getattro = (getattrofunc) BCH_getattr,
418425
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
419-
.tp_doc = "BCH Encoder/Decoder\n\n"
420-
"__init__(t, poly=None, m=None, swap_bits=False) → bch\n"
421-
" Constructor creates a BCH object with given 't' bit strength. At\n"
422-
" least one of 'poly' and/or 'm' must be provided. If 'poly' is provided\n"
423-
" but 'm' (Galois field order) is not, 'm' will be calculated\n"
424-
" automatically. If 'm' between 5 and 15 inclusive is provided, 'poly'\n"
425-
" will be selected automatically. The 'swap_bits' parameter will reverse\n"
426-
" the bit order within data and syndrome bytes.",
426+
.tp_doc =
427+
"BCH Encoder/Decoder\n\n"
428+
429+
"__init__(t, poly=None, m=None, swap_bits=False) → bch\n"
430+
" Constructor creates a BCH object with given 't' bit strength. At\n"
431+
" least one of 'poly' and/or 'm' must be provided. If 'poly' is\n"
432+
" provided but 'm' (Galois field order) is not, 'm' will be\n"
433+
" calculated automatically. If 'm' between 5 and 15 inclusive is'\n"
434+
" provided, 'polywill be selected automatically. The 'swap_bits'\n"
435+
" parameter will reverse the bit order within data and syndrome\n"
436+
" bytes.",
427437
.tp_methods = BCH_methods,
428438
.tp_members = BCH_members,
429439
.tp_init = (initproc) BCH_init,

0 commit comments

Comments
 (0)