def update_site_config(key, value, validate=True, site_config_path=None):
 if (not site_config_path):
  site_config_path = get_site_config_path()
 with open(site_config_path, u'r') as f:
  site_config = json.loads(f.read())
 if (value in (u'0', u'1')):
  value = int(value)
 if (value in (u'false', u'true')):
  value = eval(value.title())
 if (value == u'None'):
  if (key in site_config):
   del site_config[key]
 else:
  site_config[key] = value
 with open(site_config_path, u'w') as f:
  f.write(json.dumps(site_config, indent=1, sort_keys=True))
 if frappe.local.conf:
  frappe.local.conf[key] = value

def update_site_config ( key , value , validate = True , site_config_path = None ) : if ( not site_config_path ) : site_config_path = get_site_config_path ( ) with open ( site_config_path , u'r' ) as f : site_config = json . loads ( f . read ( ) ) if ( value in ( u'0' , u'1' ) ) : value = int ( value ) if ( value in ( u'false' , u'true' ) ) : value = eval ( value . title ( ) ) if ( value == u'None' ) : if ( key in site_config ) : del site_config [ key ] else : site_config [ key ] = value with open ( site_config_path , u'w' ) as f : f . write ( json . dumps ( site_config , indent = 1 , sort_keys = True ) ) if frappe . local . conf : frappe . local . conf [ key ] = value
update a value in site_config .