File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343
4444
4545def 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 :
You can’t perform that action at this time.
0 commit comments