Beispiel #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)
Beispiel #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)
Beispiel #3
0
 def __init__(self, jan, writer=None):
     if int(jan[:3]) not in JapanArticleNumber.valid_country_codes:
         raise WrongCountryCodeError(
             "Country code isn't between 450-460 or 490-500."
         )
     EuropeanArticleNumber13.__init__(self, jan, writer)
Beispiel #4
0
 def __init__(self, jan, *args, **kwargs):
     if int(jan[:3]) not in self.valid_country_codes:
         raise WrongCountryCodeError(
             "Country code isn't between 450-460 or 490-500.")
     super().__init__(jan, *args, **kwargs)