@click.command(u'export-json')
@click.argument(u'doctype')
@click.argument(u'path')
@click.option(u'--name', help=u'Export only one document')
@pass_context
def export_json(context, doctype, path, name=None):
 from frappe.core.page.data_import_tool import data_import_tool
 for site in context.sites:
  try:
   frappe.init(site=site)
   frappe.connect()
   data_import_tool.export_json(doctype, path, name=name)
  finally:
   frappe.destroy()

@ click . command ( u'export-json' ) @ click . argument ( u'doctype' ) @ click . argument ( u'path' ) @ click . option ( u'--name' , help = u'Export only one document' ) @ pass_context def export_json ( context , doctype , path , name = None ) : from frappe . core . page . data_import_tool import data_import_tool for site in context . sites : try : frappe . init ( site = site ) frappe . connect ( ) data_import_tool . export_json ( doctype , path , name = name ) finally : frappe . destroy ( )
export doclist as json to the given path .