from . import shippers


def barcode(b):
    for klass in ['DHL', 'FedExExpress', 'FedExGround96', 'UPS', 'USPSIMpb', 'USPS13']:
        shipper = getattr(shippers, klass)(b)
        if shipper.is_valid:
            return shipper
    return shippers.Unknown(b)

from . import shippers


def barcode(b, barcode_classes=None):
    if barcode_classes is None:
        barcode_classes = ['DHL', 'FedExExpress', 'FedExGround96', 'UPS', 'USPSIMpb', 'USPS13']
    for klass in barcode_classes:
        shipper = getattr(shippers, klass)(b)
        if shipper.is_valid:
            return shipper
    return shippers.Unknown(b)

Allow barcode classes to be optionally specified
Allow barcode classes to be optionally specified
