#NEWLINE# @ classmethod #NEWLINE# def add( cls , name , command , paused = False , cwd = None , stdout = None , stderr = None , daemon_log = None , redirect_stderr = None , env = None ) : #NEWLINE# #INDENT# '\n        Add a new program to run, \n        \n        This will not start the program, to start it run prog.start()\n        ' #NEWLINE# program = cls ( name ) #NEWLINE# if program . exists ( ) : #NEWLINE# #INDENT# raise errors . ChalmersError ( "Program with name '{name}' already exists.  \nUse the -n/--name option to change the name or \nRun 'chalmers remove {name}' to remove it \nor 'chalmers set' to update the parameters" . format ( name = name ) ) #NEWLINE# #UNINDENT# state = { #NEWLINE# #INDENT# 'paused' : paused , #NEWLINE# #UNINDENT# } #NEWLINE# definition = create_definition ( name , command ) #NEWLINE# program . raw_data . update ( daemon_log ) #NEWLINE# program . state . update ( state ) #NEWLINE# program . mk_data ( ) #NEWLINE# return program