Exemplo n.º 1
0
def create_message(setup):
  if hasattr(setup, 'RELEASE_FORMAT'):
    release_regex = setup.RELEASE_FORMAT
  else:
    release_regex = None
  rel_ver, rel_date, rel_lines = release.parse_last_release(
      setup.RELEASE_FILE, release_regex)
  urls = [
    'Homepage: %s' % setup.SETUP['url'],
    ]

  if 'code.google.com' in setup.SETUP['url']:
    urls.append('Download: %s/downloads/list' % setup.SETUP['url'])
  else:
    urls.append('Download: %s' % setup.SETUP['download_url'])

  grps = re.match(r'([^@]+)@googlegroups.com', setup.MAILING_LIST)
  if grps:
    urls.append('Manage mailing list: '
                'http://groups.google.com/group/%s/subscribe' % grps.group(1))
  else:
    urls.append('Mailing list: %s' % setup.MAILING_LIST)

  return DEFAULT_MESSAGE % {
      'rel_date': rel_date,
      'release_lines': '\n'.join(rel_lines),
      'version': setup.SETUP['version'],
      'name': setup.NAME,
      'description': setup.SETUP['description'],
      'long_description': setup.SETUP['long_description'],
      'urls': '\n'.join(urls),
      'author': setup.SETUP['author']}
Exemplo n.º 2
0
def _parse_last_release(setup):
  """Parse the release file from setup information.
  Returns:
    rel_ver, relase_date, rel_lines
  """
  release_regex = _get_var(setup, 'RELEASE_FORMAT')
  return release.parse_last_release(
      setup.RELEASE_FILE, release_regex)