@@ -120,7 +120,6 @@ class Page(_BaseActions, _SelectorsManager, _ComponentsManager):
120120 """
121121 __metaclass__ = _PageMeta
122122
123-
124123 def __init__ (self ):
125124 """
126125 Initializes the pageobject_name variable, which is used by the _Keywords class
@@ -144,7 +143,12 @@ def __init__(self):
144143 @staticmethod
145144 @not_keyword
146145 def _titleize (str ):
147- return re .sub (r"(\w)([A-Z])" , r"\1 \2" , str )
146+ """
147+ Converts camel case to title case
148+ :param str: camel case string
149+ :return: title case string
150+ """
151+ return re .sub ('([a-z0-9])([A-Z])' , r'\1 \2' , re .sub (r"(.)([A-Z][a-z]+)" , r'\1 \2' , str ))
148152
149153 @staticmethod
150154 @not_keyword
@@ -271,16 +275,18 @@ def get_keyword_documentation(self, kwname):
271275 :return: a documentation string for kwname
272276 """
273277 if kwname == '__intro__' :
274- doc = """\n
278+ docstring = self .__doc__ if self .__doc__ else ''
279+ s2l_link = """\n
275280 All keywords listed in the Selenium2Library documentation are also available in this Page Object.
276281 See http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html
277282 """
278- return self . __doc__ + doc
283+ return docstring + s2l_link
279284 kw = getattr (self , kwname , None )
280- doc = kw . __doc__ if kw . __doc__ else ''
285+ alias = ''
281286 if kwname in _Keywords ._aliases :
282- doc = '*Alias: %s*\n \n ' % _Keywords .get_robot_aliases (kwname , self ._underscore (self .name ))[0 ].replace ('_' , ' ' ).title () + doc
283- return doc
287+ alias = '*Alias: %s*\n \n ' % _Keywords .get_robot_aliases (kwname , self ._underscore (self .name ))[0 ].replace ('_' , ' ' ).title ()
288+ docstring = kw .__doc__ if kw .__doc__ else ''
289+ return alias + docstring
284290
285291 @not_keyword
286292 def get_keyword_arguments (self , kwname ):
0 commit comments