From 64c730ad18f899a0f94c92c3850fe72856d86621 Mon Sep 17 00:00:00 2001 From: Angelina Tingaeva Date: Wed, 29 Nov 2023 11:53:30 +0500 Subject: [PATCH] refactor(mapping): delete unusable parts of skript (with "#") --- mapping.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/mapping.py b/mapping.py index 7647662..1c9f4d9 100644 --- a/mapping.py +++ b/mapping.py @@ -1,4 +1,3 @@ - import csv import json import os @@ -6,21 +5,10 @@ import sys import logging import requests -# from yandex_tracker_client import TrackerClient - - -# YANDEX_TRACKER_TOKEN = 'y0_AgAAAABAmFP8AArkXwAAAADzJvmiOpP3VkBkQXyHUPEkimPtj5LvovE' -# ORG_ID = '7095769' -# 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' -# ) - base_dir = os.path.dirname(os.path.realpath(__file__)) asana_data_json = os.path.join(base_dir, './data/data_asana.json') users_data = os.path.join(base_dir, './data/users.mapping.asana2ya.csv') @@ -66,10 +54,6 @@ def transform_data(data): 'createdAt': task['created_at'], 'deadline': task['due_on'], 'assignee': task['assignee'], - # 'milestone': task['section'], - # 'memberships': task['memberships'], - # 'parent': task[''], - # 'status': task['completed'], } transformed_data.append(transformed_task) return transformed_data @@ -81,7 +65,6 @@ def create_tasks_in_tracker(data): base_url = 'https://api.tracker.yandex.net/v2/issues/_import' headers = { 'Host': 'api.tracker.yandex.net', - # 'Authorization': 'OAuth y0_AgAEA7qkB3KjAArTqQAAAADzHp7Ut0nhAmx5Q_25b1jpqiuBXRIJksk', 'Authorization': 'OAuth y0_AgAEA7qkB3KjAArkXwAAAADzMlP9oR1lwMzBS2e94jHzdnII8Laxi7k', 'X-Org-ID': '7095769', 'Content-Type': 'appication/json', @@ -89,8 +72,6 @@ def create_tasks_in_tracker(data): for task in data: if task.get('assignee') and 'gid' in task['assignee']: ya_assignee = assignee.get(task['assignee']['gid'], 'dr.cyrill') - # elif task.get('assignee') and 'name' == 'segavol' in task['assignee']: - # ya_assignee = assignee.get(task['assignee']['gid'], 'segavol.dev') else: ya_assignee = 'dr.cyrill'