Commits

ddbennett  committed c0ca5a0

Removed PistonResponse

  • Participants
  • Parent commits 407bba6

Comments (0)

Files changed (2)

File piston/resource.py

 from handler import typemapper
 from doc import HandlerMethod
 from authentication import NoAuthentication
-from utils import (
-    coerce_put_post, FormValidationError, HttpStatusCode, rc, format_error,
-    translate_mime, MimerDataException, PistonResponse)
+from utils import coerce_put_post, FormValidationError, HttpStatusCode
+from utils import rc, format_error, translate_mime, MimerDataException
 from validate_jsonp import is_valid_jsonp_callback_value
 
 CHALLENGE = object()
 
         kwargs.pop('emitter_format', None)
 
-
         try:
             emitter, ct = Emitter.get(em_format)
             fields = handler.fields
             result.content = "Invalid output format specified '%s'." % em_format
             return result
 
-
         # Clean up the request object a bit, since we might
         # very well have `oauth_`-headers in there, and we
         # don't want to pass these along to the handler.
         if hasattr(handler, 'list_fields') and isinstance(result, (list, tuple, QuerySet)):
             fields = handler.list_fields
 
-
         srl = emitter(result, typemapper, handler, fields, anonymous)
 
         try:

File piston/utils.py

         return f(self, request, *args, **kwargs)
     return wrap
 
-require_extended = require_mime('json', 'yaml', 'xml', 'pickle')
-
-
-class PistonResponse:
-    """Container class for a single object.
-
-    Intended to be used for passing enhanced attributes into Piston without
-    accessing private members.
-
-    """
-    def __init__(self, content, status=200):
-        self.content = content
-        self.headers = {}
-        self.status = status
-
-    def __iter__(self):
-        yield self.content
-
-    def __getitem__(self, item):
-        return self.headers[item]
-
-    def __setitem__(self, item, value):
-        self.headers[item] = value
-
-    def keys(self):
-        self.headers.keys()
-
-    def items(self):
-        self.headers.items()
+require_extended = require_mime('json', 'yaml', 'xml', 'pickle')