Compare commits
2 Commits
6f54c6d3ac
...
97c2a7aa37
| Author | SHA1 | Date | |
|---|---|---|---|
| 97c2a7aa37 | |||
| ea9fa5b472 |
@@ -41,7 +41,7 @@ class ClockifyAPI(ClockifyConfig):
|
||||
|
||||
tags = self.get_tags(is_updating=is_updating)
|
||||
if not tags:
|
||||
logging.info(f"{Fore.YELLOW}В базе данных нет тегов! Обновите БД при помощи флага -i [--init-db]{Fore.RESET}")
|
||||
logger.info(f"{Fore.YELLOW}В базе данных нет тегов! Обновите БД при помощи флага -i [--init-db]{Fore.RESET}")
|
||||
return []
|
||||
|
||||
result = []
|
||||
|
||||
@@ -31,7 +31,7 @@ class RedmineAPI(RedmineConfig):
|
||||
"""Заносит трудочасы на сервер Redmine"""
|
||||
is_beginner = config.is_beginner
|
||||
if is_beginner:
|
||||
logging.info(f"{Fore.YELLOW}Делим трудочасы пополам{Fore.RESET}")
|
||||
logger.info(f"{Fore.YELLOW}Делим трудочасы пополам{Fore.RESET}")
|
||||
tracked = []
|
||||
for activity in tqdm(activities, desc="Занесение трудочасов"):
|
||||
if not(not activity.is_tracked and activity.date_end):
|
||||
@@ -69,7 +69,7 @@ class RedmineAPI(RedmineConfig):
|
||||
def get_time_entry_activities(self) -> list[ActivityTypes]:
|
||||
"""Получает виды Деятельности с сервера Redmine"""
|
||||
resp = requests.get(self.base_url + self.time_entry_activities, headers={"X-Redmine-API-KEY": self.token})
|
||||
logging.debug(resp.json())
|
||||
logger.debug(resp.json())
|
||||
if resp.ok:
|
||||
return [
|
||||
ActivityType(id=act.get("id"), title=act.get("name"))
|
||||
@@ -141,4 +141,4 @@ class RedmineAPI(RedmineConfig):
|
||||
|
||||
def _check_token(self):
|
||||
user = self.get_user()
|
||||
logging.debug(user)
|
||||
logger.debug(user)
|
||||
|
||||
10
db/db.py
10
db/db.py
@@ -252,7 +252,7 @@ class Database:
|
||||
"redmine_username": user[8]
|
||||
}
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
logger.error(e)
|
||||
|
||||
|
||||
def get_tags(self) -> list[Tag]:
|
||||
@@ -266,7 +266,7 @@ class Database:
|
||||
for tag in self.cursor.execute("SELECT * FROM tag").fetchall()
|
||||
]
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
logger.error(e)
|
||||
|
||||
def get_tasks(self) -> list[Task]:
|
||||
"""Получает задачи из бд"""
|
||||
@@ -284,7 +284,7 @@ class Database:
|
||||
}) for task in self.cursor.execute("SELECT * FROM task").fetchall()
|
||||
]
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
logger.error(e)
|
||||
|
||||
def get_vetro_projects(self) -> list[VetroProject]:
|
||||
"""Получает Проекты Ветро из бд"""
|
||||
@@ -296,7 +296,7 @@ class Database:
|
||||
}) for vetro_project in self.cursor.execute("SELECT * FROM vetro_project").fetchall()
|
||||
]
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
logger.error(e)
|
||||
|
||||
def get_activity_types(self) -> list[ActivityType]:
|
||||
"""Получает Виды деятельности из бд"""
|
||||
@@ -308,4 +308,4 @@ class Database:
|
||||
}) for activity_type in self.cursor.execute("SELECT * FROM activity_type").fetchall()
|
||||
]
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
logger.error(e)
|
||||
|
||||
Reference in New Issue
Block a user