# Path: TileStache/py3_compat.py
# def is_string_type(val):
# 
# Path: TileStache/py3_compat.py
# def is_string_type(val):
# 
# Path: TileStache/Core.py
# class KnownUnknown(Exception):
#     """ There are known unknowns. That is to say, there are things that we now know we don't know.
# 
#         This exception gets thrown in a couple places where common mistakes are made.
#     """
#     pass


from time import time
from os.path import exists
from itertools import count
from glob import glob
from tempfile import mkstemp
from .py3_compat import reduce, urlopen, urljoin, urlparse, allocate_lock
from .py3_compat import unichr
from TileStache.Core import KnownUnknown
from TileStache.Geography import getProjectionByName
    from PIL import Image
import os
import logging
import json
    import mapnik
    import Image
known as "mapnik grid". Both require Mapnik to be installed; Grid requires
Mapnik 2.0.0 and above.
"""
from __future__ import absolute_import



# We enabled absolute_import because case insensitive filesystems
# cause this file to be loaded twice (the name of this file
# conflicts with the name of the module we want to import).
# Forcing absolute imports fixes the issue.

try:
except ImportError:
    # can still build documentation
    pass


try:
except ImportError:
    # On some systems, PIL.Image is known as Image.

if 'mapnik' in locals():
    _version = hasattr(mapnik, 'mapnik_version') and mapnik.mapnik_version() or 701

    if _version >= 20000:
        Box2d = mapnik.Box2d
    else:
        Box2d = mapnik.Envelope


# Path: TileStache/py3_compat.py
# def is_string_type(val):
# 
# Path: TileStache/py3_compat.py
# def is_string_type(val):
# 
# Path: TileStache/Core.py
# class KnownUnknown(Exception):
#     """ There are known unknowns. That is to say, there are things that we now know we don't know.
# 
#         This exception gets thrown in a couple places where common mistakes are made.
#     """
#     pass


# Path: TileStache/Mapnik.py
from time import time
from os.path import exists
from itertools import count
from glob import glob
from tempfile import mkstemp
from .py3_compat import reduce, urlopen, urljoin, urlparse, allocate_lock
from .py3_compat import unichr
from TileStache.Core import KnownUnknown
from TileStache.Geography import getProjectionByName
    from PIL import Image
import os
import logging
import json
    import mapnik
    import Image

known as "mapnik grid". Both require Mapnik to be installed; Grid requires
Mapnik 2.0.0 and above.
"""
from __future__ import absolute_import



# We enabled absolute_import because case insensitive filesystems
# cause this file to be loaded twice (the name of this file
# conflicts with the name of the module we want to import).
# Forcing absolute imports fixes the issue.

try:
except ImportError:
    # can still build documentation
    pass


try:
except ImportError:
    # On some systems, PIL.Image is known as Image.

if 'mapnik' in locals():
    _version = hasattr(mapnik, 'mapnik_version') and mapnik.mapnik_version() or 701

    if _version >= 20000:
        Box2d = mapnik.Box2d
    else:
        Box2d = mapnik.Envelope


global_mapnik_lock = allocate_lock()