@classmethod
def filename_with_attempt_prefix(cls, name, attempt):
    """
        Return the equivalent filename for `name` depending
        whether an attempt prefix must be used, if `attempt` isn't None.
        """
    if attempt is None:
        return name
    else:
        return '%d.%s' % (attempt, name)
