You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/04/26 17:34:23 UTC
[5/9] git commit: Continue documenting allura.app.Application
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/b71e5636
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b71e5636
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b71e5636
Branch: refs/heads/cj/5655
Commit: b71e56361c4cbd9003ac7e67461fb0e2d6e4c4d4
Parents: fe2b211
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Apr 24 00:49:58 2013 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Apr 26 15:28:59 2013 +0000
----------------------------------------------------------------------
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/b71e5636/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/b71e5636/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/b71e5636/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
=====================================================================