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 sync_www(context, force=False): "Sync files from static pages from www directory to Web Pages" from frappe.website import statics for site in context.sites: try: frappe.init(site=site) frappe.connect() statics.sync_statics(rebuild=force) frappe.db.commit() finally: frappe.destroy()
def setup_docs(context): "Setup docs in target folder of target app" from frappe.utils.setup_docs import setup_docs from frappe.website import statics for site in context.sites: try: frappe.init(site=site) frappe.connect() setup_docs() statics.sync_statics(rebuild=True) finally: frappe.destroy()
def sync_statics(force=False): from frappe.website import statics frappe.connect() statics.sync_statics(rebuild = force) frappe.db.commit() frappe.destroy()
def execute(): statics.sync_statics(rebuild=True)
def sync_statics(): from frappe.website import statics frappe.connect() statics.sync_statics() frappe.db.commit() frappe.destroy()
def sync_statics(force=False): from frappe.website import statics frappe.connect() statics.sync_statics(rebuild=force) frappe.db.commit() frappe.destroy()