def export_fixtures():
 for app in frappe.get_installed_apps():
  for fixture in frappe.get_hooks(u'fixtures', app_name=app):
   filters = None
   or_filters = None
   if isinstance(fixture, dict):
    filters = fixture.get(u'filters')
    or_filters = fixture.get(u'or_filters')
    fixture = (fixture.get(u'doctype') or fixture.get(u'dt'))
   print u'Exporting {0} app {1} filters {2}'.format(fixture, app, (filters if filters else or_filters))
   if (not os.path.exists(frappe.get_app_path(app, u'fixtures'))):
    os.mkdir(frappe.get_app_path(app, u'fixtures'))
   export_json(fixture, frappe.get_app_path(app, u'fixtures', (frappe.scrub(fixture) + u'.json')), filters=filters, or_filters=or_filters)

def export_fixtures ( ) : for app in frappe . get_installed_apps ( ) : for fixture in frappe . get_hooks ( u'fixtures' , app_name = app ) : filters = None or_filters = None if isinstance ( fixture , dict ) : filters = fixture . get ( u'filters' ) or_filters = fixture . get ( u'or_filters' ) fixture = ( fixture . get ( u'doctype' ) or fixture . get ( u'dt' ) ) print u'Exporting {0} app {1} filters {2}' . format ( fixture , app , ( filters if filters else or_filters ) ) if ( not os . path . exists ( frappe . get_app_path ( app , u'fixtures' ) ) ) : os . mkdir ( frappe . get_app_path ( app , u'fixtures' ) ) export_json ( fixture , frappe . get_app_path ( app , u'fixtures' , ( frappe . scrub ( fixture ) + u'.json' ) ) , filters = filters , or_filters = or_filters )
export fixtures as json to [app]/fixtures .