def get_current_app(frame=None):
 if (frame == None):
  frame = inspect.currentframe().f_back
 while frame:
  module = inspect.getmodule(frame.f_code)
  if (not module):
   raise Exception((('No module for code %s (frame %s). Perhaps you have an old ' + '.pyc file hanging around?') % (repr(frame.f_code), repr(frame))))
  app = get_app_for_module(module)
  if app:
   return app
  frame = frame.f_back
 return None

def get_current_app ( frame = None ) : if ( frame == None ) : frame = inspect . currentframe ( ) . f_back while frame : module = inspect . getmodule ( frame . f_code ) if ( not module ) : raise Exception ( ( ( 'No module for code %s (frame %s). Perhaps you have an old ' + '.pyc file hanging around?' ) % ( repr ( frame . f_code ) , repr ( frame ) ) ) ) app = get_app_for_module ( module ) if app : return app frame = frame . f_back return None
return the name of the app from installed_apps that is most recently present on the call stack .