def _parse_postamble(self): ''' @ParseDirectiveMixin._parse_postamble ''' parallel.coalesce_files( path.join(self.args.target_parent, '*_tmp_apf.out'), self.args.target)
def run_directive(self): ''' Args: N/A Procedure: Initialize the logging system and run this directive using the supplied arguments Preconditions: self.args is of type Namespace self.args.log_path is of type String self.args.log_prefix is of type String self.args.count is of type Integer (optional) self.args.threads is of type Integer > 0 (optional) ** Any other preconditions must be checked by subclasses ''' assert isinstance(self.args, Namespace), 'Args is not of type Namespace' assert hasattr(self.args, 'log_path'), 'Args does not contain log_path attribute' assert hasattr(self.args, 'log_prefix'), 'Args does not contain log_prefix attribute' if hasattr(self.args, 'threads'): assert self.args.threads > 0, 'Threads is not greater than 0' if self.args.threads > parallel.CPU_COUNT: self.args.threads = parallel.CPU_COUNT initialize_logger(self.args.log_path) Logger.info('BEGIN: %s'%type(self).__name__) self.run() sleep(0.5) Logger.info('END: %s'%type(self).__name__) logging.shutdown() closeFileHandlers() log_path = synthesize_log_path(self.args.log_path, self.args.log_prefix) parallel.coalesce_files(path.join(self.args.log_path, '*_tmp_aevtx.log'), log_path)
def _parse_postamble(self): ''' @ParseDirectiveMixin._parse_postamble ''' for fmt in self.args.formats: parallel.coalesce_files(\ path.join(self.args.target_parent, fmt, '*_tmp_apf.out'), self.args.target + '.' + fmt\ ) rmdir(path.join(self.args.target_parent, fmt))