Skip to content

Commit f5e4756

Browse files
committed
Documented ean parameter,fixed Sphinx docs
1 parent cdf70a2 commit f5e4756

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

barcode/upc.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,17 @@
88

99
from barcode.base import Barcode
1010
from barcode.charsets import upc as _upc
11-
from barcode.errors import (
12-
IllegalCharacterError,
13-
NumberOfDigitsError,
14-
)
11+
from barcode.errors import IllegalCharacterError, NumberOfDigitsError
1512

1613

1714
class UniversalProductCodeA(Barcode):
1815
"""Initializes new UPC-A barcode.
1916
20-
:parameters:
21-
upc : String
22-
The upc number as string.
23-
writer : barcode.writer Instance
24-
The writer to render the barcode (default: SVGWriter).
25-
make_ean: boolean
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).
2622
"""
2723

2824
name = 'UPC-A'
@@ -61,7 +57,7 @@ def calculate_checksum(self):
6157
"""Calculates the checksum for UPCA/UPC codes
6258
6359
:return: The checksum for 'self.upc'
64-
:rtype: Integer
60+
:rtype: int
6561
"""
6662
def sum_(x, y):
6763
return int(x) + int(y)
@@ -79,7 +75,7 @@ def build(self):
7975
"""Builds the barcode pattern from 'self.upc'
8076
8177
:return: The pattern as string
82-
:rtype: String
78+
:rtype: str
8379
"""
8480
code = _upc.EDGE[:]
8581

@@ -98,7 +94,7 @@ def build(self):
9894
def to_ascii(self):
9995
"""Returns an ascii representation of the barcode.
10096
101-
:rtype: String
97+
:rtype: str
10298
"""
10399

104100
code = self.build()

0 commit comments

Comments
 (0)