def caller_name(skip=2):
 stack = inspect.stack()
 start = (0 + skip)
 if (len(stack) < (start + 1)):
  return ''
 parentframe = stack[start][0]
 name = []
 module = inspect.getmodule(parentframe)
 if module:
  name.append(module.__name__)
 if ('self' in parentframe.f_locals):
  name.append(parentframe.f_locals['self'].__class__.__name__)
 codename = parentframe.f_code.co_name
 if (codename != '<module>'):
  name.append(codename)
 del parentframe
 return '.'.join(name)

def caller_name ( skip = 2 ) : stack = inspect . stack ( ) start = ( 0 + skip ) if ( len ( stack ) < ( start + 1 ) ) : return '' parentframe = stack [ start ] [ 0 ] name = [ ] module = inspect . getmodule ( parentframe ) if module : name . append ( module . __name__ ) if ( 'self' in parentframe . f_locals ) : name . append ( parentframe . f_locals [ 'self' ] . __class__ . __name__ ) codename = parentframe . f_code . co_name if ( codename != '<module>' ) : name . append ( codename ) del parentframe return '.' . join ( name )
get name of a caller in the format module .