Logo Search packages:      
Sourcecode: ipython version File versions  Download package

def apigen::ApiDocWriter::_get_object_name (   self,
  line 
) [private]

Get second token in line
>>> docwriter = ApiDocWriter('sphinx')
>>> docwriter._get_object_name("  def func():  ")
'func'
>>> docwriter._get_object_name("  class Klass(object):  ")
'Klass'
>>> docwriter._get_object_name("  class Klass:  ")
'Klass'

Definition at line 97 of file apigen.py.

00097                                     :
        ''' Get second token in line
        >>> docwriter = ApiDocWriter('sphinx')
        >>> docwriter._get_object_name("  def func():  ")
        'func'
        >>> docwriter._get_object_name("  class Klass(object):  ")
        'Klass'
        >>> docwriter._get_object_name("  class Klass:  ")
        'Klass'
        '''
        name = line.split()[1].split('(')[0].strip()
        # in case we have classes which are not derived from object
        # ie. old style classes
        return name.rstrip(':')

    def _uri2path(self, uri):


Generated by  Doxygen 1.6.0   Back to index