Skip to content

Commit 8f3c7d5

Browse files
committed
change project v2 flag to project version number
1 parent 2c39bb2 commit 8f3c7d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ This allows the `.gitignore` to exclude your `config.json` from being accidental
9696
| `chart_end_date` | (OPTIONAL) The last day to show on the burndown chart formatted as `YYYY-MM-DD`. <br/><br/> Used to change the end date of the chart without affecting the slope of the ideal burndown line (e.g. to show tasks that were completed after the official end of a sprint). <br/><br/> Example: `2021-10-24` |
9797
| `points_label` | (OPTIONAL) The prefix for issue labels containing the point value of the issue. Removing this prefix must leave just an integer. If set to `null`, the burndown chart will count open issues instead of points.<br/><br/> Example: `Points: ` (with the space) |
9898
| `calculators` | (OPTIONAL) A list of the calculator(s) to use to calculate the point burndown lines to show on the burndown chart. (DEFAULT: [`closed`])<br/><br/>_OPTIONS:_ `closed`, `assigned`, `created`, `taiga`<br/><br/> Example: [`taiga`, `closed`, `assigned`] |
99-
| `v2` | (OPTIONAL) ProjectV2 or not. If set to `true`, the burndown chart is as Project V2. |
99+
| `version` | (OPTIONAL) The version number of GitHub Projects to use the burndown chart. (DEFAULT: [`1`])<br/><br/> OPTIONS: `1`, `2`<br/><br/> Example: `2` |
100100

101101
#### Organization Projects
102102
All settings are the same as for the [Repository Projects](#repository-projects), except `repo_owner` and `repo_name` are replaced with `organization_name` as shown below.

src/github_projects_burndown_chart/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def parse_cli_args():
2222
return parser.parse_args()
2323

2424

25-
def download_project_data(project_type: str, v2: bool) -> Project:
26-
if v2:
25+
def download_project_data(project_type: str, project_version: int) -> Project:
26+
if project_version == 2:
2727
return get_project_v2(project_type)
2828

2929
if project_type == 'repository':
@@ -57,7 +57,7 @@ def prepare_chart_data(stats: ProjectStats):
5757
if __name__ == '__main__':
5858
args = parse_cli_args()
5959
config.set_project(args.project_type, args.project_name)
60-
project = download_project_data(args.project_type, config['settings']['v2'])
60+
project = download_project_data(args.project_type, config['settings'].get('version', 1))
6161
stats = ProjectStats(project, config.utc_sprint_start(),
6262
config.utc_chart_end() or config.utc_sprint_end())
6363
# Generate the burndown chart

0 commit comments

Comments
 (0)