def gen_task_name(app, name, module_name):
 module_name = (module_name or u'__main__')
 try:
  module = sys.modules[module_name]
 except KeyError:
  module = None
 if (module is not None):
  module_name = module.__name__
  if (MP_MAIN_FILE and (module.__file__ == MP_MAIN_FILE)):
   module_name = u'__main__'
 if ((module_name == u'__main__') and app.main):
  return u'.'.join([app.main, name])
 return u'.'.join((p for p in (module_name, name) if p))

def gen_task_name ( app , name , module_name ) : module_name = ( module_name or u'__main__' ) try : module = sys . modules [ module_name ] except KeyError : module = None if ( module is not None ) : module_name = module . __name__ if ( MP_MAIN_FILE and ( module . __file__ == MP_MAIN_FILE ) ) : module_name = u'__main__' if ( ( module_name == u'__main__' ) and app . main ) : return u'.' . join ( [ app . main , name ] ) return u'.' . join ( ( p for p in ( module_name , name ) if p ) )
generate task name from name/module pair .