File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 1212
1313
1414class UniversalProductCodeA (Barcode ):
15- """Initializes new UPC-A barcode.
15+ """Universal Product Code ( UPC) barcode.
1616
17- :param str upc: The upc number as string.
18- :param writer: barcode.writer instance. The writer to render the barcode
19- (default: SVGWriter).
20- :param bool make_ean: Indicates if a leading zero should be added to the
21- barcode. This converts the UPC into a valid European Article Number (EAN).
17+ UPC-A consists of 12 numeric digits.
2218 """
23-
2419 name = 'UPC-A'
2520
2621 digits = 11
2722
2823 def __init__ (self , upc , writer = None , make_ean = False ):
24+ """Initializes new UPC-A barcode.
25+
26+ :param str upc: The upc number as string.
27+ :param writer: barcode.writer instance. The writer to render the barcode
28+ (default: SVGWriter).
29+ :param bool make_ean: Indicates if a leading zero should be added to the
30+ barcode. This converts the UPC into a valid European Article Number (EAN).
31+ """
2932 self .ean = make_ean
3033 upc = upc [:self .digits ]
3134 if not upc .isdigit ():
You can’t perform that action at this time.
0 commit comments