# Path: cloudvolume/exceptions.py
# class UnsupportedProtocolError(ValueError):
#   """Unknown protocol extension."""
#   pass
# 
# Path: cloudvolume/lib.py
# def yellow(text):
#   return colorize('yellow', text)
# 
# def toabs(path):
#   path = os.path.expanduser(path)
#   return os.path.abspath(path)


import cloudfiles.paths
import os
import posixpath
import re
import sys
from collections import namedtuple
from .exceptions import UnsupportedProtocolError
from .lib import yellow, toabs



ExtractedPath = namedtuple('ExtractedPath', 
  ('format', 'protocol', 'bucket', 'basepath', 'no_bucket_basepath', 'dataset', 'layer')
)

ALLOWED_PROTOCOLS = cloudfiles.paths.ALLOWED_PROTOCOLS
ALLOWED_FORMATS = [ 'graphene', 'precomputed', 'boss' ] 

def cloudpath_error(cloudpath):
  global ALLOWED_PROTOCOLS
  global ALLOWED_FORMATS

# Path: cloudvolume/exceptions.py
# class UnsupportedProtocolError(ValueError):
#   """Unknown protocol extension."""
#   pass
# 
# Path: cloudvolume/lib.py
# def yellow(text):
#   return colorize('yellow', text)
# 
# def toabs(path):
#   path = os.path.expanduser(path)
#   return os.path.abspath(path)


# Path: cloudvolume/paths.py
import cloudfiles.paths
import os
import posixpath
import re
import sys
from collections import namedtuple
from .exceptions import UnsupportedProtocolError
from .lib import yellow, toabs




ExtractedPath = namedtuple('ExtractedPath', 
  ('format', 'protocol', 'bucket', 'basepath', 'no_bucket_basepath', 'dataset', 'layer')
)

ALLOWED_PROTOCOLS = cloudfiles.paths.ALLOWED_PROTOCOLS
ALLOWED_FORMATS = [ 'graphene', 'precomputed', 'boss' ] 

def cloudpath_error(cloudpath):
  global ALLOWED_PROTOCOLS
  global ALLOWED_FORMATS

  return yellow("""