From cdffc1a404d1ac3124f270b2d968256eac984d9c Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Mon, 13 Jan 2014 15:56:12 +0100 Subject: [PATCH] Use `_get_option_name()` to insert command-line info in countries.py header This way, even if option is renamed, comment will be always up-to-date. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8937d3189..35bafbab8 100755 --- a/setup.py +++ b/setup.py @@ -433,7 +433,7 @@ class picard_update_countries(Command): def countries_py_file(self, country_list, filename="picard/countries.py"): header = (u"# -*- coding: utf-8 -*-\n" u"# Automatically generated - don't edit.\n" - u"# Use `python setup.py update_countries` to update it.\n" + u"# Use `python setup.py {option}` to update it.\n" u"\n" u"RELEASE_COUNTRIES = {{\n") line = u" u'{code}': u'{name}',\n" @@ -442,7 +442,7 @@ class picard_update_countries(Command): def write_utf8(s, **kwargs): countries_py.write(s.format(**kwargs).encode('utf-8')) - write_utf8(header) + write_utf8(header, option=_get_option_name(self)) for code, name in country_list: write_utf8(line, code=code, name=name.replace("'", "\\'")) write_utf8(footer)