def systemd_command_generator(command):
 command_name = 'systemctl'
 if (command == 'is_enabled'):
  command = 'is-enabled'
 elif (command == 'list'):
  def list_command(service_name):
   return [command_name, 'list-unit-files', '--type=service', '--no-pager', '--full']
  return list_command
 elif (command == 'set_target'):
  def set_target_command(target):
   return [command_name, 'isolate', target]
  return set_target_command
 def method(service_name):
  return [command_name, command, ('%s.service' % service_name)]
 return method

def systemd_command_generator ( command ) : command_name = 'systemctl' if ( command == 'is_enabled' ) : command = 'is-enabled' elif ( command == 'list' ) : def list_command ( service_name ) : return [ command_name , 'list-unit-files' , '--type=service' , '--no-pager' , '--full' ] return list_command elif ( command == 'set_target' ) : def set_target_command ( target ) : return [ command_name , 'isolate' , target ] return set_target_command def method ( service_name ) : return [ command_name , command , ( '%s.service' % service_name ) ] return method
generate list of command line argument strings for systemctl .