def call_command(name, *args, **options):
 try:
  app_name = get_commands()[name]
  if isinstance(app_name, BaseCommand):
   klass = app_name
  else:
   klass = load_command_class(app_name, name)
 except KeyError:
  raise CommandError(('Unknown command: %r' % name))
 defaults = dict([(o.dest, o.default) for o in klass.option_list if (o.default is not NO_DEFAULT)])
 defaults.update(options)
 return klass.execute(*args, **defaults)

def call_command ( name , * args , ** options ) : try : app_name = get_commands ( ) [ name ] if isinstance ( app_name , BaseCommand ) : klass = app_name else : klass = load_command_class ( app_name , name ) except KeyError : raise CommandError ( ( 'Unknown command: %r' % name ) ) defaults = dict ( [ ( o . dest , o . default ) for o in klass . option_list if ( o . default is not NO_DEFAULT ) ] ) defaults . update ( options ) return klass . execute ( * args , ** defaults )
calls the given command .