Functions | |
| def | has_hidden_dirs (dirpath) |
| def | get_the_paths (root_dir) |
| def | do_the_subs (path_collection, search, replace) |
Variables | |
| string | search_string = r'Copyright \(c\) 2003-20\d\d' |
| string | replace_string = r'Copyright (c) 2003-2020' |
| string | d = "." |
| path_collection = get_the_paths(d) | |
Walk the directory tree and replace the '20XX' copyright dates in lines with
'Copyright 2003-20XX' with '2016'. Usage:
./bump_copyright.py # use "." as the start directory
./bump_copyright.py dirname # use dirname as the start directory
| def bump_copyright.do_the_subs | ( | path_collection, | |
| search, | |||
| replace | |||
| ) |
Look for the copyright string and sub the date
Definition at line 50 of file bump_copyright.py.
| def bump_copyright.get_the_paths | ( | root_dir | ) |
| def bump_copyright.has_hidden_dirs | ( | dirpath | ) |
Check if the directory path has any directories leading with a '.' (accept the current working directory as okay).
Definition at line 20 of file bump_copyright.py.
| bump_copyright.d = "." |
Definition at line 70 of file bump_copyright.py.
| bump_copyright.path_collection = get_the_paths(d) |
Definition at line 74 of file bump_copyright.py.
| string bump_copyright.replace_string = r'Copyright (c) 2003-2020' |
Definition at line 17 of file bump_copyright.py.
| string bump_copyright.search_string = r'Copyright \(c\) 2003-20\d\d' |
Definition at line 16 of file bump_copyright.py.
1.8.11