seitime-frappe/webnotes/core/page/applications/applications.py

22 lines
643 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
@webnotes.whitelist()
def get_app_list():
out = {}
installed = webnotes.get_installed_apps()
for app in webnotes.get_all_apps(True):
out[app] = {}
app_hooks = webnotes.get_hooks(app_name=app)
for key in ("app_name", "app_title", "app_description", "app_icon",
"app_publisher", "app_version", "app_url", "app_color"):
val = app_hooks.get(key) or []
out[app][key] = val[0] if len(val) else ""
if app in installed:
out[app]["installed"] = 1
return out