Example #1
0
 def __init__(self, isbn, writer=None):
     isbn = isbn.replace('-', '')
     self.isbn13 = isbn
     if isbn[:3] not in ('978', '979'):
         raise WrongCountryCodeError('ISBN must start with 978 or 979.')
     if isbn[:3] == '979':
         if isbn[3:5] not in ('10', '11'):
             raise BarcodeError('ISBN must start with 97910 or 97911.')
     EuropeanArticleNumber13.__init__(self, isbn, writer)
Example #2
0
 def __init__(self, isbn, writer=None):
     isbn = isbn.replace("-", "")
     self.isbn13 = isbn
     if isbn[:3] not in ("978", "979"):
         raise WrongCountryCodeError("ISBN must start with 978 or 979.")
     if isbn[:3] == "979":
         if isbn[3:5] not in ("10", "11"):
             raise BarcodeError("ISBN must start with 97910 or 97911.")
     EuropeanArticleNumber13.__init__(self, isbn, writer)
Example #3
0
 def __init__(self, upc, writer=None, make_ean=False):
     if make_ean:
         UniversalProductCodeA.digits = 12
         upc = '0' + upc
     self.upc = upc
     EuropeanArticleNumber13.__init__(self, upc, writer)
Example #4
0
 def __init__(self, isbn, writer=None):
     isbn = isbn.replace('-', '')
     self.isbn13 = isbn
     if isbn[:3] not in ('978', '979'):
         raise WrongCountryCodeError('ISBN must start with 978 or 979.')
     EuropeanArticleNumber13.__init__(self, isbn, writer)
Example #5
0
 def __init__(self, issn, writer=None):
     issn = issn.replace('-', '')
     issn = issn[:self.digits]
     self.issn = issn
     self.issn = '{0}{1}'.format(issn, self._calculate_checksum())
     EuropeanArticleNumber13.__init__(self, self.make_ean(), writer)
 def __init__(self, upc, writer=None, make_ean=False):
     if make_ean:
         UniversalProductCodeA.digits = 12
         upc = '0' + upc
     self.upc = upc
     EuropeanArticleNumber13.__init__(self, upc, writer)
Example #7
0
 def __init__(self, isbn, writer=None):
     isbn = isbn.replace("-", "")
     self.isbn13 = isbn
     if isbn[:3] not in ("978", "979"):
         raise WrongCountryCodeError("ISBN must start with 978 or 979.")
     EuropeanArticleNumber13.__init__(self, isbn, writer)