tweaks for labels mappings or None
diff --git a/importer.py b/importer.py
index 468c828..e4a52d7 100644
--- a/importer.py
+++ b/importer.py
@@ -173,6 +173,7 @@
Finally the issue github is noted.
"""
print('Issue ', issue['key'])
+ issue['labels'] = [label for label in issue['labels'] if label]
print('Labels', issue['labels'])
jira_key = issue['key']
del issue['key']
diff --git a/utils.py b/utils.py
index e41f3c6..178cf79 100644
--- a/utils.py
+++ b/utils.py
@@ -6,12 +6,14 @@
def fetch_labels_mapping():
with open("labels_mapping.txt") as file:
entry = [line.split("=") for line in file.readlines()]
- return {key.strip(): value.strip() for key, value in entry}
+ return {key.strip(): value.strip() for key, value in entry if key or value}
def fetch_allowed_labels():
with open("allowed_labels.txt") as file:
- return [line.strip('\n') for line in file.readlines()]
+ lines = (line.rstrip() for line in file.readlines()) # strip right-side whitespace
+ lines = (line for line in lines if line) # remove blank lines
+ return lines
def _map_label(label, labels_mapping):