Functions | |
| def | join_license_text (header, prefix, footer, notice) |
| def | load (name) |
| def | log (cond, why, filename) |
| def | save (name, text) |
| def | write_copyright (license_text, file_text, filename) |
Variables | |
| _EXEMPT | |
| action | |
| argp = argparse.ArgumentParser(description='copyright checker') | |
| args = argp.parse_args() | |
| base = os.path.basename(filename) | |
| choices | |
| const | |
| default | |
| ext = os.path.splitext(filename)[1] | |
| string | FILE_LIST_COMMAND = 'git status -z | grep -Poz \'(?<=^[MARC][MARCD ] )[^\s]+\'' |
| list | filename_list = [] |
| LICENSE_NOTICE = f.read().splitlines() | |
| dictionary | LICENSE_PREFIX_RE |
| dictionary | LICENSE_PREFIX_TEXT |
| LICENSE_TEXT | |
| license_text = LICENSE_TEXT[ext] | |
| string | LICENSE_YEAR = f'Copyright {YEAR} gRPC authors.' |
| m = re.search(re_license, text) | |
| bool | ok = True |
| RE_LICENSE | |
| re_license = RE_LICENSE[ext] | |
| string | RE_YEAR = r'Copyright (?P<first_year>[0-9]+\-)?(?P<last_year>[0-9]+) ([Tt]he )?gRPC [Aa]uthors(\.|)' |
| ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) | |
| def | text = load(filename) |
| YEAR = datetime.datetime.now().year | |
| def check_copyright.join_license_text | ( | header, | |
| prefix, | |||
| footer, | |||
| notice | |||
| ) |
Definition at line 150 of file check_copyright.py.
| def check_copyright.load | ( | name | ) |
Definition at line 181 of file check_copyright.py.
| def check_copyright.log | ( | cond, | |
| why, | |||
| filename | |||
| ) |
Definition at line 194 of file check_copyright.py.
| def check_copyright.save | ( | name, | |
| text | |||
| ) |
Definition at line 186 of file check_copyright.py.
| def check_copyright.write_copyright | ( | license_text, | |
| file_text, | |||
| filename | |||
| ) |
Definition at line 203 of file check_copyright.py.
|
private |
Definition at line 104 of file check_copyright.py.
| check_copyright.action |
Definition at line 34 of file check_copyright.py.
| check_copyright.argp = argparse.ArgumentParser(description='copyright checker') |
Definition at line 29 of file check_copyright.py.
| check_copyright.args = argp.parse_args() |
Definition at line 38 of file check_copyright.py.
| check_copyright.base = os.path.basename(filename) |
Definition at line 232 of file check_copyright.py.
| check_copyright.choices |
Definition at line 33 of file check_copyright.py.
| check_copyright.const |
Definition at line 34 of file check_copyright.py.
| check_copyright.default |
Definition at line 32 of file check_copyright.py.
| check_copyright.ext = os.path.splitext(filename)[1] |
Definition at line 231 of file check_copyright.py.
| string check_copyright.FILE_LIST_COMMAND = 'git status -z | grep -Poz \'(?<=^[MARC][MARCD ] )[^\s]+\'' |
Definition at line 174 of file check_copyright.py.
| check_copyright.filename_list = [] |
Definition at line 217 of file check_copyright.py.
| check_copyright.LICENSE_NOTICE = f.read().splitlines() |
Definition at line 42 of file check_copyright.py.
| dictionary check_copyright.LICENSE_PREFIX_RE |
Definition at line 48 of file check_copyright.py.
| dictionary check_copyright.LICENSE_PREFIX_TEXT |
Definition at line 79 of file check_copyright.py.
| check_copyright.LICENSE_TEXT |
Definition at line 167 of file check_copyright.py.
| check_copyright.license_text = LICENSE_TEXT[ext] |
Definition at line 235 of file check_copyright.py.
| string check_copyright.LICENSE_YEAR = f'Copyright {YEAR} gRPC authors.' |
Definition at line 147 of file check_copyright.py.
| check_copyright.m = re.search(re_license, text) |
Definition at line 246 of file check_copyright.py.
| bool check_copyright.ok = True |
Definition at line 216 of file check_copyright.py.
| check_copyright.RE_LICENSE |
Definition at line 139 of file check_copyright.py.
| check_copyright.re_license = RE_LICENSE[ext] |
Definition at line 234 of file check_copyright.py.
| string check_copyright.RE_YEAR = r'Copyright (?P<first_year>[0-9]+\-)?(?P<last_year>[0-9]+) ([Tt]he )?gRPC [Aa]uthors(\.|)' |
Definition at line 138 of file check_copyright.py.
| check_copyright.ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) |
Definition at line 25 of file check_copyright.py.
Definition at line 243 of file check_copyright.py.
| check_copyright.YEAR = datetime.datetime.now().year |
Definition at line 145 of file check_copyright.py.