

def postreleaser_after(self, data):
    '\n        Used to update the PyFITS website.\n\n        TODO: If at any point we get a Windows build machine that we can remote\n        into, use this as a point to create Windows builds as well.\n        '
    if (not ask('Update PyFITS homepage')):
        return
    previous_version = new_version = None
    while (not previous_version):
        previous_version = raw_input(('Enter previous version [%s]: ' % self.previous_version)).strip()
        if (not previous_version):
            previous_version = self.previous_version
    while (not new_version):
        new_version = raw_input(('Enter new version [%s]: ' % self.released_version)).strip()
        if (not new_version):
            new_version = self.released_version
    username = raw_input(('Enter your Zope username [%s]: ' % getpass.getuser())).strip()
    if (not username):
        username = getpass.getuser()
    password = getpass.getpass('Enter your Zope password (password will not be displayed): ')
    match = VERSION_RE.match(previous_version)
    if (not match):
        log.error(('Previous version (%s) is invalid: Version must be in the MAJOR.MINOR[.MICRO] format.' % previous_version))
        sys.exit(1)
    micro = (int(match.group('MICRO')) if match.group('MICRO') else 0)
    previous_version = (int(match.group('MAJOR')), int(match.group('MINOR')), micro)
    match = VERSION_RE.match(new_version)
    if (not match):
        log.error(('New version (%s) is invalid: Version must be in the MAJOR.MINOR[.MICRO] format.' % new_version))
        sys.exit(1)
    micro = (int(match.group('MICRO')) if match.group('MICRO') else 0)
    new_version = (int(match.group('MAJOR')), int(match.group('MINOR')), micro)
    format_args = {
        'major': str(previous_version[0]),
        'minor': str(previous_version[1]),
    }
    if (previous_version[2] != 0):
        format_args['minor'] += ('\\.%d' % previous_version[2])
    search_version_re = re.compile((SEARCH_VERSION_RE_FORMAT % format_args))
    new_version_str = '.'.join((str(new_version[0]), str(new_version[1])))
    if (new_version[2] != 0):
        new_version_str += ('.%d' % new_version[2])

    def version_replace(match):
        repl = (match.group('prefix') + new_version_str)
        if match.group('date'):
            today = datetime.today().strftime(DATE_FORMAT)
            repl += (' (%s)' % today)
        return repl
    for page in PYFITS_HOMEPAGE_SUBPAGES:
        try:
            url = os.path.join(PYFITS_HOMEPAGE_BASE_URL, page)
            proxy = _ZopeProxy(url, username, password)
            content = proxy.retrieve()
            content = search_version_re.sub(version_replace, content)
            proxy.update(content)
        except:
            continue
    content = generate_release_notes(self.history_lines)
    try:
        url = os.path.join(PYFITS_HOMEPAGE_BASE_URL, 'release')
        proxy = _ZopeProxy(url, username, password)
        proxy.update(content)
    except:
        pass

dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/_release.py ReleaseManager.postreleaser_after/original