Skip to content

Commit f81762a

Browse files
author
Hugo Osvaldo Barrera
committed
Improve docstring on helper method
1 parent 6032c01 commit f81762a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

barcode/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,26 @@
4343

4444

4545
def get(name, code=None, writer=None, options=None):
46+
"""Helper method for getting a generator or even a generated code.
47+
48+
:param str name: The name of the type of barcode desired.
49+
:param str code: The actual information to encode. If this parameter is
50+
provided, a generated barcode is returned. Otherwise, the barcode class
51+
is returned.
52+
:param Writer writer: An alternative writer to use when generating the
53+
barcode.
54+
:param dict options: Aditional options to be passed on to the barcode when
55+
generating.
56+
"""
57+
4658
options = options or {}
4759
try:
4860
barcode = __BARCODE_MAP[name.lower()]
4961
except KeyError:
5062
raise BarcodeNotFoundError(
5163
'The barcode {0!r} you requested is not known.'.format(name)
5264
)
65+
5366
if code is not None:
5467
return barcode(code, writer, **options)
5568
else:

0 commit comments

Comments
 (0)