Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions commit/api/code_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ def get_name_of_app(organization, repo):
'''
Get name of app from repo
'''
type = None
file_type = None
app_name = None
root_files = get_all_files_in_repo(access_token, organization, repo)
if type(root_files) == dict and root_files.get("message", "") == "Not Found":
return frappe.throw(f'Repository {repo} not found in organization {organization}')

for file in root_files:
if file["name"] == "pyproject.toml":
type = "pyproject.toml"
file_type = "pyproject.toml"
break
elif file["name"] == "setup.py":
type = "setup.py"
file_type = "setup.py"
break

if type == "pyproject.toml":
if file_type == "pyproject.toml":
app_name = get_app_name_from_pyproject_toml(organization, repo)
elif type == "setup.py":
elif file_type == "setup.py":
app_name = get_app_name_from_setup_py(organization, repo)

return app_name
Expand Down
9 changes: 8 additions & 1 deletion commit/api/meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

@frappe.whitelist()
def get_installed_apps():
'''
Get all installed apps
1. Get the installed applications from the Installed Applications doctype
2. Get the app hooks for each app
3. Get the app description, publisher, logo, version and git branch
4. Return the updated apps
'''
install_app_doc = frappe.get_cached_doc('Installed Applications')
install_apps = install_app_doc.get('installed_applications')
updated_apps = []
Expand All @@ -18,7 +25,7 @@ def get_installed_apps():
if app_publisher is not None:
app_publisher = app_publisher[0]

app_logo_url = app_hooks.get('app_logo_url')
app_logo_url = app_hooks.get('app_logo_url') or app_hooks.get('app_logo')
if app_logo_url is not None:
app_logo_url = app_logo_url[0]

Expand Down