app: Cleaned up imports and fixed Request.blank docstring

master
Dustin C. Hatch 2012-11-30 22:01:25 -06:00
parent 47103b76a4
commit 11271ebc31
1 changed files with 18 additions and 12 deletions

View File

@ -1,11 +1,11 @@
# Copyright 2011 Dustin C. Hatch # Copyright 2011 Dustin C. Hatch
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -15,12 +15,12 @@
''' '''
from app import * from milla.app import *
from milla.auth.decorators import *
from webob.exc import * from webob.exc import *
from webob.request import * import webob
from webob.response import *
from auth.decorators import *
import urllib import urllib
import urlparse
def allow(*methods): def allow(*methods):
'''Specify the allowed HTTP verbs for a controller callable '''Specify the allowed HTTP verbs for a controller callable
@ -38,20 +38,26 @@ def allow(*methods):
return wrapper return wrapper
class Response(Response): class Response(webob.Response):
''':py:class:`WebOb Response <webob.response.Response>` with minor tweaks ''':py:class:`WebOb Response <webob.response.Response>` with minor tweaks
''' '''
class Request(Request): class Request(webob.Request):
''':py:class:`WebOb Request <webob.request.BaseRequest>` with minor tweaks ''':py:class:`WebOb Request <webob.request.BaseRequest>` with minor tweaks
''' '''
ResponseClass = Response ResponseClass = Response
@classmethod @classmethod
def blank(cls, *args, **kwargs): def blank(cls, path, *args, **kwargs):
req = super(Request, cls).blank(*args, **kwargs) '''Create a simple request for the specified path
See :py:meth:`webob.Request.blank <webob.request.BaseRequest.blank>`
for information on other arguments and keywords
'''
req = super(Request, cls).blank(path, *args, **kwargs)
req.config = {} req.config = {}
return req return req