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 2015/07/01 18:50:06 UTC

allura git commit: [#6373] start documenting more admin cmds

Repository: allura
Updated Branches:
  refs/heads/db/6373 [created] 8d77af178


[#6373] start documenting more admin cmds


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

Branch: refs/heads/db/6373
Commit: 8d77af17894a6118dae340345966562e769978ac
Parents: 6ba4a43
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Jul 1 12:49:45 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Jul 1 12:49:45 2015 -0400

----------------------------------------------------------------------
 Allura/allura/scripts/disable_users.py         |  3 +++
 Allura/docs/conf.py                            |  3 ++-
 Allura/docs/getting_started/administration.rst | 12 ++++++++++++
 requirements.txt                               |  1 +
 scripts/create-allura-sitemap.py               |  7 +++++--
 5 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/8d77af17/Allura/allura/scripts/disable_users.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/disable_users.py b/Allura/allura/scripts/disable_users.py
index 7eeef33..ed93833 100644
--- a/Allura/allura/scripts/disable_users.py
+++ b/Allura/allura/scripts/disable_users.py
@@ -66,5 +66,8 @@ class DisableUsers(ScriptTask):
         return parser
 
 
+def get_parser():
+    return DisableUsers.parser()
+
 if __name__ == '__main__':
     DisableUsers.main()

http://git-wip-us.apache.org/repos/asf/allura/blob/8d77af17/Allura/docs/conf.py
----------------------------------------------------------------------
diff --git a/Allura/docs/conf.py b/Allura/docs/conf.py
index c201b9c..4c55afa 100644
--- a/Allura/docs/conf.py
+++ b/Allura/docs/conf.py
@@ -41,6 +41,7 @@ import os
 
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
               'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig']
+extensions += ['sphinxarg.ext']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
@@ -56,7 +57,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = 'Apache Allura'
-copyright = '2012-2014 The Apache Software Foundation'
+copyright = '2012-2015 The Apache Software Foundation'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the

http://git-wip-us.apache.org/repos/asf/allura/blob/8d77af17/Allura/docs/getting_started/administration.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/administration.rst b/Allura/docs/getting_started/administration.rst
index 4410f55..4a48c71 100644
--- a/Allura/docs/getting_started/administration.rst
+++ b/Allura/docs/getting_started/administration.rst
@@ -62,6 +62,18 @@ See the listing of :mod:`some available tasks <allura.tasks.admin_tasks>`.
 
 TODO: explain how to run scripttasks and commandtasks
 
+.. argparse::
+    :module: allura.scripts.disable_users
+    :func: testparser
+    :prog: paster script development.ini allura/scripts/disable_users.py --
+
+
+.. argparse::
+    :file: ../../scripts/create-allura-sitemap.py
+    :func: parser
+    :prog: paster script development.ini scripts/create-allura-sitemap.py --
+
+
 
 Client Scripts
 --------------

http://git-wip-us.apache.org/repos/asf/allura/blob/8d77af17/requirements.txt
----------------------------------------------------------------------
diff --git a/requirements.txt b/requirements.txt
index fffb91d..eab35eb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -79,4 +79,5 @@ WebTest==1.4.0
 testfixtures==3.0.0
 q==2.3
 WebError==0.10.3
+sphinx-argparse==0.1.15
 sphinx-rtd-theme==0.1.6

http://git-wip-us.apache.org/repos/asf/allura/blob/8d77af17/scripts/create-allura-sitemap.py
----------------------------------------------------------------------
diff --git a/scripts/create-allura-sitemap.py b/scripts/create-allura-sitemap.py
index f39b2a6..29220d1 100644
--- a/scripts/create-allura-sitemap.py
+++ b/scripts/create-allura-sitemap.py
@@ -142,7 +142,7 @@ def main(options):
             f.write(sitemap_index_content)
 
 
-def parse_options():
+def parser():
     import argparse
     class Validate(argparse.Action):
         def __call__(self, parser, namespace, value, option_string=None):
@@ -165,8 +165,11 @@ def parse_options():
     parser.add_argument('-n', '--neighborhood', dest='neighborhood',
                          help="URL prefix of excluded neighborhood(s)",
                          default=None, nargs='*')
+    return parser
+
+def parse_options():
+    return parser().parse_args()
 
-    return parser.parse_args()
 
 if __name__ == '__main__':
     sys.exit(main(parse_options()))