
__authors__ = [
  '"Pawel Solyga" <pawel.solyga@gmail.com>',
  ]


import logging

from functools import wraps

from google.appengine.runtime import DeadlineExceededError

from django import http


def view(func):
  """Decorator that insists that exceptions are handled by view."""
  @wraps(func)
  def view_wrapper(request, *args, **kwds):
    try:
      return func(request, *args, **kwds)
    except DeadlineExceededError:
      logging.exception('DeadlineExceededError')
      return http.HttpResponse('DeadlineExceededError')
    except MemoryError:
      logging.exception('MemoryError')
      return http.HttpResponse('MemoryError')
    except AssertionError:
      logging.exception('AssertionError')
      return http.HttpResponse('AssertionError')

  return view_wrapper

__authors__ = [
  '"Pawel Solyga" <pawel.solyga@gmail.com>',
  ]


import logging

from functools import wraps

from google.appengine.runtime import DeadlineExceededError

from django import http


def view(func):
  """Decorator that insists that exceptions are handled by view."""
  @wraps(func)
  def view_wrapper(*args, **kwds):
    try:
      return func(*args, **kwds)
    except DeadlineExceededError:
      logging.exception('DeadlineExceededError')
      return http.HttpResponse('DeadlineExceededError')
    except MemoryError:
      logging.exception('MemoryError')
      return http.HttpResponse('MemoryError')
    except AssertionError:
      logging.exception('AssertionError')
      return http.HttpResponse('AssertionError')

  return view_wrapper
Remove not needed request argument in view decorator.
Remove not needed request argument in view decorator.

Patch by: Pawel Solyga
Review by: to-be-reviewed

--HG--
extra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%40826

  
  __authors__ = [
    '"Pawel Solyga" <pawel.solyga@gmail.com>',
    ]
  
  
  import logging
  
  from functools import wraps
  
  from google.appengine.runtime import DeadlineExceededError
  
  from django import http
  
  
  def view(func):
    """Decorator that insists that exceptions are handled by view."""
    @wraps(func)
-   def view_wrapper(request, *args, **kwds):
+   def view_wrapper(*args, **kwds):
      try:
-       return func(request, *args, **kwds)
+       return func(*args, **kwds)
      except DeadlineExceededError:
        logging.exception('DeadlineExceededError')
        return http.HttpResponse('DeadlineExceededError')
      except MemoryError:
        logging.exception('MemoryError')
        return http.HttpResponse('MemoryError')
      except AssertionError:
        logging.exception('AssertionError')
        return http.HttpResponse('AssertionError')
  
    return view_wrapper
Remove not needed request argument in view decorator.
## Code Before:

__authors__ = [
  '"Pawel Solyga" <pawel.solyga@gmail.com>',
  ]


import logging

from functools import wraps

from google.appengine.runtime import DeadlineExceededError

from django import http


def view(func):
  """Decorator that insists that exceptions are handled by view."""
  @wraps(func)
  def view_wrapper(request, *args, **kwds):
    try:
      return func(request, *args, **kwds)
    except DeadlineExceededError:
      logging.exception('DeadlineExceededError')
      return http.HttpResponse('DeadlineExceededError')
    except MemoryError:
      logging.exception('MemoryError')
      return http.HttpResponse('MemoryError')
    except AssertionError:
      logging.exception('AssertionError')
      return http.HttpResponse('AssertionError')

  return view_wrapper
## Instruction:
Remove not needed request argument in view decorator.
## Code After:

__authors__ = [
  '"Pawel Solyga" <pawel.solyga@gmail.com>',
  ]


import logging

from functools import wraps

from google.appengine.runtime import DeadlineExceededError

from django import http


def view(func):
  """Decorator that insists that exceptions are handled by view."""
  @wraps(func)
  def view_wrapper(*args, **kwds):
    try:
      return func(*args, **kwds)
    except DeadlineExceededError:
      logging.exception('DeadlineExceededError')
      return http.HttpResponse('DeadlineExceededError')
    except MemoryError:
      logging.exception('MemoryError')
      return http.HttpResponse('MemoryError')
    except AssertionError:
      logging.exception('AssertionError')
      return http.HttpResponse('AssertionError')

  return view_wrapper