| 41 | skip_copyright_global = False |
| 42 | |
| 43 | def adjust_copyright_year(copyright_years, curr_year): |
| 44 | ret_copyright_year = str() |
| 45 | # Read last year in the Copyright |
| 46 | last_year = int(copyright_years[-4:]) |
| 47 | if last_year == curr_year: |
| 48 | ret_copyright_year = copyright_years |
| 49 | elif last_year == (curr_year - 1): |
| 50 | # Create range if latest year on the copyright is the previous |
| 51 | if len(copyright_years) > 4 and copyright_years[-5] == "-": |
| 52 | # Range already exists, update year to current |
| 53 | ret_copyright_year = copyright_years[:-5] + "-" + str(curr_year) |
| 54 | else: |
| 55 | # Create a new range |
| 56 | ret_copyright_year = copyright_years + "-" + str(curr_year) |
| 57 | else: |
| 58 | ret_copyright_year = copyright_years + ", " + str(curr_year) |
| 59 | return ret_copyright_year |
| 60 | |
| 61 | def check_copyright( filename ): |
| 62 | f = open(filename, "r") |