Skip to content
Browse files

skip options based on better assumptions

  • Loading branch information...
1 parent 35095ce commit 122bcfd2ccdff433ad527a60880b38e6e50507e6 @piranha piranha committed Aug 21, 2011
Showing with 7 additions and 8 deletions.
  1. +1 −1 README.rst
  2. +5 −6 opster.py
  3. +1 −1 setup.py
View
2 README.rst
@@ -33,7 +33,7 @@ That's an example of an option definition::
if __name__ == '__main__':
main.command()
-Running this program will print the help::
+Running this program will print help message::
> ./echo.py
echo.py: invalid arguments
View
11 opster.py
@@ -517,12 +517,11 @@ def func(longname=(shortname, default, help)):
'''
args, _, _, defaults = inspect.getargspec(func)
for name, option in zip(args[-len(defaults):], defaults):
- try:
- sname, default, hlp = option[:3]
- completer = option[3] if len(option) > 3 else None
- yield (sname, name_from_python(name), default, hlp, completer)
- except TypeError:
- pass
+ if not isinstance(option, tuple):
+ continue
+ sname, default, hlp = option[:3]
+ completer = option[3] if len(option) > 3 else None
+ yield (sname, name_from_python(name), default, hlp, completer)
def guess_usage(func, options):
'''Get usage definition for a function
View
2 setup.py
@@ -23,7 +23,7 @@ def desc():
version = opster.__version__,
author = opster.__author__,
author_email = opster.__email__,
- url = 'http://piranha.org.ua/opster/',
+ url = 'http://github.com/piranha/opster/',
classifiers = [
'Environment :: Console',
'Intended Audience :: Developers',

0 comments on commit 122bcfd

Please sign in to comment.
Something went wrong with that request. Please try again.