'Writes the .json for this page and if write_content is checked,
it will write out a .html file'

def on_update(self):

    if self.flags.do_not_update_json:
        return
    from frappe.core.doctype.doctype.doctype import make_module_and_roles
    make_module_and_roles(self, u'roles')
    from frappe.modules.utils import export_module_json
    path = export_module_json(self, (self.standard == u'Yes'), self.module)
    if path:
        if (not os.path.exists((path + u'.js'))):
            with open((path + u'.js'), u'w') as f:
                f.write((u"frappe.pages['%s'].on_page_load    =    function(wrapper)    {\n DCTB var    page    =    frappe.ui.make_app_page({\n DCTB  DCTB parent:    wrapper,\n DCTB  DCTB title:    '%s',\n DCTB  DCTB single_column:    true\n DCTB });\n}" % (self.name, self.title)))
