You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/02/13 20:24:03 UTC
[2/2] git commit: [#7173] expose many model docs
[#7173] expose many model docs
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/e1055322
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e1055322
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e1055322
Branch: refs/heads/db/7173
Commit: e105532251a4d7c05650db8e03374d2d6f4eb667
Parents: f29392e
Author: Dave Brondsema <da...@brondsema.net>
Authored: Thu Feb 13 14:23:55 2014 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Thu Feb 13 14:23:55 2014 -0500
----------------------------------------------------------------------
Allura/allura/model/monq_model.py | 4 +--
Allura/allura/model/notification.py | 2 ++
Allura/allura/model/project.py | 9 ++++--
Allura/allura/model/timeline.py | 10 +++++--
Allura/allura/model/types.py | 12 +++++++-
Allura/docs/api/lib/security.rst | 2 --
Allura/docs/api/model.rst | 39 +++-----------------------
Allura/docs/api/model/artifact.rst | 43 +++++++++++++++++++++++++++++
Allura/docs/api/model/auth.rst | 30 ++++++++++++++++++++
Allura/docs/api/model/monq_model.rst | 22 +++++++++++++++
Allura/docs/api/model/neighborhood.rst | 22 +++++++++++++++
Allura/docs/api/model/notification.rst | 22 +++++++++++++++
Allura/docs/api/model/project.rst | 22 +++++++++++++++
Allura/docs/api/model/session.rst | 22 +++++++++++++++
Allura/docs/api/model/timeline.rst | 22 +++++++++++++++
Allura/docs/api/model/types.rst | 22 +++++++++++++++
16 files changed, 260 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/allura/model/monq_model.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/monq_model.py b/Allura/allura/model/monq_model.py
index d4359f5..a04bc38 100644
--- a/Allura/allura/model/monq_model.py
+++ b/Allura/allura/model/monq_model.py
@@ -55,8 +55,8 @@ class MonQTask(MappedClass):
- task_name - full dotted name of the task function to run
- process - identifier for which taskd process is working on the task
- context - values used to set c.project, c.app, c.user for the task
- - args - *args to be sent to the task function
- - kwargs - **kwargs to be sent to the task function
+ - args - ``*args`` to be sent to the task function
+ - kwargs - ``**kwargs`` to be sent to the task function
- result - if the task is complete, the return value. If in error, the traceback.
'''
states = ('ready', 'busy', 'error', 'complete', 'skipped')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/allura/model/notification.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/notification.py b/Allura/allura/model/notification.py
index cbacc3a..d0e9f29 100644
--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -18,11 +18,13 @@
'''Manage notifications and subscriptions
When an artifact is modified:
+
- Notification generated by tool app
- Search is made for subscriptions matching the notification
- Notification is added to each matching subscriptions' queue
Periodically:
+
- For each subscriptions with notifications and direct delivery:
- For each notification, enqueue as a separate email message
- Clear subscription's notification list
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 21b4792..26291be 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -158,6 +158,11 @@ class ProjectMapperExtension(MapperExtension):
class Project(MappedClass, ActivityNode, ActivityObject):
+ '''
+ Projects contain tools, subprojects, and their own metadata. They live
+ in exactly one :class:`~allura.model.neighborhood.Neighborhood`
+ '''
+
_perms_base = ['read', 'update', 'admin', 'create']
_perms_init = _perms_base + ['register']
@@ -544,7 +549,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
return new_tools
def grouped_navbar_entries(self):
- """Return a ``allura.app.SitemapEntry`` list suitable for rendering
+ """Return a :class:`~allura.app.SitemapEntry` list suitable for rendering
the project navbar with tools grouped together by tool type.
"""
# get orginal (non-grouped) navbar entries
@@ -967,7 +972,7 @@ class AppConfig(MappedClass, ActivityObject):
"""
Configuration information for an instantiated :class:`Application <allura.app.Application>`
- in a project
+ in a :class:`Project`
:var options: an object on which various options are stored. options.mount_point is the url component for this app instance
:var acl: a dict that maps permissions (strings) to lists of roles that have the permission
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/allura/model/timeline.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/timeline.py b/Allura/allura/model/timeline.py
index ed059a9..7530221 100644
--- a/Allura/allura/model/timeline.py
+++ b/Allura/allura/model/timeline.py
@@ -69,6 +69,9 @@ class ActivityNode(NodeBase):
class ActivityObject(ActivityObjectBase):
+ '''
+ Allura's base activity class.
+ '''
@property
def activity_name(self):
@@ -113,10 +116,11 @@ class TransientActor(NodeBase, ActivityObjectBase):
def perm_check(user):
+ """
+ Return a function that returns True if ``user`` has 'read' access to a given activity,
+ otherwise returns False.
+ """
def _perm_check(activity):
- """Return True if c.user has 'read' access to this activity,
- otherwise return False.
- """
extras_dict = activity.obj.activity_extras
if not extras_dict:
return True
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/allura/model/types.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/types.py b/Allura/allura/model/types.py
index 12df733..be4b48e 100644
--- a/Allura/allura/model/types.py
+++ b/Allura/allura/model/types.py
@@ -33,8 +33,15 @@ class MarkdownCache(S.Object):
class ACE(S.Object):
+ '''
+ Access Control Entry
+
+ :var access: either ``ACE.ALLOW`` or ``ACE.DENY``
+ :var str reason: optional, user-entered text
+ :var role_id: _id for a :class:`~allura.model.auth.ProjectRole`
+ :var str permission: e.g. 'read', 'create', etc
+ '''
- '''ACE - access control entry'''
ALLOW, DENY = 'ALLOW', 'DENY'
def __init__(self, permissions, **kwargs):
@@ -75,6 +82,9 @@ class ACE(S.Object):
class ACL(S.Array):
+ '''
+ Access Control List. Is an array of :class:`ACE`
+ '''
def __init__(self, permissions=None, **kwargs):
super(ACL, self).__init__(
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/lib/security.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/lib/security.rst b/Allura/docs/api/lib/security.rst
index eb8ead3..08c9ba4 100644
--- a/Allura/docs/api/lib/security.rst
+++ b/Allura/docs/api/lib/security.rst
@@ -15,8 +15,6 @@
specific language governing permissions and limitations
under the License.
-.. _spam_module:
-
:mod:`allura.lib.security`
-------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model.rst b/Allura/docs/api/model.rst
index 363b85e..55cb5e4 100644
--- a/Allura/docs/api/model.rst
+++ b/Allura/docs/api/model.rst
@@ -20,40 +20,9 @@
:mod:`allura.model`
--------------------------------
-.. automodule:: allura.model
+.. toctree::
+ :maxdepth: 1
+ :glob:
- .. automodule:: allura.model.artifact
-
- .. autoclass:: Artifact
- :members:
- :special-members: __json__
-
- .. autoclass:: Snapshot
- :members:
-
- .. autoclass:: VersionedArtifact
- :members:
-
- .. autoclass:: Message
- :members:
-
- .. autoclass:: Feed
- :members:
-
- .. autoclass:: VotableArtifact
- :members:
-
- .. autoclass:: MovedArtifact
- :members:
-
- .. automodule:: allura.model.auth
-
- .. autoclass:: User
- :members:
-
- .. autoclass:: ProjectRole
- :members:
-
- .. autoclass:: AuditLog
- :members:
+ model/*
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/artifact.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/artifact.rst b/Allura/docs/api/model/artifact.rst
new file mode 100644
index 0000000..0b6b217
--- /dev/null
+++ b/Allura/docs/api/model/artifact.rst
@@ -0,0 +1,43 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.artifact`
+-------------------------------------
+
+.. automodule:: allura.model.artifact
+
+ .. autoclass:: Artifact
+ :members:
+ :special-members: __json__
+
+ .. autoclass:: Snapshot
+ :members:
+
+ .. autoclass:: VersionedArtifact
+ :members:
+
+ .. autoclass:: Message
+ :members:
+
+ .. autoclass:: Feed
+ :members:
+
+ .. autoclass:: VotableArtifact
+ :members:
+
+ .. autoclass:: MovedArtifact
+ :members:
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/auth.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/auth.rst b/Allura/docs/api/model/auth.rst
new file mode 100644
index 0000000..c25a8f7
--- /dev/null
+++ b/Allura/docs/api/model/auth.rst
@@ -0,0 +1,30 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.auth`
+-------------------------------------
+
+.. automodule:: allura.model.auth
+
+ .. autoclass:: User
+ :members:
+
+ .. autoclass:: ProjectRole
+ :members:
+
+ .. autoclass:: AuditLog
+ :members:
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/monq_model.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/monq_model.rst b/Allura/docs/api/model/monq_model.rst
new file mode 100644
index 0000000..2d0a359
--- /dev/null
+++ b/Allura/docs/api/model/monq_model.rst
@@ -0,0 +1,22 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.monq_model`
+-------------------------------------
+
+.. automodule:: allura.model.monq_model
+ :members:
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/neighborhood.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/neighborhood.rst b/Allura/docs/api/model/neighborhood.rst
new file mode 100644
index 0000000..8eb82dd
--- /dev/null
+++ b/Allura/docs/api/model/neighborhood.rst
@@ -0,0 +1,22 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.neighborhood`
+-------------------------------------
+
+.. automodule:: allura.model.neighborhood
+ :members:
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/notification.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/notification.rst b/Allura/docs/api/model/notification.rst
new file mode 100644
index 0000000..a6eac74
--- /dev/null
+++ b/Allura/docs/api/model/notification.rst
@@ -0,0 +1,22 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.notification`
+-------------------------------------
+
+.. automodule:: allura.model.notification
+ :members:
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/project.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/project.rst b/Allura/docs/api/model/project.rst
new file mode 100644
index 0000000..1e2a16f
--- /dev/null
+++ b/Allura/docs/api/model/project.rst
@@ -0,0 +1,22 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.project`
+-------------------------------------
+
+.. automodule:: allura.model.project
+ :members:
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/session.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/session.rst b/Allura/docs/api/model/session.rst
new file mode 100644
index 0000000..626ce03
--- /dev/null
+++ b/Allura/docs/api/model/session.rst
@@ -0,0 +1,22 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.session`
+-------------------------------------
+
+.. automodule:: allura.model.session
+ :members:
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/timeline.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/timeline.rst b/Allura/docs/api/model/timeline.rst
new file mode 100644
index 0000000..2caeb29
--- /dev/null
+++ b/Allura/docs/api/model/timeline.rst
@@ -0,0 +1,22 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.timeline`
+-------------------------------------
+
+.. automodule:: allura.model.timeline
+ :members:
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e1055322/Allura/docs/api/model/types.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/model/types.rst b/Allura/docs/api/model/types.rst
new file mode 100644
index 0000000..e77dbf3
--- /dev/null
+++ b/Allura/docs/api/model/types.rst
@@ -0,0 +1,22 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+:mod:`allura.model.types`
+-------------------------------------
+
+.. automodule:: allura.model.types
+ :members:
\ No newline at end of file