'client must be a PupyClient instance'

def __init__(self, client, job, formatter=None, stdout=None, log=None):

    self.client = client
    self.job = job
    self.new_deps = []
    self.del_close = False
    self.log_file = log
    self.init_argparse()
    self.stdout = stdout
    if (formatter is None):
        from .PupyCmd import PupyCmd
        self.formatter = PupyCmd
    else:
        self.formatter = formatter
    if (stdout is None):
        self.stdout = StringIO.StringIO()
        self.del_close = True
    else:
        self.stdout = stdout
