# Path: armet/serializers/base.py
# class Serializer(object):
# 
#     #! Applicable media types for this serializer.
#     media_types = ()
# 
#     def __init__(self, request=None, response=None):
#         #! The request and response objects to use.
#         self.request = request
#         self.response = response
# 
#     def can_serialize(self, data=None):
#         """Tests this serializer to see if it can serialize."""
#         try:
#             # Attet to serialize the object.
#             self.serialize(data)
# 
#             # The serialization process is assumed to have succeed.
#             return True
# 
#         except ValueError:
#             # The object was of an unsupported type.
#             return False
# 
#     def serialize(self, data=None):
#         """
#         Transforms the object into an acceptable format for transmission.
# 
#         @throws ValueError
#             To indicate this serializer does not support the encoding of the
#             specified object.
#         """
#         if data is not None and self.response is not None:
#             # Set the content type.
#             self.response['Content-Type'] = self.media_types[0]
# 
#             # Write the encoded and prepared data to the response.
#             self.response.write(data)
# 
#         # Return the serialized data.
#         # This has normally been transformed by a base class.
#         return data
# 
# Path: armet/media_types.py
# FORM_DATA = 'multipart/form-data',
# URL = 'application/x-www-form-urlencoded',
# JSON = (
#     # Offical; as per RFC 4627.
#     'application/json',
# 
#     # Widely used (thanks <http://www.json.org/JSONRequest.html>.)
#     'application/jsonrequest',
# 
#     # Miscellaneous mimetypes that are used frequently (incorrectly).
#     'application/x-json',
#     'text/json; charset=utf-8',
# 
#     # Widely used (incorrectly) thanks to ruby.
#     'text/x-json; charset=utf-8',
# )
# XML = (
#     # To be used when the XML is NOT human-readable as per RFC 3023.
#     # Our XML is not considered human-readable as it is minified before
#     # transfer.
#     'application/xml',
# 
#     # To be used when the XML is human-readable as per RFC 3023.
#     'text/xml; charset=utf-8',
# )
# YAML = (
#     'application/x-yaml',
#     'application/yaml',
#     'text/yaml; charset=utf-8',
#     'text/x-yaml; charset=utf-8',
# )


import six
from .base import Serializer
from armet import media_types
    from urllib.parse import urlencode
    from urllib import urlencode
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division

# Import urlencode
if six.PY3:

else:


class URLSerializer(Serializer):


# Path: armet/serializers/base.py
# class Serializer(object):
# 
#     #! Applicable media types for this serializer.
#     media_types = ()
# 
#     def __init__(self, request=None, response=None):
#         #! The request and response objects to use.
#         self.request = request
#         self.response = response
# 
#     def can_serialize(self, data=None):
#         """Tests this serializer to see if it can serialize."""
#         try:
#             # Attet to serialize the object.
#             self.serialize(data)
# 
#             # The serialization process is assumed to have succeed.
#             return True
# 
#         except ValueError:
#             # The object was of an unsupported type.
#             return False
# 
#     def serialize(self, data=None):
#         """
#         Transforms the object into an acceptable format for transmission.
# 
#         @throws ValueError
#             To indicate this serializer does not support the encoding of the
#             specified object.
#         """
#         if data is not None and self.response is not None:
#             # Set the content type.
#             self.response['Content-Type'] = self.media_types[0]
# 
#             # Write the encoded and prepared data to the response.
#             self.response.write(data)
# 
#         # Return the serialized data.
#         # This has normally been transformed by a base class.
#         return data
# 
# Path: armet/media_types.py
# FORM_DATA = 'multipart/form-data',
# URL = 'application/x-www-form-urlencoded',
# JSON = (
#     # Offical; as per RFC 4627.
#     'application/json',
# 
#     # Widely used (thanks <http://www.json.org/JSONRequest.html>.)
#     'application/jsonrequest',
# 
#     # Miscellaneous mimetypes that are used frequently (incorrectly).
#     'application/x-json',
#     'text/json; charset=utf-8',
# 
#     # Widely used (incorrectly) thanks to ruby.
#     'text/x-json; charset=utf-8',
# )
# XML = (
#     # To be used when the XML is NOT human-readable as per RFC 3023.
#     # Our XML is not considered human-readable as it is minified before
#     # transfer.
#     'application/xml',
# 
#     # To be used when the XML is human-readable as per RFC 3023.
#     'text/xml; charset=utf-8',
# )
# YAML = (
#     'application/x-yaml',
#     'application/yaml',
#     'text/yaml; charset=utf-8',
#     'text/x-yaml; charset=utf-8',
# )


# Path: armet/serializers/url.py
import six
from .base import Serializer
from armet import media_types
    from urllib.parse import urlencode
    from urllib import urlencode

# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division

# Import urlencode
if six.PY3:

else:


class URLSerializer(Serializer):


    media_types = media_types.URL