def migrate(verbose=True, rebuild_website=False): '''Migrate all apps to the latest version, will: - run patches - sync doctypes (schema) - sync fixtures - sync desktop icons - sync web pages (from /www)''' clear_global_cache() # run patches frappe.modules.patch_handler.run_all() # sync frappe.model.sync.sync_all(verbose=verbose) frappe.translate.clear_cache() sync_fixtures() sync_desktop_icons() # syncs statics render.clear_cache() if rebuild_website: statics.sync(verbose=verbose).start(True) else: statics.sync_statics() frappe.db.commit() clear_notifications() frappe.publish_realtime("version-update")
def build_website(verbose=False): from frappe.website import render, statics frappe.connect() render.clear_cache() statics.sync(verbose=verbose).start(True) frappe.db.commit() frappe.destroy()
def post_install(rebuild_website=False): if rebuild_website: render.clear_cache() statics.sync().start() frappe.db.commit() frappe.clear_cache()
def latest(rebuild_website_config=True, quiet=False): import frappe.modules.patch_handler import frappe.model.sync from frappe.website import rebuild_config from frappe.utils.fixtures import sync_fixtures import frappe.translate from frappe.website import statics verbose = not quiet frappe.connect() try: # run patches frappe.local.patch_log_list = [] frappe.modules.patch_handler.run_all() if verbose: print "\n".join(frappe.local.patch_log_list) # sync frappe.model.sync.sync_all(verbose=verbose) sync_fixtures() statics.sync().start() # build website config if any changes in templates etc. if rebuild_website_config: rebuild_config() frappe.translate.clear_cache() except frappe.modules.patch_handler.PatchError: print "\n".join(frappe.local.patch_log_list) raise finally: frappe.destroy()
def latest(rebuild_website_config=True, quiet=False): import frappe.modules.patch_handler import frappe.model.sync from frappe.website import rebuild_config from frappe.utils.fixtures import sync_fixtures import frappe.translate from frappe.website import statics verbose = not quiet frappe.connect() try: # run patches frappe.modules.patch_handler.run_all() # sync frappe.model.sync.sync_all(verbose=verbose) sync_fixtures() statics.sync().start() # build website config if any changes in templates etc. if rebuild_website_config: rebuild_config() frappe.translate.clear_cache() finally: frappe.destroy()
def post_install(rebuild_website=False): if rebuild_website: render.clear_cache() statics.sync().start() init_singles() frappe.db.commit() frappe.clear_cache()
def after_install(rebuild_website=False): version = frappe.utils.cint(frappe.__version__.split(".", 1)[0]) if version >= 5: return if rebuild_website: render.clear_cache() statics.sync().start() init_singles() frappe.db.commit() frappe.clear_cache()
def build_website(context): "Sync statics and clear cache" from frappe.website import render, statics for site in context.sites: try: frappe.init(site=site) frappe.connect() render.clear_cache() statics.sync(verbose=context.verbose).start(rebuild=True) frappe.db.commit() finally: frappe.destroy()
def build_website(context): "Sync statics and clear cache" from frappe.website import render, statics for site in context.sites: try: frappe.init(site=site) frappe.connect() render.clear_cache() statics.sync(verbose=context.verbose).start(True) frappe.db.commit() finally: frappe.destroy()
def add_to_installed_apps(app_name, rebuild_website=True): installed_apps = frappe.get_installed_apps() if not app_name in installed_apps: installed_apps.append(app_name) frappe.db.set_global("installed_apps", json.dumps(installed_apps)) frappe.db.commit() if rebuild_website: render.clear_cache() statics.sync().start() frappe.db.commit() frappe.clear_cache()