+def update_pyfile(path, original_year_fn=original_year,
+ authors_fn=authors_list, dry_run=False, verbose=0):
+ original_year = original_year_fn()
+ current_year = time.gmtime()[0]
+ authors = authors_fn()
+ authors = _replace_aliases(authors, with_email=False, aliases=ALIASES)
+ paragraphs = _copyright_string(
+ original_year, current_year, authors,
+ text=SHORT_COPY_RIGHT_TEXT,
+ extra_info={'get-details':'%(get-details)s'},
+ author_format_fn=_short_author_formatter, wrap=False,
+ ).split('\n\n')
+ lines = [
+ _copyright_string(original_year, current_year, authors, prefix='# '),
+ '', 'import textwrap', '', '',
+ 'LICENSE = """',
+ _copyright_string(original_year, current_year, authors, prefix=''),
+ '""".strip()',
+ '',
+ 'def short_license(extra_info, wrap=True, **kwargs):',
+ ' paragraphs = [',
+ ]
+ for p in paragraphs:
+ lines.append(" '%s' %% extra_info," % p.replace("'", r"\'"))
+ lines.extend([
+ ' ]',
+ ' if wrap == True:',
+ ' for i,p in enumerate(paragraphs):',
+ ' paragraphs[i] = textwrap.fill(p, **kwargs)',
+ r" return '\n\n'.join(paragraphs)",
+ ])
+ new_contents = '\n'.join(lines)+'\n'
+ _set_contents(path, new_contents, dry_run=dry_run, verbose=verbose)
+
+