'Returns a temporary filename for the given filename.'

def temp_name(self, filename):

    if (self.params.get(u'nopart', False) or (filename == u'-') or (os.path.exists(encodeFilename(filename)) and (not os.path.isfile(encodeFilename(filename))))):
        return filename
    return (filename + u'.part')
