Some docstring fixes in few modules (soc.views.helper soc.views.models.base).
authorPawel Solyga <Pawel.Solyga@gmail.com>
Mon, 01 Dec 2008 12:37:16 +0000
changeset 639 1f92bd41b914
parent 638 22ec01fdf8f4
child 640 a62a78fe4e43
Some docstring fixes in few modules (soc.views.helper soc.views.models.base). Patch by: Pawel Solyga
app/soc/views/helper/access.py
app/soc/views/helper/forms.py
app/soc/views/helper/params.py
app/soc/views/helper/redirects.py
app/soc/views/models/base.py
--- a/app/soc/views/helper/access.py	Mon Dec 01 12:35:56 2008 +0000
+++ b/app/soc/views/helper/access.py	Mon Dec 01 12:37:16 2008 +0000
@@ -58,28 +58,27 @@
 
 
 def checkAccess(access_type, request, rights):
-  """Runs all the defined checks for the specified type
+  """Runs all the defined checks for the specified type.
 
   Args:
     access_type: the type of request (such as 'list' or 'edit')
     request: the Django request object
-    rights: A dictionary containing access check functions
+    rights: a dictionary containing access check functions
 
-  Rights usage: The rights dictionary is used to check if the
-    current user is allowed to view the page specified. The
-    functions defined in this dictionary are always called with the
-    django request object as argument.
-    On any request, regardless of what type, the functions in the
-    'any_access' value are called.
-    If the specified type is not in the rights dictionary, all the
-    functions in the 'unspecified' value are called.
-    When the specified type _is_ in the rights dictionary, all the
-    functions in that access_type's value are called.
+  Rights usage: 
+    The rights dictionary is used to check if the current user is allowed 
+    to view the page specified. The functions defined in this dictionary 
+    are always called with the django request object as argument. On any 
+    request, regardless of what type, the functions in the 'any_access' value 
+    are called. If the specified type is not in the rights dictionary, all 
+    the functions in the 'unspecified' value are called. When the specified 
+    type _is_ in the rights dictionary, all the functions in that access_type's 
+    value are called.
 
   Returns:
     True: If all the required access checks have been made successfully
     False: If a check failed, in this case self._response will contain
-           the response provided by the failed access check.
+      the response provided by the failed access check.
   """
 
   # Call each access checker
@@ -97,7 +96,7 @@
 
 
 def allow(request):
-  """Never returns an alternate HTTP response
+  """Never returns an alternate HTTP response.
 
   Args:
     request: a Django HTTP request
@@ -106,13 +105,14 @@
   return
 
 def deny(request):
-  """Returns an alternate HTTP response
+  """Returns an alternate HTTP response.
 
   Args:
     request: a Django HTTP request
 
-  Returns: a subclass of django.http.HttpResponse which contains the
-  alternate response that should be returned by the calling view.
+  Returns: 
+    a subclass of django.http.HttpResponse which contains the
+    alternate response that should be returned by the calling view.
   """
 
   context = helper.responses.getUniversalContext(request)
@@ -128,7 +128,7 @@
     request: a Django HTTP request
 
    Raises:
-     AccessViolationResponse: If the required authorization is not met.
+     AccessViolationResponse: if the required authorization is not met
 
   Returns:
     None if the user is logged in, or a subclass of
@@ -149,7 +149,7 @@
     request: a Django HTTP request
 
    Raises:
-     AccessViolationResponse: If the required authorization is not met.
+     AccessViolationResponse: if the required authorization is not met
 
   Returns:
     None if the user is logged in, or a subclass of
@@ -170,7 +170,7 @@
     request: a Django HTTP request
 
    Raises:
-     AccessViolationResponse: If the required authorization is not met.
+     AccessViolationResponse: if the required authorization is not met
 
   Returns:
     None if User exists for a Google Account, or a subclass of
@@ -193,10 +193,10 @@
   """Returns an alternate HTTP response if Google Account is not a Developer.
 
   Args:
-    request: A Django HTTP request
+    request: a Django HTTP request
 
    Raises:
-     AccessViolationResponse: If the required authorization is not met.
+     AccessViolationResponse: if the required authorization is not met
 
   Returns:
     None if Google Account is logged in and logged-in user is a Developer,
@@ -220,10 +220,10 @@
      for the specified program.
 
   Args:
-    request: A Django HTTP request
+    request: a Django HTTP request
 
    Raises:
-     AccessViolationResponse: If the required authorization is not met.
+     AccessViolationResponse: if the required authorization is not met
 
   Returns:
     None if Host exists for the specified program, or a subclass of
--- a/app/soc/views/helper/forms.py	Mon Dec 01 12:35:56 2008 +0000
+++ b/app/soc/views/helper/forms.py	Mon Dec 01 12:37:16 2008 +0000
@@ -320,11 +320,11 @@
   Args:
     form: The form from which the cleaned fields should be collected
 
-  Returns: All the fields that are in the form's cleaned_data
-  property are returned. If there is a key_name field, it is not
-  included in the returend fields, instead, it is returned as the
-  first element in the returned tuple. If no key_name field is
-  present, None is returned as first value instead.
+  Returns: 
+    All the fields that are in the form's cleaned_data property are returned. 
+    If there is a key_name field, it is not included in the returend fields, 
+    instead, it is returned as the first element in the returned tuple. 
+    If no key_name field is present, None is returned as first value instead.
   """
 
   fields = {}
--- a/app/soc/views/helper/params.py	Mon Dec 01 12:35:56 2008 +0000
+++ b/app/soc/views/helper/params.py	Mon Dec 01 12:37:16 2008 +0000
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""Params related methods
+"""Params related methods.
 """
 
 __authors__ = [
@@ -46,7 +46,7 @@
 
   Params usage:
     The params dictionary is passed to getCreateForm and getEditForm,
-      see their docstring on how they use it.
+    see their docstring on how they use it.
 
     rights: The rights value is merged with a default rights
       dictionary and then used as rights value.
@@ -179,7 +179,7 @@
   return params
 
 def getCreateForm(params):
-  """Constructs a new CreateForm using params
+  """Constructs a new CreateForm using params.
 
   Params usage:
     dynabase: The dynabase value is used as the base argument to
@@ -201,7 +201,7 @@
   return create_form
 
 def getEditForm(params):
-  """Constructs a new EditForm using params
+  """Constructs a new EditForm using params.
 
   Params usage:
     create_form: The dynabase value is used as the dynaform argument
@@ -221,11 +221,11 @@
   return edit_form
 
 def getKeyFieldsPattern(params):
-  """Returns the Django pattern for this View's entity
+  """Returns the Django pattern for this View's entity.
 
   Params usage:
     key_fields_prefix: The key_fields_prefix value is used as the
-    first part of the returned pattern.
+      first part of the returned pattern.
   """
 
   names = params['logic'].getKeyFieldNames()
--- a/app/soc/views/helper/redirects.py	Mon Dec 01 12:35:56 2008 +0000
+++ b/app/soc/views/helper/redirects.py	Mon Dec 01 12:37:16 2008 +0000
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""Redirect related methods
+"""Redirect related methods.
 """
 
 __authors__ = [
--- a/app/soc/views/models/base.py	Mon Dec 01 12:35:56 2008 +0000
+++ b/app/soc/views/models/base.py	Mon Dec 01 12:37:16 2008 +0000
@@ -211,7 +211,7 @@
       return self.editGet(request, entity, context, seed, params)
 
   def editPost(self, request, entity, context, params):
-    """Processes POST requests for the specified entity
+    """Processes POST requests for the specified entity.
 
     Params usage:
       The params dictionary is passed to _constructResponse when the
@@ -273,11 +273,11 @@
         params=page_params)
 
   def editGet(self, request, entity, context, seed, params):
-    """Processes GET requests for the specified entity
+    """Processes GET requests for the specified entity.
 
     Params usage:
       The params dictionary is passed to _constructResponse, see the
-        docstring  of _constructResponse on how it uses it.
+      docstring  of _constructResponse on how it uses it.
 
       save_message: The save_message list is used as argument to
         getSingleIndexedParamValue when an existing entity was saved.
@@ -346,10 +346,9 @@
 
     Params usage:
       The params dictionary is passed as argument to getListContent in
-        the soc.views.helper.list module. See the docstring for
-        getListContent on how it uses it.
-      The params dictionary is also passed as argument to the _list
-        method. See the docstring for _list on how it uses it.
+      the soc.views.helper.list module. See the docstring for getListContent 
+      on how it uses it. The params dictionary is also passed as argument to 
+      the _list method. See the docstring for _list on how it uses it.
 
       rights: The rights dictionary is used to check if the user has
         the required rights to list all entities of this View's type.
@@ -370,7 +369,7 @@
     return self._list(request, params, contents, page_name)
 
   def _list(self, request, params, contents, page_name):
-    """Returns the list page for the specified contents
+    """Returns the list page for the specified contents.
 
     Args:
       request: the standard Django HTTP request object
@@ -410,9 +409,9 @@
 
     Params usage:
       rights: The rights dictionary is used to check if the user has
-        the required rights to delete the specified entity.
-        See checkAccess for more details on how the rights dictionary
-        is used to check access rights.
+        the required rights to delete the specified entity. See checkAccess 
+        for more details on how the rights dictionary is used to check access 
+        rights.
       name: used in the same way as in edit(), see it's docstring for
         a more detailed explanation on how it is used.
       missing_redirect: see name
@@ -464,7 +463,7 @@
 
     Args:
       request: the django request object
-      entity:  the entity to create or update from POST contents
+      entity: the entity to create or update from POST contents
       fields: the new field values
     """
 
@@ -551,8 +550,8 @@
 
     Params usage:
       The params dictionary is passed as argument to getSidebarItems
-        from the soc.views.sitemap.sidebar module, see the docstring
-        of _getSidebarItems on how it uses it.
+      from the soc.views.sitemap.sidebar module, see the docstring
+      of _getSidebarItems on how it uses it.
     """
 
     params = dicts.merge(params, self._params)
@@ -563,8 +562,8 @@
 
     Params usage:
       The params dictionary is passed to the getDjangoURLPatterns
-        function in the soc.views.sitemap.sitemap module, see the
-        docstring of getDjangoURLPatterns on how it uses it.
+      function in the soc.views.sitemap.sitemap module, see the
+      docstring of getDjangoURLPatterns on how it uses it.
 
     Args:
       params: a dict with params for this View