Ejemplo n.º 1
0
    def call_command(self, *args, **kwargs):
        """
        Calls the given management command, but only if it's not a dry run.

        If it's a dry run, then a notice about the command will be printed.
        """
        if self.dry_run:
            self.stdout.write(format_command("python manage.py", args, kwargs))
        else:
            call_command(*args, **kwargs)
Ejemplo n.º 2
0
    def call_command(self, *args, **kwargs):
        """
        Calls the given management command, but only if it's not a dry run.

        If it's a dry run, then a notice about the command will be printed.
        """
        if self.dry_run:
            self.stdout.write(format_command("python manage.py", args, kwargs))
        else:
            call_command(*args, **kwargs)
Ejemplo n.º 3
0
 def __call__(self, *args, **kwargs):
     # Allow dry run to be overridden for selective (non-mutating) commands.
     force_live_run = kwargs.pop("_force_live_run", False)
     # Run the command.
     if self.dry_run and not force_live_run:
         # Allow a dry run to be processed.
         self._stdout.write(format_command("heroku", args, kwargs) + "\n")
     else:
         # Call a live command.
         try:
             return self._heroku(*args, **kwargs)
         except sh.ErrorReturnCode as ex:
             raise HerokuCommandError(str(ex))
Ejemplo n.º 4
0
 def __call__(self, *args, **kwargs):
     # Allow dry run to be overridden for selective (non-mutating) commands.
     force_live_run = kwargs.pop("_force_live_run", False)
     # Run the command.
     if self.dry_run and not force_live_run:
         # Allow a dry run to be processed.
         self._stdout.write(format_command("heroku", args, kwargs) + "\n")
     else:
         # Call a live command.
         try:
             return self._heroku(*args, **kwargs)
         except sh.ErrorReturnCode as ex:
             raise HerokuCommandError(str(ex))