def _file_name(fname, base_dir):
        """ Convert a relative filename if we have a base directory. """

        fname = fname.replace("\\", "\\\\")

        if base_dir != '' and fname[0] != ':' and not os.path.isabs(fname):
            fname = os.path.join(base_dir, fname)

        return fname
Convert a relative filename if we have a base directory.