from . import zipmirror
from . import imgmirror
from . import cssmirror
from os.path import splitext

def mirrorselect(filename):
  """
  Returns the best mirror the run a file through based on filename or `None`
  if no appropraite mirror is found.
  """
  if filename.startswith('__MACOSX'):
    return None

  ext = splitext(filename)[1].lower()

  if ext == '.css':
    return cssmirror.cssmirror

  if ext == '.zip':
    return zipmirror.zipmirror

  # Autogenerated from PIL 3.1.1 on 2016-03-17 using `accepted_img_exts.py`
  accepted_img_exts = ('.im', '.gif', '.grib', '.eps', '.jp2', '.tif', '.j2k',
  '.webp', '.jpx', '.fit', '.wmf', '.jpf', '.bufr', '.emf', '.ps', '.jpg',
  '.tga', '.bmp', '.tiff', '.j2c', '.h5', '.hdf', '.xbm', '.fits', '.msp',
  '.jpeg', '.ppm', '.pcx', '.jpe', '.icns', '.jfif', '.ico', '.jpc', '.pbm',
  '.pgm', '.png')

  if ext in accepted_img_exts:
    return imgmirror.imgmirror

  return None

0bb3830b7fcbdeffb365de79e7848a9f875dfc68
<mask token>

<mask token>


def mirrorselect(filename):
    """
  Returns the best mirror the run a file through based on filename or `None`
  if no appropraite mirror is found.
  """
    if filename.startswith('__MACOSX'):
        return None
    ext = splitext(filename)[1].lower()
    if ext == '.css':
        return cssmirror.cssmirror
    if ext == '.zip':
        return zipmirror.zipmirror
    accepted_img_exts = ('.im', '.gif', '.grib', '.eps', '.jp2', '.tif',
        '.j2k', '.webp', '.jpx', '.fit', '.wmf', '.jpf', '.bufr', '.emf',
        '.ps', '.jpg', '.tga', '.bmp', '.tiff', '.j2c', '.h5', '.hdf',
        '.xbm', '.fits', '.msp', '.jpeg', '.ppm', '.pcx', '.jpe', '.icns',
        '.jfif', '.ico', '.jpc', '.pbm', '.pgm', '.png')
    if ext in accepted_img_exts:
        return imgmirror.imgmirror
    return None

from . import zipmirror
from . import imgmirror
from . import cssmirror
from os.path import splitext


def mirrorselect(filename):
    """
  Returns the best mirror the run a file through based on filename or `None`
  if no appropraite mirror is found.
  """
    if filename.startswith('__MACOSX'):
        return None
    ext = splitext(filename)[1].lower()
    if ext == '.css':
        return cssmirror.cssmirror
    if ext == '.zip':
        return zipmirror.zipmirror
    accepted_img_exts = ('.im', '.gif', '.grib', '.eps', '.jp2', '.tif',
        '.j2k', '.webp', '.jpx', '.fit', '.wmf', '.jpf', '.bufr', '.emf',
        '.ps', '.jpg', '.tga', '.bmp', '.tiff', '.j2c', '.h5', '.hdf',
        '.xbm', '.fits', '.msp', '.jpeg', '.ppm', '.pcx', '.jpe', '.icns',
        '.jfif', '.ico', '.jpc', '.pbm', '.pgm', '.png')
    if ext in accepted_img_exts:
        return imgmirror.imgmirror
    return None

from . import zipmirror
from . import imgmirror
from . import cssmirror
from os.path import splitext

def mirrorselect(filename):
  """
  Returns the best mirror the run a file through based on filename or `None`
  if no appropraite mirror is found.
  """
  if filename.startswith('__MACOSX'):
    return None

  ext = splitext(filename)[1].lower()

  if ext == '.css':
    return cssmirror.cssmirror

  if ext == '.zip':
    return zipmirror.zipmirror

  # Autogenerated from PIL 3.1.1 on 2016-03-17 using `accepted_img_exts.py`
  accepted_img_exts = ('.im', '.gif', '.grib', '.eps', '.jp2', '.tif', '.j2k',
  '.webp', '.jpx', '.fit', '.wmf', '.jpf', '.bufr', '.emf', '.ps', '.jpg',
  '.tga', '.bmp', '.tiff', '.j2c', '.h5', '.hdf', '.xbm', '.fits', '.msp',
  '.jpeg', '.ppm', '.pcx', '.jpe', '.icns', '.jfif', '.ico', '.jpc', '.pbm',
  '.pgm', '.png')

  if ext in accepted_img_exts:
    return imgmirror.imgmirror

  return None
