Commit f4953c02 authored by Dimitri Podborski's avatar Dimitri Podborski
Browse files

Merge branch 'master' into feature_comments

parents 8524eb0e ee006bd8
......@@ -30,7 +30,7 @@ Run the following commands to set everything up:
git clone
cd AutomationTools
python3 -m venv venv
source venv/bin/activate
source venv/bin/activate (macOS/Linux) or .\venv\Scripts\activate (Windows)
pip install -r requirements.txt
(run your scripts)
......@@ -39,6 +39,8 @@ pip install -r requirements.txt
If you don't want to use virtual environment you can just start with: `pip install -r requirements.txt`.
## 2.
`` is a script which is intended to be used in the Systems group. Use the `-h` option to see all available parameters.
......@@ -91,7 +91,7 @@ def get_issues(project_id):
project = _get_project(project_id)
if not project:
return []
issues = project.issues.list(state='opened')
issues = project.issues.list(state='opened', all=True)
return issues
def open_issue(project_id, title, description, labels=[]):
......@@ -124,7 +124,7 @@ def load_json_data(json_path):
Load json file from json_path and return the data.
with open(json_path, 'r') as f:
with open(json_path, 'r', encoding='utf-8') as f:
data = json.load(f)
return data
......@@ -183,7 +183,7 @@ def open_issues(table_entries, test, gitlab_members, meeting_start):
print(' * {}: No update required for "{}"'.format(document['document'], document['title']))
print('Opened issues:', counter)
def close_issues(table_entries, test):
def close_issues(table_entries, test, force):
print('\nClose {} issues. TestMode={}'.format(len(table_entries), test))
counter = 0
for entry in table_entries:
......@@ -191,6 +191,8 @@ def close_issues(table_entries, test):
project_id = entry['project']['id']
close_flag = entry['close']
if force:
close_flag = True
if not close_flag == True:
......@@ -346,10 +348,11 @@ usage_examples= '''Examples:
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
description='A tool for managing the GitLab issues for MPEG Systems Subgroups.',
parser.add_argument('-o', '--open', help='Open GitLab issues.', action='store_true')
parser.add_argument('-c', '--close', help='Close GitLab issues.', action='store_true')
parser.add_argument('-d', '--docx', help='Generate output word document.', action='store_true')
parser.add_argument('-l', '--list', help='List information about the contribution(s).', action='store_true')
parser.add_argument('-o', '--open', help='Mode: Open GitLab issues.', action='store_true')
parser.add_argument('-c', '--close', help='Mode: Close GitLab issues.', action='store_true')
parser.add_argument('-d', '--docx', help='Mode: Generate output word document.', action='store_true')
parser.add_argument('-l', '--list', help='Mode: List information about the contribution(s).', action='store_true')
parser.add_argument('-C', '--CLOSE', help='Force closing GitLab issues.', action='store_true')
parser.add_argument('-u', '--update', help='Update MDMS documents database.', action='store_true')
parser.add_argument('-U', '--UPDATE', help='Update all databases.', action='store_true')
parser.add_argument('-i', '--csv', help='Input CSV file. Header row shall include "Number" and ("Project URL" or "Sub Group" and "Project Name").')
......@@ -428,6 +431,6 @@ if
gitlab_members = None
open_issues(table_entries, args.test, gitlab_members, meeting_start)
if args.close:
close_issues(table_entries, args.test)
close_issues(table_entries, args.test, args.CLOSE)
if args.docx:
create_output_doc(table_entries, output_path, args.template)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment