]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Add `--without-apidocs` switch to `build_doc` command for quicker doc-edit/review...
authorChristopher Lenz <cmlenz@gmail.com>
Wed, 13 Jun 2007 07:48:06 +0000 (07:48 +0000)
committerChristopher Lenz <cmlenz@gmail.com>
Wed, 13 Jun 2007 07:48:06 +0000 (07:48 +0000)
doc/formatting.txt
setup.py

index 5b2dba45ce4b2011ae974ddb0a73ce4c0785bf7c..44787aa255c6efe86d0163486fc8e8601cf159db 100644 (file)
@@ -14,10 +14,12 @@ Date Formatting
 ===============
 
 When working with date and time information in Python, you commonly use the
-classes ``date``, ``datetime`` and/or ``time`` from the `datetime package`_.
+classes ``date``, ``datetime`` and/or ``time`` from the `datetime`_ package.
 Babel provides functions for locale-specific formatting of those objects in its
 ``dates`` module:
 
+.. _`datetime`: http://docs.python.org/lib/module-datetime.html
+
 .. code-block:: pycon
 
     >>> from datetime import date, datetime, time
@@ -51,8 +53,6 @@ For example:
     >>> format_date(d, format='full', locale='en')
     u'Sunday, April 1, 2007'
 
-.. _`datetime package`: http://docs.python.org/lib/module-datetime.html
-
 
 Pattern Syntax
 --------------
index a6e1fccfa120d9315d0ca34123777f99dcbfd433..b27adc9f58cd841037ff94d70b3cfe616a31fdab 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -25,10 +25,14 @@ import sys
 
 class build_doc(Command):
     description = 'Builds the documentation'
-    user_options = []
+    user_options = [
+        ('without-apidocs', None,
+         "whether to skip the generation of API documentaton"),
+    ]
+    boolean_options = ['without-apidocs']
 
     def initialize_options(self):
-        pass
+        self.without_apidocs = False
 
     def finalize_options(self):
         pass
@@ -67,20 +71,21 @@ class build_doc(Command):
                                 argv=['--config=%s' % docutils_conf, source,
                                       dest])
 
-        try:
-            from epydoc import cli
-            old_argv = sys.argv[1:]
-            sys.argv[1:] = [
-                '--config=%s' % epydoc_conf,
-                '--no-private', # epydoc bug, not read from config
-                '--simple-term',
-                '--verbose'
-            ]
-            cli.cli()
-            sys.argv[1:] = old_argv
-
-        except ImportError:
-            print 'epydoc not installed, skipping API documentation.'
+        if not self.without_apidocs:
+            try:
+                from epydoc import cli
+                old_argv = sys.argv[1:]
+                sys.argv[1:] = [
+                    '--config=%s' % epydoc_conf,
+                    '--no-private', # epydoc bug, not read from config
+                    '--simple-term',
+                    '--verbose'
+                ]
+                cli.cli()
+                sys.argv[1:] = old_argv
+
+            except ImportError:
+                print 'epydoc not installed, skipping API documentation.'
 
 
 class test_doc(Command):