Skip to content
Snippets Groups Projects
Verified Commit b4a10563 authored by Romain Deville's avatar Romain Deville
Browse files

:sparkles: Improve handling of copyright in plugins.py script

parent 6425b234
No related branches found
No related tags found
No related merge requests found
...@@ -401,9 +401,19 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None: ...@@ -401,9 +401,19 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
first_year = time.strftime("%Y", time.localtime()) first_year = time.strftime("%Y", time.localtime())
curr_year = time.strftime("%Y", time.localtime()) curr_year = time.strftime("%Y", time.localtime())
if first_year == curr_year:
env.variables[
"date_copyright"
] = f"Copyright © {curr_year}"
else:
env.variables[
"date_copyright"
] = f"Copyright © {curr_year} - {curr_year}"
env.conf[ env.conf[
"copyright" "copyright"
] = f"Copyright © {first_year} - {curr_year} {env.variables['copyright']}" ] = f"{env.variables['date_copyright']} {env.variables['copyright']}"
def set_repo_name(env: dict, repo_slug: str) -> None: def set_repo_name(env: dict, repo_slug: str) -> None:
...@@ -844,7 +854,7 @@ def update_version(env: dict) -> None: ...@@ -844,7 +854,7 @@ def update_version(env: dict) -> None:
} }
) )
last_minor = minor last_minor = minor
last_patch = 0 last_patch = -1
if patch > last_patch: if patch > last_patch:
last_patch = patch last_patch = patch
mike_version.append( mike_version.append(
......
...@@ -401,13 +401,19 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None: ...@@ -401,13 +401,19 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
first_year = time.strftime("%Y", time.localtime()) first_year = time.strftime("%Y", time.localtime())
curr_year = time.strftime("%Y", time.localtime()) curr_year = time.strftime("%Y", time.localtime())
if first_year == curr_year:
env.variables[
"date_copyright"
] = f"Copyright © {curr_year}"
else:
env.variables[
"date_copyright"
] = f"Copyright © {curr_year} - {curr_year}"
env.conf[ env.conf[
"copyright" "copyright"
] = f"Copyright © {first_year} - {curr_year} {env.variables['copyright']}" ] = f"{env.variables['date_copyright']} {env.variables['copyright']}"
env.variables[
"full_copyright"
] = f"Copyright © {first_year} - {curr_year} {env.variables['copyright']}"
def set_repo_name(env: dict, repo_slug: str) -> None: def set_repo_name(env: dict, repo_slug: str) -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment