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