incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [50/50] [abbrv] git commit: Continue documenting allura.app.Application
Date Wed, 24 Apr 2013 04:54:55 GMT
Continue documenting allura.app.Application


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/dd827f71
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/dd827f71
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/dd827f71

Branch: refs/heads/tv/docs
Commit: dd827f716579250b0208bb5f290887e5173229a3
Parents: 885da78
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Wed Apr 24 00:49:58 2013 -0400
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Wed Apr 24 00:52:56 2013 -0400

----------------------------------------------------------------------
 Allura/allura/app.py    |   48 ++++++++++++++++++++++++++++++++++++-----
 Allura/docs/api/app.rst |    2 -
 Allura/docs/index.rst   |    4 +-
 3 files changed, 44 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dd827f71/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index b89285e..05ad7d8 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -204,13 +204,19 @@ class Application(object):
         return ''
 
     def has_access(self, user, topic):
-        '''Whether the user has access to send email to the given topic'''
+        """Return True if ``user`` can send email to ``topic``.
+        Default is False.
+
+        :type user: :class:`allura.model.User` instance
+        :type topic: str
+        :rtype: bool
+
+        """
         return False
 
     def is_visible_to(self, user):
-        """Return whether ``user`` can view this app.
+        """Return True if ``user`` can view this app.
 
-        :param user: user to check
         :type user: :class:`allura.model.User` instance
         :rtype: bool
 
@@ -235,7 +241,12 @@ class Application(object):
 
     @classmethod
     def default_options(cls):
-        ":return: the default config options"
+        """Return a ``(name, default value)`` mapping of this Application's
+        :class:`config_options <ConfigOption>`.
+
+        :rtype: dict
+
+        """
         return dict(
             (co.name, co.default)
             for co in cls.config_options)
@@ -297,8 +308,23 @@ class Application(object):
 
     def admin_menu(self, force_options=False):
         """
-        Apps may override this to provide additional admin menu items
+        Return the admin menu for this Application.
+
+        Default implementation will return a menu with up to 3 links:
+
+            - 'Permissions', if the current user has admin access to the
+                project in which this Application is installed
+            - 'Options', if this Application has custom options, or
+                ``force_options`` is True
+            - 'Label', for editing this Application's label
+
+        Subclasses should override this method to provide additional admin
+        menu items.
+
+        :param force_options: always include an 'Options' link in the menu,
+            even if this Application has no custom options
         :return: a list of :class:`SitemapEntries <allura.app.SitemapEntry>`
+
         """
         admin_url = c.project.url()+'admin/'+self.config.options.mount_point+'/'
         links = []
@@ -310,7 +336,17 @@ class Application(object):
         return links
 
     def handle_message(self, topic, message):
-        '''Handle incoming email msgs addressed to this tool'''
+        """Handle incoming email msgs addressed to this tool.
+        Default is a no-op.
+
+        :param topic: portion of destination email address preceeding the '@'
+        :type topic: str
+        :param message: parsed email message
+        :type message: dict - result of
+            :func:`allura.lib.mail_util.parse_message`
+        :rtype: None
+
+        """
         pass
 
     def handle_artifact_message(self, artifact, message):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dd827f71/Allura/docs/api/app.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/app.rst b/Allura/docs/api/app.rst
index 688a8fa..7fcd90b 100644
--- a/Allura/docs/api/app.rst
+++ b/Allura/docs/api/app.rst
@@ -7,5 +7,3 @@
 
   .. autoclass:: Application
       :members:
-      :inherited-members:
-      :undoc-members:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dd827f71/Allura/docs/index.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/index.rst b/Allura/docs/index.rst
index 5063dac..56b1b52 100644
--- a/Allura/docs/index.rst
+++ b/Allura/docs/index.rst
@@ -63,9 +63,9 @@ API Documentation
 
 .. toctree::
    :maxdepth: 1
-      :glob:
+   :glob:
 
-      api/*
+   api/*
 
 Frequently Asked Questions
 =====================================================================


Mime
View raw message