|
4 | 4 |
|
5 | 5 | from argparse import ArgumentParser |
6 | 6 |
|
7 | | -from log_handlers import logger |
8 | | -from tasks import ( |
| 7 | +from gitlab_attendant.log_handlers import logger |
| 8 | +from gitlab_attendant.tasks import ( |
9 | 9 | assign_project_members_to_issues, |
10 | 10 | assign_open_merge_requests, |
11 | 11 | notify_issue_assignees, |
@@ -46,31 +46,32 @@ def process_arguments() -> dict: |
46 | 46 |
|
47 | 47 |
|
48 | 48 | def tasks(args): |
49 | | - """ |
50 | | - Function calls to the tasks that the GitLab Attendant |
51 | | - is capable of running. |
52 | | - """ |
53 | | - logger.info("GitLab Attendant has woken up...") |
54 | | - logger.info(f"GitLab Attendant will begin attending to GitLab instance at {args['ip_address']}...") |
55 | | - |
56 | | - assign_project_members_to_issues(args) |
57 | | - assign_open_merge_requests(args) |
58 | | - notify_issue_assignees(args, 7) |
59 | | - notify_stale_merge_request_assignees(args, 7) |
60 | | - remove_merged_branches(args) |
| 49 | + """ |
| 50 | + Function calls to the tasks that the GitLab Attendant |
| 51 | + is capable of running. |
| 52 | + """ |
| 53 | + logger.info("GitLab Attendant has woken up...") |
| 54 | + logger.info( |
| 55 | + f"GitLab Attendant will begin attending to GitLab instance at {args['ip_address']}..." |
| 56 | + ) |
61 | 57 |
|
| 58 | + assign_project_members_to_issues(args) |
| 59 | + assign_open_merge_requests(args) |
| 60 | + notify_issue_assignees(args, 7) |
| 61 | + notify_stale_merge_request_assignees(args, 7) |
| 62 | + remove_merged_branches(args) |
62 | 63 |
|
63 | 64 |
|
64 | 65 | def main(): |
65 | | - """ |
| 66 | + """ |
66 | 67 | Entrypoint to the application. |
67 | 68 | """ |
68 | | - args = process_arguments() |
69 | | - schedule.every(int(args["interval"])).hours.do(tasks, args) |
| 69 | + args = process_arguments() |
| 70 | + schedule.every(int(args["interval"])).hours.do(tasks, args) |
70 | 71 |
|
71 | | - while True: |
72 | | - schedule.run_pending() |
73 | | - time.sleep(1) |
| 72 | + while True: |
| 73 | + schedule.run_pending() |
| 74 | + time.sleep(1) |
74 | 75 |
|
75 | 76 |
|
76 | 77 | if __name__ == "__main__": |
|
0 commit comments