fix: "function"al programming++

This commit is contained in:
Gavin D'souza 2021-02-03 18:01:35 +05:30 committed by abhishek
parent db6fc6a5fb
commit c3be3d35e8

View file

@ -59,9 +59,10 @@ def sync_for(app_name, force=0, sync_everything = False, verbose=False, reset_pe
for module_name in frappe.local.app_modules.get(app_name) or []:
folder = os.path.dirname(frappe.get_module(app_name + "." + module_name).__file__)
get_doc_files(files, folder)
files = get_doc_files(files, folder, force, sync_everything, verbose=verbose)
l = len(files)
if l:
for i, doc_path in enumerate(files):
import_file_by_path(doc_path, force=force, ignore_version=True,
@ -78,6 +79,9 @@ def sync_for(app_name, force=0, sync_everything = False, verbose=False, reset_pe
def get_doc_files(files, start_path):
"""walk and sync all doctypes and pages"""
if not files:
files = []
# load in sequence - warning for devs
document_types = ['doctype', 'page', 'report', 'dashboard_chart_source', 'print_format',
'web_page', 'website_theme', 'web_form', 'web_template',
@ -95,3 +99,5 @@ def get_doc_files(files, start_path):
if os.path.exists(doc_path):
if not doc_path in files:
files.append(doc_path)
return files