def METHOD_NAME(self, inp_fname, options, exp_format, prefix):
    hashkey = (inp_fname + str(options) +
              str(self.builder.config.xfig_fig2dev) +
              str(self.builder.config.xfig_fig2dev_args)
              ).encode('utf-8')
    fname = '%s-%s.%s' % (prefix, sha1(hashkey).hexdigest(), exp_format)
    print(fname)
    relfn = posixpath.join(self.builder.imgpath, fname)
    outfn = path.join(self.builder.outdir,
                      getattr(self.builder, 'imagedir', '_images'),
                      fname)
    if path.isfile(outfn):
        return relfn, outfn
    ensuredir(path.dirname(outfn))
    xfig_args = [self.builder.config.xfig_fig2dev]
    xfig_args = ['fig2dev']
    xfig_args.extend(['-L', exp_format])
    xfig_args.extend(self.builder.config.xfig_fig2dev_args)
    xfig_args.extend(options)
    xfig_args.append(inp_fname)
    xfig_args.append(outfn)
    print(xfig_args)
    try:
        p = Popen(xfig_args, stdout=PIPE, stdin=PIPE, stderr=PIPE)
        p.wait()
    except OSError as err:
        if err.errno != ENOENT:   # No such file or directory
            raise
        self.builder.warn('xfig command %r cannot be run (needed for xfig '
                          'output), check the xfig_fig2dev setting' %
                          self.builder.config.xfig_fig2dev)
        return None, None
    return relfn, outfn