def config_edit():
 path = config.user_config_path()
 if ('EDITOR' in os.environ):
  editor = os.environ['EDITOR']
  try:
   editor = shlex.split(editor)
  except ValueError:
   editor = [editor]
  args = (editor + [path])
  args.insert(1, args[0])
 elif (platform.system() == 'Darwin'):
  args = ['open', 'open', '-n', path]
 elif (platform.system() == 'Windows'):
  args = [path, path]
 else:
  args = ['xdg-open', 'xdg-open', path]
 try:
  os.execlp(*args)
 except OSError:
  raise ui.UserError('Could not edit configuration. Please set the EDITOR environment variable.')

def config_edit ( ) : path = config . user_config_path ( ) if ( 'EDITOR' in os . environ ) : editor = os . environ [ 'EDITOR' ] try : editor = shlex . split ( editor ) except ValueError : editor = [ editor ] args = ( editor + [ path ] ) args . insert ( 1 , args [ 0 ] ) elif ( platform . system ( ) == 'Darwin' ) : args = [ 'open' , 'open' , '-n' , path ] elif ( platform . system ( ) == 'Windows' ) : args = [ path , path ] else : args = [ 'xdg-open' , 'xdg-open' , path ] try : os . execlp ( * args ) except OSError : raise ui . UserError ( 'Could not edit configuration. Please set the EDITOR environment variable.' )
open a program to edit the user configuration .