Skip to content

Commit

Permalink
Update shortcuts.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KazukiPrzyborowski authored Aug 18, 2023
1 parent 9e80d0e commit 45d69b7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions upcean/validate/shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@
def validate_checksum(bctype, upc, return_check=False):
if(bctype not in upcean.support.supported_barcodes("tuple")):
return False;
if(hasattr(upcean.validate.validate, "validate_"+bctype+"_checksum") and callable(getattr(upcean.validate.validate, "validate_"+bctype+"_checksum"))):
return getattr(upcean.validate.validate, "validate_"+bctype+"_checksum")(upc,return_check);
if(not hasattr(upcean.validate.validate, "validate_"+bctype+"_checksum") or not callable(getattr(upcean.validate.validate, "validate_"+bctype+"_checksum"))):
if(hasattr(upcean.validate, "validate_"+bctype+"_checksum") and callable(getattr(upcean.validate, "validate_"+bctype+"_checksum"))):
return getattr(upcean.validate, "validate_"+bctype+"_checksum")(upc,return_check);
if(not hasattr(upcean.validate, "validate_"+bctype+"_checksum") or not callable(getattr(upcean.validate, "validate_"+bctype+"_checksum"))):
return False;
return False;
def get_checksum(bctype, upc):
if(bctype not in upcean.support.supported_barcodes("tuple")):
return False;
if(hasattr(upcean.validate.validate, "get_"+bctype+"_checksum") and callable(getattr(upcean.validate.validate, "get_"+bctype+"_checksum"))):
return getattr(upcean.validate.validate, "get_"+bctype+"_checksum")(upc);
if(not hasattr(upcean.validate.validate, "get_"+bctype+"_checksum") or not callable(getattr(upcean.validate.validate, "get_"+bctype+"_checksum"))):
if(hasattr(upcean.validate, "get_"+bctype+"_checksum") and callable(getattr(upcean.validate, "get_"+bctype+"_checksum"))):
return getattr(upcean.validate, "get_"+bctype+"_checksum")(upc);
if(not hasattr(upcean.validate, "get_"+bctype+"_checksum") or not callable(getattr(upcean.validate, "get_"+bctype+"_checksum"))):
return False;
return False;
def fix_checksum(bctype, upc):
if(bctype not in upcean.support.supported_barcodes("tuple")):
return False;
if(hasattr(upcean.validate.validate, "fix_"+bctype+"_checksum") and callable(getattr(upcean.validate.validate, "fix_"+bctype+"_checksum"))):
return getattr(upcean.validate.validate, "fix_"+bctype+"_checksum")(upc);
if(not hasattr(upcean.validate.validate, "fix_"+bctype+"_checksum") or not callable(getattr(upcean.validate.validate, "fix_"+bctype+"_checksum"))):
if(hasattr(upcean.validate, "fix_"+bctype+"_checksum") and callable(getattr(upcean.validate, "fix_"+bctype+"_checksum"))):
return getattr(upcean.validate, "fix_"+bctype+"_checksum")(upc);
if(not hasattr(upcean.validate, "fix_"+bctype+"_checksum") or not callable(getattr(upcean.validate, "fix_"+bctype+"_checksum"))):
return False;
return False;

0 comments on commit 45d69b7

Please sign in to comment.