# Path: src/zinc/formats.py

# 
# Path: src/zinc/defaults.py



from .formats import Formats
from .defaults import defaults

### Utils



def make_bundle_id(catalog_id, bundle_name):
    assert catalog_id
    assert bundle_name
    return '%s.%s' % (catalog_id, bundle_name)


def make_bundle_descriptor(bundle_id, version, flavor=None):
    assert bundle_id
    assert version
    descriptor = '%s-%d' % (bundle_id, version)
    if flavor is not None:
        descriptor += '~%s' % (flavor)
    return descriptor


def _bundle_descriptor_without_flavor(bundle_descriptor):
    index = bundle_descriptor.rfind('~')
    if index == -1:
        return bundle_descriptor
    else:

# Path: src/zinc/formats.py

# 
# Path: src/zinc/defaults.py



# Path: src/zinc/helpers.py
from .formats import Formats
from .defaults import defaults


### Utils



def make_bundle_id(catalog_id, bundle_name):
    assert catalog_id
    assert bundle_name
    return '%s.%s' % (catalog_id, bundle_name)


def make_bundle_descriptor(bundle_id, version, flavor=None):
    assert bundle_id
    assert version
    descriptor = '%s-%d' % (bundle_id, version)
    if flavor is not None:
        descriptor += '~%s' % (flavor)
    return descriptor


def _bundle_descriptor_without_flavor(bundle_descriptor):
    index = bundle_descriptor.rfind('~')
    if index == -1:
        return bundle_descriptor
    else:

        return bundle_descriptor[:index]