@frappe.whitelist()
def install_app(name):
 frappe.only_for(u'System Manager')
 if (name not in frappe.get_all_apps(True)):
  if (not frappe.conf.disallow_app_listing):
   get_app(name)
   frappe.cache().delete_value([u'app_hooks'])
   import site
   reload(site)
  else:
   frappe.throw(u'Listing app not allowed')
 app_hooks = frappe.get_hooks(app_name=name)
 if app_hooks.get(u'hide_in_installer'):
  frappe.throw(_(u'You cannot install this app'))
 enqueue(u'frappe.desk.page.applications.applications.start_install', name=name)
 frappe.msgprint(_(u'Queued for install'))

@ frappe . whitelist ( ) def install_app ( name ) : frappe . only_for ( u'System Manager' ) if ( name not in frappe . get_all_apps ( True ) ) : if ( not frappe . conf . disallow_app_listing ) : get_app ( name ) frappe . cache ( ) . delete_value ( [ u'app_hooks' ] ) import site reload ( site ) else : frappe . throw ( u'Listing app not allowed' ) app_hooks = frappe . get_hooks ( app_name = name ) if app_hooks . get ( u'hide_in_installer' ) : frappe . throw ( _ ( u'You cannot install this app' ) ) enqueue ( u'frappe.desk.page.applications.applications.start_install' , name = name ) frappe . msgprint ( _ ( u'Queued for install' ) )
install a new app to site .