diff --git a/README.rst b/README.rst index e21904a..f6e7542 100644 --- a/README.rst +++ b/README.rst @@ -13,7 +13,7 @@ .. image:: http://img.shields.io/pypi/dm/postorius.svg :target: https://pypi.python.org/pypi/postorius -Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +Copyright (C) 1998-2017 by the Free Software Foundation, Inc. The Postorius Django app provides a web user interface to access GNU Mailman. diff --git a/copybump.py b/copybump.py new file mode 100755 index 0000000..d6359cc --- /dev/null +++ b/copybump.py @@ -0,0 +1,96 @@ +#! /usr/bin/env python3 + +import os +import re +import sys +import stat +import datetime + + +FSF = 'by the Free Software Foundation, Inc.' +this_year = datetime.date.today().year +pyre_c = re.compile(r'# Copyright \(C\) ((?P\d{4})-)?(?P\d{4})') +pyre_n = re.compile(r'# Copyright ((?P\d{4})-)?(?P\d{4})') +new_c = '# Copyright (C) {}-{} {}' +new_n = '# Copyright {}-{} {}' + +MODE = (stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) + + +if '--noc' in sys.argv: + pyre = pyre_n + new = new_n + sys.argv.remove('--noc') +else: + pyre = pyre_c + new = new_c + + +def do_file(path, owner): + permissions = os.stat(path).st_mode & MODE + with open(path) as in_file, open(path + '.out', 'w') as out_file: + try: + for line in in_file: + mo_c = pyre_c.match(line) + mo_n = pyre_n.match(line) + if mo_c is None and mo_n is None: + out_file.write(line) + continue + mo = (mo_n if mo_c is None else mo_c) + start = (mo.group('end') + if mo.group('start') is None + else mo.group('start')) + if int(start) == this_year: + out_file.write(line) + continue + print(new.format(start, this_year, owner), file=out_file) # noqa + print('=>', path) + for line in in_file: + out_file.write(line) + except UnicodeDecodeError: + print('Cannot convert path:', path) + os.remove(path + '.out') + return + os.rename(path + '.out', path) + os.chmod(path, permissions) + + +def remove(dirs, path): + try: + dirs.remove(path) + except ValueError: + pass + + +def do_walk(): + try: + owner = sys.argv[1] + except IndexError: + owner = FSF + for root, dirs, files in os.walk('.'): + if root == '.': + remove(dirs, '.git') + remove(dirs, '.tox') + remove(dirs, 'bin') + remove(dirs, 'contrib') + remove(dirs, 'develop-eggs') + remove(dirs, 'eggs') + remove(dirs, 'parts') + remove(dirs, 'gnu-COPYING-GPL') + remove(dirs, '.installed.cfg') + remove(dirs, '.bzrignore') + remove(dirs, 'distribute_setup.py') + if root == './src': + remove(dirs, 'postorius.egg-info') + if root == './src/postorius': + remove(dirs, 'messages') + for file_name in files: + if os.path.splitext(file_name)[1] in ('.pyc', '.gz', '.egg'): + continue + path = os.path.join(root, file_name) + if os.path.isfile(path): + do_file(path, owner) + + +if __name__ == '__main__': + do_walk() diff --git a/example_project/manage.py b/example_project/manage.py index f309a3c..50e3895 100755 --- a/example_project/manage.py +++ b/example_project/manage.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright (C) 1998-2012 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/example_project/settings.py b/example_project/settings.py index 714185b..6220de4 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/example_project/test_settings.py b/example_project/test_settings.py index 5b2a1e4..e5fff8f 100644 --- a/example_project/test_settings.py +++ b/example_project/test_settings.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/example_project/urls.py b/example_project/urls.py index 1c61a8b..29da559 100644 --- a/example_project/urls.py +++ b/example_project/urls.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/setup.py b/setup.py index b43a55a..4a8a169 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2016 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/__init__.py b/src/postorius/__init__.py index 2728a65..881819e 100644 --- a/src/postorius/__init__.py +++ b/src/postorius/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/apps.py b/src/postorius/apps.py index 0aaf717..bc404c5 100644 --- a/src/postorius/apps.py +++ b/src/postorius/apps.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2016 by the Free Software Foundation, Inc. +# Copyright (C) 2016-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/auth/decorators.py b/src/postorius/auth/decorators.py index 4a0cf6b..400b055 100644 --- a/src/postorius/auth/decorators.py +++ b/src/postorius/auth/decorators.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/auth/utils.py b/src/postorius/auth/utils.py index 87356b3..823f762 100644 --- a/src/postorius/auth/utils.py +++ b/src/postorius/auth/utils.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/context_processors.py b/src/postorius/context_processors.py index 1cb6c6e..911faea 100644 --- a/src/postorius/context_processors.py +++ b/src/postorius/context_processors.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/doc/settings.py b/src/postorius/doc/settings.py index 1f76bc9..f5d543b 100755 --- a/src/postorius/doc/settings.py +++ b/src/postorius/doc/settings.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/forms.py b/src/postorius/forms.py index 3e7634c..2063758 100644 --- a/src/postorius/forms.py +++ b/src/postorius/forms.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2016 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/management/commands/mmclient.py b/src/postorius/management/commands/mmclient.py index 05bb297..fd63dcb 100644 --- a/src/postorius/management/commands/mmclient.py +++ b/src/postorius/management/commands/mmclient.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/middleware.py b/src/postorius/middleware.py index 4dc9f59..a65e15a 100644 --- a/src/postorius/middleware.py +++ b/src/postorius/middleware.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2015 by the Free Software Foundation, Inc. +# Copyright (C) 2015-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/models.py b/src/postorius/models.py index 99f7524..5182577 100644 --- a/src/postorius/models.py +++ b/src/postorius/models.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/templatetags/membership_helpers.py b/src/postorius/templatetags/membership_helpers.py index a69c517..fed0048 100644 --- a/src/postorius/templatetags/membership_helpers.py +++ b/src/postorius/templatetags/membership_helpers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/templatetags/nav_helpers.py b/src/postorius/templatetags/nav_helpers.py index 84007e8..4a33227 100644 --- a/src/postorius/templatetags/nav_helpers.py +++ b/src/postorius/templatetags/nav_helpers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_domain_delete.py b/src/postorius/tests/mailman_api_tests/test_domain_delete.py index 370c548..2855ad6 100644 --- a/src/postorius/tests/mailman_api_tests/test_domain_delete.py +++ b/src/postorius/tests/mailman_api_tests/test_domain_delete.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2016 by the Free Software Foundation, Inc. +# Copyright (C) 2016-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_domain_index.py b/src/postorius/tests/mailman_api_tests/test_domain_index.py index e76b8b3..d3500c0 100644 --- a/src/postorius/tests/mailman_api_tests/test_domain_index.py +++ b/src/postorius/tests/mailman_api_tests/test_domain_index.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_domain_new.py b/src/postorius/tests/mailman_api_tests/test_domain_new.py index 9fcd045..314ee9d 100644 --- a/src/postorius/tests/mailman_api_tests/test_domain_new.py +++ b/src/postorius/tests/mailman_api_tests/test_domain_new.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_list_bans.py b/src/postorius/tests/mailman_api_tests/test_list_bans.py index a549ebc..6040b38 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_bans.py +++ b/src/postorius/tests/mailman_api_tests/test_list_bans.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2016 by the Free Software Foundation, Inc. +# Copyright (C) 2016-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_list_header_matches.py b/src/postorius/tests/mailman_api_tests/test_list_header_matches.py index a1d95f6..758f9c3 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_header_matches.py +++ b/src/postorius/tests/mailman_api_tests/test_list_header_matches.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2016 by the Free Software Foundation, Inc. +# Copyright (C) 2016-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_list_index.py b/src/postorius/tests/mailman_api_tests/test_list_index.py index ca8eb3d..8870e21 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_index.py +++ b/src/postorius/tests/mailman_api_tests/test_list_index.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_list_member_options.py b/src/postorius/tests/mailman_api_tests/test_list_member_options.py index 174b15d..1991a22 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_member_options.py +++ b/src/postorius/tests/mailman_api_tests/test_list_member_options.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_list_members.py b/src/postorius/tests/mailman_api_tests/test_list_members.py index 542ce52..e39d34c 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_members.py +++ b/src/postorius/tests/mailman_api_tests/test_list_members.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_list_new.py b/src/postorius/tests/mailman_api_tests/test_list_new.py index 1ed0fa3..b155136 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_new.py +++ b/src/postorius/tests/mailman_api_tests/test_list_new.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_list_settings.py b/src/postorius/tests/mailman_api_tests/test_list_settings.py index 5c4c891..f22a22a 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_settings.py +++ b/src/postorius/tests/mailman_api_tests/test_list_settings.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2016 by the Free Software Foundation, Inc. +# Copyright (C) 2016-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_list_summary.py b/src/postorius/tests/mailman_api_tests/test_list_summary.py index fb0a615..d1a355c 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_summary.py +++ b/src/postorius/tests/mailman_api_tests/test_list_summary.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_models.py b/src/postorius/tests/mailman_api_tests/test_models.py index 32e2f53..a8c2801 100644 --- a/src/postorius/tests/mailman_api_tests/test_models.py +++ b/src/postorius/tests/mailman_api_tests/test_models.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_subscriptions.py b/src/postorius/tests/mailman_api_tests/test_subscriptions.py index 22b0c1f..30b2801 100644 --- a/src/postorius/tests/mailman_api_tests/test_subscriptions.py +++ b/src/postorius/tests/mailman_api_tests/test_subscriptions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/mailman_api_tests/test_user.py b/src/postorius/tests/mailman_api_tests/test_user.py index 0c1f644..42394b1 100644 --- a/src/postorius/tests/mailman_api_tests/test_user.py +++ b/src/postorius/tests/mailman_api_tests/test_user.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2016 by the Free Software Foundation, Inc. +# Copyright (C) 2016-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/test_auth_decorators.py b/src/postorius/tests/test_auth_decorators.py index 9913e6c..8bb3a6e 100644 --- a/src/postorius/tests/test_auth_decorators.py +++ b/src/postorius/tests/test_auth_decorators.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2016 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/test_domain_view.py b/src/postorius/tests/test_domain_view.py index fdd7428..875016b 100644 --- a/src/postorius/tests/test_domain_view.py +++ b/src/postorius/tests/test_domain_view.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2016 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/test_forms.py b/src/postorius/tests/test_forms.py index 7790626..fc3a032 100644 --- a/src/postorius/tests/test_forms.py +++ b/src/postorius/tests/test_forms.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2016 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/test_urls.py b/src/postorius/tests/test_urls.py index 4b8a21c..83696f3 100644 --- a/src/postorius/tests/test_urls.py +++ b/src/postorius/tests/test_urls.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2016 by the Free Software Foundation, Inc. +# Copyright (C) 2016-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/tests/utils.py b/src/postorius/tests/utils.py index a8cf94d..3b42c75 100644 --- a/src/postorius/tests/utils.py +++ b/src/postorius/tests/utils.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2016 by the Free Software Foundation, Inc. +# Copyright (C) 2012-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/urls.py b/src/postorius/urls.py index ba81faf..51dec55 100644 --- a/src/postorius/urls.py +++ b/src/postorius/urls.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/utils.py b/src/postorius/utils.py index 93c991b..a4942c9 100644 --- a/src/postorius/utils.py +++ b/src/postorius/utils.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/views/domain.py b/src/postorius/views/domain.py index e8fe1bc..8934f31 100644 --- a/src/postorius/views/domain.py +++ b/src/postorius/views/domain.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/views/generic.py b/src/postorius/views/generic.py index 425de56..829685c 100644 --- a/src/postorius/views/generic.py +++ b/src/postorius/views/generic.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py index b241b00..4baf9cf 100644 --- a/src/postorius/views/list.py +++ b/src/postorius/views/list.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/views/rest.py b/src/postorius/views/rest.py index e36f475..11a8700 100644 --- a/src/postorius/views/rest.py +++ b/src/postorius/views/rest.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. # diff --git a/src/postorius/views/user.py b/src/postorius/views/user.py index 7755ee7..bd2de2c 100644 --- a/src/postorius/views/user.py +++ b/src/postorius/views/user.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. # # This file is part of Postorius. #