fixed bugs, removed dependencies from requirements
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,3 +1,4 @@ | |||||||
| .venv/ | .venv/ | ||||||
| .env | .env | ||||||
|  | .env_demo | ||||||
| *.crt | *.crt | ||||||
| @@ -7,4 +7,5 @@ | |||||||
|    the root certificate into the repository. Make sure the name in |    the root certificate into the repository. Make sure the name in | ||||||
|    the global varialbes is correct. |    the global varialbes is correct. | ||||||
| 4. Generate the Personal Access Token in Jira | 4. Generate the Personal Access Token in Jira | ||||||
| 5. Edit the global variables to configure your script. | 5. Setup a .env file with a format: TOKEN=personal_access_token (put your own token) | ||||||
|  | 6. Edit the global variables to configure your script. | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								main.py
									
									
									
									
									
								
							| @@ -1,11 +1,14 @@ | |||||||
| import requests | import requests | ||||||
| import json | import json | ||||||
| import datetime | import datetime | ||||||
|  | from dotenv import load_dotenv | ||||||
|  | from os import getenv | ||||||
|  |  | ||||||
| ACCESS_TOKEN = "" # Modify | load_dotenv() | ||||||
|  | ACCESS_TOKEN = getenv("TOKEN") | ||||||
| USERNAMES = ["kalinom6"] # Modify | USERNAMES = ["kalinom6"] # Modify | ||||||
| URL = "https://globaljira.roche.com/rest/api/2" | URL = "https://globaljira.roche.com/rest/api/2" | ||||||
| CERT = 'Roche G3 Root CA.crt' | CERT = getenv("CERT_LOCATION") | ||||||
| WEEKS_BACK = 1 | WEEKS_BACK = 1 | ||||||
| VERBOSE = True | VERBOSE = True | ||||||
|  |  | ||||||
| @@ -53,6 +56,7 @@ def get_worklogs(issues): | |||||||
|             for log in data.get("worklogs", []): |             for log in data.get("worklogs", []): | ||||||
|                 worklog = { |                 worklog = { | ||||||
|                     "ticket_id": issue["task_id"], |                     "ticket_id": issue["task_id"], | ||||||
|  |                     "jira_link": issue["task_link"], | ||||||
|                     "time_spent": log["timeSpent"], |                     "time_spent": log["timeSpent"], | ||||||
|                     "date": log["started"], |                     "date": log["started"], | ||||||
|                     "author": log["author"]["name"] |                     "author": log["author"]["name"] | ||||||
| @@ -73,6 +77,7 @@ def get_days(day, weeks_back=WEEKS_BACK): | |||||||
|         days.append(str(day)) |         days.append(str(day)) | ||||||
|     return days |     return days | ||||||
|  |  | ||||||
|  | # NOT FUNCTIONAL | ||||||
| def get_weeks(day, worklogs, weeks=list()): | def get_weeks(day, worklogs, weeks=list()): | ||||||
|     year, weeknum, day_of_week = day.isocalendar() |     year, weeknum, day_of_week = day.isocalendar() | ||||||
|     days = get_days(day, weeks_back=0) |     days = get_days(day, weeks_back=0) | ||||||
| @@ -83,9 +88,9 @@ def get_weeks(day, worklogs, weeks=list()): | |||||||
|         get_weeks(days[0], worklogs, weeks) |         get_weeks(days[0], worklogs, weeks) | ||||||
|     return weeks |     return weeks | ||||||
|  |  | ||||||
|      | # TODO: implement this | ||||||
|  | def get_days_range(date_from, date_to): | ||||||
|      |     pass | ||||||
|  |  | ||||||
| def get_week_tickets(worklogs, days): | def get_week_tickets(worklogs, days): | ||||||
|     this_week_tickets = [] |     this_week_tickets = [] | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user
	 Michał Kalinowski
					Michał Kalinowski