From b354d408b231afc421df89281ac6255d0929d0dd Mon Sep 17 00:00:00 2001 From: Angelina Tingaeva Date: Mon, 27 Nov 2023 21:22:57 +0500 Subject: [PATCH] refactor(mapping): include logging --- asana_users.py | 1 - mapping.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/asana_users.py b/asana_users.py index 1b91dcb..954d52a 100644 --- a/asana_users.py +++ b/asana_users.py @@ -3,7 +3,6 @@ import json import os import sys - base_dir = os.path.dirname(os.path.realpath(__file__)) asana_data_json = os.path.join(base_dir, './data/data_asana.json') diff --git a/mapping.py b/mapping.py index 5e8e5fc..4e9bdb4 100644 --- a/mapping.py +++ b/mapping.py @@ -3,6 +3,7 @@ import csv import json import os import sys +import logging import requests from yandex_tracker_client import TrackerClient @@ -13,6 +14,8 @@ ORG_ID = '35d164dcf81e48f2b6a532f4badddd33' # TESTIMPORT = 'https://tracker.yandex.ru/pages/projects/5' +logging.basicConfig(level=logging.DEBUG, filename='mapping.log', filemode='w') + client = TrackerClient( token='YANDEX_TRACKER_TOKEN', org_id='ORG_ID' @@ -83,7 +86,7 @@ def create_tasks_in_tracker(data): 'Content-Type': 'appication/json', } for task in data: - ya_assignee = assignee[task['assignee']['gid']] if task.get('assignee',0)!=0 else 'dr.cyrill@heado.ru' + ya_assignee = assignee[task['assignee']['gid']] if task.get('assignee', 0) !=0 else 'dr.cyrill@heado.ru' payload = { 'queue': 'TESTIMPORT', # Вынести в переменную 'summary': task['summary'],