# Path: web/core/compat.py

# 
# Path: web/core/util.py
# def safe_name(thing):
# 	"""Attempt to resolve the canonical name for an object, falling back on the `repr()` if unable to do so."""
# 	try:
# 		return name(thing)
# 	except:
# 		return repr(thing)


from io import IOBase
	from collections import Generator
from os.path import getmtime
from time import mktime, gmtime
from datetime import datetime
from mimetypes import init, add_type, guess_type
from collections import namedtuple
from webob import Request, Response
from web.core.compat import str, unicode, Path
from web.core.util import safe_name



# ## Extension

class BaseExtension(object):
	"""Base framework extension.
	
	This extension is not meant to be manually constructed or manipulated; use is automatic.
	"""
	
	first = True  # Must occur as early as possible in callback lists.
	always = True  # Always enabled.
	provides = ["base", "request", "response"]  # Export these symbols for use as other extension's dependencies.
	
	# ### Application-Level Callbacks
	
	def start(self, context):
		if __debug__:
			log.debug("Registering core return value handlers.")
		
		# This prepares the mimetypes registry, and adds values typically missing from it.
		init()
		add_type('text/x-yaml', 'yml')
		add_type('text/x-yaml', 'yaml')
		
		# Register the core views supported by the base framework.
		register = context.view.register
		register(type(None), self.render_none)
		register(Response, self.render_response)

# Path: web/core/compat.py

# 
# Path: web/core/util.py
# def safe_name(thing):
# 	"""Attempt to resolve the canonical name for an object, falling back on the `repr()` if unable to do so."""
# 	try:
# 		return name(thing)
# 	except:
# 		return repr(thing)


# Path: web/ext/base.py
from io import IOBase
	from collections import Generator
from os.path import getmtime
from time import mktime, gmtime
from datetime import datetime
from mimetypes import init, add_type, guess_type
from collections import namedtuple
from webob import Request, Response
from web.core.compat import str, unicode, Path
from web.core.util import safe_name




# ## Extension

class BaseExtension(object):
	"""Base framework extension.
	
	This extension is not meant to be manually constructed or manipulated; use is automatic.
	"""
	
	first = True  # Must occur as early as possible in callback lists.
	always = True  # Always enabled.
	provides = ["base", "request", "response"]  # Export these symbols for use as other extension's dependencies.
	
	# ### Application-Level Callbacks
	
	def start(self, context):
		if __debug__:
			log.debug("Registering core return value handlers.")
		
		# This prepares the mimetypes registry, and adds values typically missing from it.
		init()
		add_type('text/x-yaml', 'yml')
		add_type('text/x-yaml', 'yaml')
		
		# Register the core views supported by the base framework.
		register = context.view.register
		register(type(None), self.render_none)
		register(Response, self.render_response)

		register(str, self.render_binary)