Merged upstream default tip
authorDmitriy Morozov <dmitriy@mrzv.org>
Mon, 04 Apr 2011 12:56:15 -0700
changeset 189 a46bf1c7f346
parent 182 f8a82de0540d (current diff)
parent 188 8ee4c9ad1325 (diff)
Merged upstream
opster.py
--- a/.hgsubstate	Thu Feb 24 22:58:28 2011 -0800
+++ b/.hgsubstate	Mon Apr 04 12:56:15 2011 -0700
@@ -1,1 +1,1 @@
-f333de6a34145b7fd49d6c2eac74a7189c0b6f15 docs/cleanery
+ede31bfb2f2b4f99f4225ede6c2391167d953654 docs/cleanery
--- a/.hgtags	Thu Feb 24 22:58:28 2011 -0800
+++ b/.hgtags	Mon Apr 04 12:56:15 2011 -0700
@@ -17,3 +17,4 @@
 b8f101500f1d030a4b1e9f586136fdfa38de1f62 1.2
 a8a8ae1a3fbe7c27e90f5ae2fef09d78a8327c24 2.0
 a083e23ed554dd9d85d4f3362b9658acf1325259 2.1
+5e96ab1087daf4b9e5c68b58302b421f3c8aeeba 2.2
--- a/Makefile	Thu Feb 24 22:58:28 2011 -0800
+++ b/Makefile	Mon Apr 04 12:56:15 2011 -0700
@@ -3,10 +3,14 @@
 help:
 	@echo "Use \`make <target>\` with one of targets:"
 	@echo "  docs  build docs"
+	@echo "  open  open docs"
 	@echo "  arch  update archlinux pkgbuild"
 
 docs:
 	cd docs && make
 
+open:
+	cd docs && make open
+
 arch:
 	python contrib/updatepkg.py
--- a/docs/changelog.rst	Thu Feb 24 22:58:28 2011 -0800
+++ b/docs/changelog.rst	Mon Apr 04 12:56:15 2011 -0700
@@ -1,6 +1,16 @@
 Changelog
 ---------
 
+2.2 (2010.03.23)
+~~~~~~~~~~~~~~~~
+
+ - adjust indentation level in multiline docstrings (compare `1`_ and `2`_)
+ - small fix for internal getopt exception handling
+
+.. _1: http://solovyov.net/opster/tests.html#multihelp1
+.. _2: http://solovyov.net/opster/tests.html#multihelp2
+
+
 2.1 (2010.01.23)
 ~~~~~~~~~~~~~~~~
 
--- a/opster.py	Thu Feb 24 22:58:28 2011 -0800
+++ b/opster.py	Mon Apr 04 12:56:15 2011 -0700
@@ -6,7 +6,7 @@
 from itertools import imap
 
 __all__ = ['command', 'dispatch']
-__version__ = '2.1'
+__version__ = '2.2'
 __author__ = 'Alexander Solovyov'
 __email__ = 'piranha@piranha.org.ua'
 
@@ -413,12 +413,8 @@
 
     possibleopts.extend(globalopts)
 
-    try:
-        options, args = parse(args, possibleopts)
-    except getopt.GetoptError, e:
-        raise ParseError(cmd, e)
-
-    return (cmd, cmd and info[0] or None, args, options)
+    options, args = parse(args, possibleopts)
+    return cmd, cmd and info[0] or None, args, options
 
 def aliases_(cmdtable_key):
     '''Get aliases from a command table key'''
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/hello.py	Mon Apr 04 12:56:15 2011 -0700
@@ -0,0 +1,14 @@
+from opster import command
+
+@command(usage="%name [options]")
+def hello(name=('n', 'world', 'your name')):
+    """
+    Hello world continues the long established tradition
+    of delivering simple, but working programs in all
+    kinds of programming languages.
+    """
+    print "Hello %s" % name
+
+if __name__ == "__main__":
+    hello()
+
--- a/tests/opster.t	Thu Feb 24 22:58:28 2011 -0800
+++ b/tests/opster.t	Mon Apr 04 12:56:15 2011 -0700
@@ -7,6 +7,7 @@
 This is a test suite for opster library. Just read it to get some idea of how it
 works.
 
+.. highlight:: console
 
 Actors cast
 -----------
@@ -40,6 +41,8 @@
   $ run multicommands.py simple
   ['test', 'ui']
 
+.. _multihelp1:
+
 Yeah, nice one, but we know that command ``complex`` is just hidden there. Let's
 check it out::
 
@@ -172,9 +175,13 @@
    -h --help    show help
 
 
+.. _multihelp2:
+
 Are we getting nicely stripped body when not following subject/body convention
 of writing commands?
 
+::
+
   $ run hello.py --help
   hello.py [options]