<s> from __future__ import unicode_literals , division <EOL> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __version__ = "<STR_LIT>" <EOL> __maintainer__ = "<STR_LIT>" <EOL> __email__ = "<STR_LIT>" <EOL> __status__ = "<STR_LIT>" <EOL> __date__ = "<STR_LIT>" <EOL> import subprocess <EOL> import shutil <EOL> from monty . io import zopen <EOL> from custodian . custodian import Job <EOL> from monty . shutil import gzip_dir <EOL> class NwchemJob ( Job ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , nwchem_cmd , input_file = "<STR_LIT>" , <EOL> output_file = "<STR_LIT>" , gzipped = False , <EOL> backup = True , settings_override = None ) : <EOL> """<STR_LIT>""" <EOL> self . nwchem_cmd = nwchem_cmd <EOL> self . input_file = input_file <EOL> self . output_file = output_file <EOL> self . backup = backup <EOL> self . gzipped = gzipped <EOL> self . settings_override = settings_override <EOL> def setup ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . backup : <EOL> shutil . copy ( self . input_file , "<STR_LIT>" . format ( self . input_file ) ) <EOL> def run ( self ) : <EOL> """<STR_LIT>""" <EOL> with zopen ( self . output_file , '<STR_LIT:w>' ) as fout : <EOL> return subprocess . Popen ( self . nwchem_cmd + [ self . input_file ] , <EOL> stdout = fout ) <EOL> def postprocess ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . gzipped : <EOL> gzip_dir ( "<STR_LIT:.>" ) </s>
