Author: pekka.klarck
Date: Tue Apr 7 09:46:32 2009
New Revision: 1726
Modified:
trunk/src/robot/common/handlers.py
trunk/src/robot/running/handlers.py
trunk/src/robot/running/importer.py
Log:
get handler.longname dynamically (unless it is set explicitly like with
userhandlers)
Modified: trunk/src/robot/common/handlers.py
==============================================================================
--- trunk/src/robot/common/handlers.py (original)
+++ trunk/src/robot/common/handlers.py Tue Apr 7 09:46:32 2009
@@ -22,8 +22,10 @@
class BaseHandler:
def __getattr__(self, name):
+ if name == 'longname':
+ return '%s.%s' % (self.library.name, self.name)
if name == 'shortdoc':
- return self.doc != '' and self.doc.splitlines()[0] or ''
+ return self.doc and self.doc.splitlines()[0] or ''
raise AttributeError("%s does not have attribute '%s'"
% (self.__class__.__name__, name))
Modified: trunk/src/robot/running/handlers.py
==============================================================================
--- trunk/src/robot/running/handlers.py (original)
+++ trunk/src/robot/running/handlers.py Tue Apr 7 09:46:32 2009
@@ -60,7 +60,6 @@
self.library = library
self._handler_name = handler_name
self.name = utils.printable_name(handler_name, code_style=True)
- self.longname = '%s.%s' % (library.name, self.name)
self._method = library.scope == 'GLOBAL' and \
self._get_global_handler(handler_method, handler_name) or
None
self.doc = ''
Modified: trunk/src/robot/running/importer.py
==============================================================================
--- trunk/src/robot/running/importer.py (original)
+++ trunk/src/robot/running/importer.py Tue Apr 7 09:46:32 2009
@@ -89,7 +89,6 @@
for handler in lib.handlers.values():
handcopy = copy.copy(handler)
handcopy.library = libcopy
- handcopy.longname = '%s.%s' % (libcopy.name, handcopy.name)
libcopy.handlers[handler.name] = handcopy
return libcopy