Grabs one output file (raises a StopIteration exception if there is none). Shortcut for getoutputfiles()
503399
def getoutputfile(self, loadmetadata=True, client=None,requiremetadata=False):
        """"""
        return next(self.getoutputfiles(loadmetadata,client,requiremetadata))
198661
def output(self):
        
        if not self.path_output:
            self.output_to_fd(sys.stdout)
        else:
            with open(self.path_output, "w") as out:
                self.output_to_fd(out)
913561
def GetFile(message=None, title=None, directory=None, fileName=None,
            allowsMultipleSelection=False, fileTypes=None):
    
    return dispatcher["GetFile"](message=message, title=title, directory=directory,
                                 fileName=fileName,
                                 allowsMultipleSelection=allowsMultipleSelection,
                                 fileTypes=fileTypes)
922621
private String getOutputFileExtension ()
  {
    if (Boolean.TRUE.equals (this.text) || Boolean.TRUE.equals (this.bnf))
    {
      return ".txt";
    }
    else
    {
      return ".html";
    }
  }
1079179
public function getOutputFile()
    {
        if (!$this->outputFile) {
            $path = new OutputFile($this);
            $this->setOutputFile($path->get());
        }

        return $this->outputFile;
    }
191179
def get_output(self):
        """"""
        logger.info("Getting outputs.")
        # Get the set of prefixes (each will correspond to three json files.)
        json_files = glob.glob(path.join(self.output_dir, '*.json'))
        json_prefixes = set()
        for json_file in json_files:
            # Remove .uaz.<subfile type>.json
            prefix = '.'.join(path.basename(json_file).split('.')[:-3])
            json_prefixes.add(path.join(self.output_dir, prefix))

        # Join each set of json files and store the json dict.
        for prefix in json_prefixes:
            base_prefix = path.basename(prefix)
            if base_prefix.isdecimal():
                base_prefix = int(base_prefix)
            elif base_prefix in self.id_maps.keys():
                base_prefix = self.id_maps[base_prefix]
            try:
                content = self._join_json_files(prefix, clear=True)
            except Exception as e:
                logger.exception(e)
                logger.error("Could not load result for prefix %s." % prefix)
                content = None
            self.add_result(base_prefix, content)
            logger.debug('Joined files for prefix %s.' % base_prefix)
        return self.results
252520
def parse_with_retrieved(self, retrieved):
        
        from aiida.common.exceptions import InvalidOperation
        import os

        output_path = None
        error_path = None
        try:
            output_path, error_path = self._fetch_output_files(retrieved)
        except InvalidOperation:
            raise
        except IOError as e:
            self.logger.error(e.message)
            return False, ()

        if output_path is None and error_path is None:
            self.logger.error("No output files found")
            return False, ()

        return True, self._get_output_nodes(output_path, error_path)
1196044
public void generateOutput(String outputFileName) throws IOException {
        FileOutputStream stream = null;
        OutputStreamWriter writer = null;
        try {
            stream = new FileOutputStream(outputFileName);
            writer = new OutputStreamWriter(stream, charset);
            generateOutput(writer);
        } finally {
            if (writer != null) {
                writer.close();
            }
            if (stream != null) {
                stream.close();
            }
        }
    }
1001065
@Override
    public OutputStream getOutputStream() throws IOException {
	if (!_file.isWriteable()) {
	    throw new IOException("Cannot write");
	}
	return IOUtil.toBufferedOutputStream(_file.getOutputStream());
    }
761404
def get_output(file)
      file_dir = File.dirname(file)
      file_name = File.basename(file).split('.')[0..-2].join('.')

      file_name = "#{file_name}.js" if file_name.match("\.js").nil?

      file_dir = file_dir.gsub(Regexp.new("#{@options[:input]}(\/){0,1}"), '') if @options[:input]
      file_dir = File.join(@options[:output], file_dir) if @options[:output]

      if file_dir == ''
        file_name
      else
        File.join(file_dir, file_name)
      end
    end
1118215
def output_files(self):
        
        for item in self.source_files:
            yield os.path.join(self.address.repo, self.address.path, item)
727944
def getOutput(self):
        
        output = self.stdout
        if self.stdout:
            output += '\r\n'
        output += self.stderr
        return output
261010
def output(f):
    
    def wrapper(self, *args, **kwargs):
        try:
            text = kwargs.get('text') or args[0]
        except IndexError:
            text = True
        _ = f(self, *args, **kwargs)
        if text:
            return _
        elif _ is not None and isinstance(_, string_types):
            filename = "{}.{}".format(self.filename, f.__name__)
            while exists(filename):
                name, ext = splitext(filename)
                try:
                    name, i = name.split('-')
                    i = int(i) + 1
                except ValueError:
                    i = 2
                filename = "{}-{}".format(name, i) + ext
            with open(filename, 'w') as out:
                out.write(_)
    return wrapper
1086990
def _stream_out(self, outfile, append=False):
        '''
        
        '''
        if type(outfile) in (str, unicode):
            outfile = os.path.expanduser(os.path.expandvars(outfile))
            outfile = open(outfile, 'a' if append else 'w')
        self._run(outfile)
        self._pop.wait()
310468
def get_printout(out, opts=None, **kwargs):
    '''
    
    '''
    if opts is None:
        opts = {}

    if 'output' in opts and opts['output'] != 'highstate':
        # new --out option, but don't choke when using --out=highstate at CLI
        # See Issue #29796 for more information.
        out = opts['output']

    # Handle setting the output when --static is passed.
    if not out and opts.get('static'):
        if opts.get('output'):
            out = opts['output']
        elif opts.get('fun', '').split('.')[0] == 'state':
            # --static doesn't have an output set at this point, but if we're
            # running a state function and "out" hasn't already been set, we
            # should set the out variable to "highstate". Otherwise state runs
            # are set to "nested" below. See Issue #44556 for more information.
            out = 'highstate'

    if out == 'text':
        out = 'txt'
    elif out is None or out == '':
        out = 'nested'
    if opts.get('progress', False):
        out = 'progress'

    opts.update(kwargs)
    if 'color' not in opts:
        def is_pipe():
            '''
            Check if sys.stdout is a pipe or not
            '''
            try:
                fileno = sys.stdout.fileno()
            except (AttributeError, io.UnsupportedOperation):
                fileno = -1  # sys.stdout is StringIO or fake
            return not os.isatty(fileno)

        if opts.get('force_color', False):
            opts['color'] = True
        elif opts.get('no_color', False) or is_pipe() or salt.utils.platform.is_windows():
            opts['color'] = False
        else:
            opts['color'] = True
    else:
        if opts.get('force_color', False):
            opts['color'] = True
        elif opts.get('no_color', False) or salt.utils.platform.is_windows():
            opts['color'] = False
        else:
            pass

    outputters = salt.loader.outputters(opts)
    if out not in outputters:
        # Since the grains outputter was removed we don't need to fire this
        # error when old minions are asking for it
        if out != 'grains':
            log.error('Invalid outputter %s specified, falling back to nested', out)
        return outputters['nested']
    return outputters[out]
140725
def fetch_task_output(self):
        
        # 
        if os.path.isfile(os.path.join(self.tmp_dir, "job.out")):
            with open(os.path.join(self.tmp_dir, "job.out"), "r") as f_out:
                outputs = f_out.readlines()
        else:
            outputs = ''
        return outputs
1273879
@Override
    public OutputStream getOutputStream() throws IOException {
        if (Files.isDirectory(this.path)) {
            throw new FileNotFoundException(getPath() + " (is a directory)");
        }
        return Files.newOutputStream(this.path);
    }