def _get_output_arg(self, afile, output=None):
        # Get a pre-name from a file.
        def _get_mainname(afile):
            return os.path.splitext(os.path.split(afile)[1])[0]

        namepre = _get_mainname(afile)
        media = self.conf.get_site('media')
        outputdir = self.conf.get_path(media, 'draft')
        baseurl = '%s/draft/'%media
        if output:
            namepre = _get_mainname(output)
            outputdir = os.path.join(os.path.split(output)[0], 'media')
            baseurl = 'media/'
        if not os.path.exists(outputdir):
            os.makedirs(outputdir)
        return outputdir, baseurl, namepre
dataset/ETHPy150Open zrong/wpcmd/wpcmd/update.py/UpdateAction._get_output_arg/original