Author: janne.t.harkonen
Date: Tue Nov 25 12:09:46 2008
New Revision: 1117
Modified:
trunk/tools/libdoc/libdoc.py
Log:
new argumentparser, also fixed to work with latest vesion of InitHandlers
Modified: trunk/tools/libdoc/libdoc.py
==============================================================================
--- trunk/tools/libdoc/libdoc.py (original)
+++ trunk/tools/libdoc/libdoc.py Tue Nov 25 12:09:46 2008
@@ -48,9 +48,10 @@
import re
from robot.running import TestLibrary, UserLibrary
+from robot.running.handlers import _NoInitHandler
from robot.serializing import Template, Namespace
from robot import utils
-from robot.errors import DataError
+from robot.errors import DataError, Information
def main(args):
@@ -70,11 +71,12 @@
def process_arguments(args_list):
argparser = utils.ArgumentParser(__doc__)
try:
- opts, args = argparser.parse_args(args_list,
pythonpath='pythonpath')
+ opts, args = argparser.parse_args(args_list,
pythonpath='pythonpath',
+ help='help', check_args=True)
+ except Information, msg:
+ exit(msg=str(msg))
except DataError, err:
exit(error=str(err))
- if opts['help'] or not args:
- exit(msg=__doc__)
output = opts['output'] is not None and opts['output'] or '.'
format = opts['format'] is not None and opts['format'] or 'HTML'
return os.path.abspath(output), format.upper(), args[0]
@@ -198,14 +200,14 @@
self.name = lib.name
self.version =
utils.html_escape(getattr(lib, 'version', '<unknown>'))
self.doc = self._process_doc(self._get_doc(lib))
- self.inits = self._get_initializers(lib.init)
+ self.inits = self._get_initializers(lib)
self.keywords = [ KeywordDoc(handler, self)
for handler in lib.handlers.values() ]
self.keywords.sort()
- def _get_initializers(self, lib_init):
- if lib_init:
- init = KeywordDoc(lib_init, self)
+ def _get_initializers(self, lib):
+ if lib.init and not isinstance(lib.init, _NoInitHandler):
+ init = KeywordDoc(lib.init, self)
if init.args:
return [init]
return []
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"robotframework-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/robotframework-commit?hl=en
-~----------~----~----~----~------~----~------~--~---