ositah 24.4.dev1__py3-none-any.whl → 24.7.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. {ositah-24.4.dev1.dist-info → ositah-24.7.dev1.dist-info}/METADATA +1 -1
  2. ositah-24.7.dev1.dist-info/RECORD +6 -0
  3. {ositah-24.4.dev1.dist-info → ositah-24.7.dev1.dist-info}/WHEEL +1 -1
  4. ositah/__init__.py +0 -0
  5. ositah/app.py +0 -17
  6. ositah/apps/__init__.py +0 -0
  7. ositah/apps/analysis.py +0 -774
  8. ositah/apps/configuration/__init__.py +0 -0
  9. ositah/apps/configuration/callbacks.py +0 -917
  10. ositah/apps/configuration/main.py +0 -542
  11. ositah/apps/configuration/parameters.py +0 -74
  12. ositah/apps/configuration/tools.py +0 -112
  13. ositah/apps/export.py +0 -1172
  14. ositah/apps/validation/__init__.py +0 -0
  15. ositah/apps/validation/callbacks.py +0 -240
  16. ositah/apps/validation/main.py +0 -89
  17. ositah/apps/validation/parameters.py +0 -25
  18. ositah/apps/validation/tables.py +0 -654
  19. ositah/apps/validation/tools.py +0 -533
  20. ositah/assets/arrow_down_up.svg +0 -4
  21. ositah/assets/ositah.css +0 -54
  22. ositah/assets/sort_ascending.svg +0 -5
  23. ositah/assets/sort_descending.svg +0 -6
  24. ositah/assets/sorttable.js +0 -499
  25. ositah/main.py +0 -449
  26. ositah/ositah.example.cfg +0 -215
  27. ositah/static/style.css +0 -54
  28. ositah/templates/base.html +0 -22
  29. ositah/templates/bootstrap_login.html +0 -38
  30. ositah/templates/login_form.html +0 -27
  31. ositah/utils/__init__.py +0 -0
  32. ositah/utils/agents.py +0 -117
  33. ositah/utils/authentication.py +0 -287
  34. ositah/utils/cache.py +0 -19
  35. ositah/utils/core.py +0 -13
  36. ositah/utils/exceptions.py +0 -64
  37. ositah/utils/hito_db.py +0 -51
  38. ositah/utils/hito_db_model.py +0 -245
  39. ositah/utils/menus.py +0 -339
  40. ositah/utils/period.py +0 -135
  41. ositah/utils/projects.py +0 -1175
  42. ositah/utils/teams.py +0 -42
  43. ositah/utils/utils.py +0 -459
  44. ositah-24.4.dev1.dist-info/RECORD +0 -46
  45. {ositah-24.4.dev1.dist-info → ositah-24.7.dev1.dist-info}/LICENSE +0 -0
  46. {ositah-24.4.dev1.dist-info → ositah-24.7.dev1.dist-info}/entry_points.txt +0 -0
  47. {ositah-24.4.dev1.dist-info → ositah-24.7.dev1.dist-info}/top_level.txt +0 -0
@@ -1,112 +0,0 @@
1
- """
2
- Various functions used by Configure sub-application
3
- """
4
-
5
- import re
6
-
7
- import pandas as pd
8
-
9
- from ositah.apps.configuration.parameters import (
10
- PROJECT_MGT_PROJECT_TYPE_DISABLED,
11
- PROJECT_MGT_PROJECT_TYPE_LOCAL,
12
- )
13
- from ositah.utils.projects import (
14
- MASTERPROJECT_DELETED_ACTIVITY,
15
- MASTERPROJECT_LOCAL_PROJECT,
16
- get_all_hito_activities,
17
- )
18
-
19
-
20
- def list_box_empty(list_options):
21
- """
22
- Check if the options of the list box contains only one entry corresponding to a
23
- placeholder item.
24
-
25
- :param team_list_items: options of a list box
26
- :return: boolean (true if only a placeholder entry is present)
27
- """
28
-
29
- if (
30
- len(list_options) == 1
31
- and list_options[0]["label"] is None
32
- and list_options[0]["value"] is None
33
- ):
34
- return True
35
- else:
36
- return False
37
-
38
-
39
- def get_masterprojects_items(project_activity, category: int = None) -> list:
40
- """
41
- Build the item list for masterprojects to be displayed in a select compoenent
42
-
43
- :param project_activity: True if it is a project rather than a Hito activity
44
- :param category: one of PROJECT_MGT_PROJECT_TYPE_xxx values or None. If None, menas
45
- all active (non disabled) projects/activities
46
- :return: list of projects/activities
47
- """
48
-
49
- if category == PROJECT_MGT_PROJECT_TYPE_LOCAL:
50
- # Local projects have no masterproject
51
- return []
52
-
53
- activities = get_all_hito_activities(project_activity)
54
- masterproject_items = []
55
- if category == PROJECT_MGT_PROJECT_TYPE_DISABLED:
56
- disabled = pd.DataFrame()
57
- disabled[["masterproject_real", "project_real"]] = activities[
58
- activities.masterproject == MASTERPROJECT_DELETED_ACTIVITY
59
- ]["project"].str.split(" / ", n=1, expand=True)
60
- for masterproject in sorted(
61
- disabled["masterproject_real"].unique(),
62
- key=lambda x: x.upper(),
63
- ):
64
- masterproject_items.append({"label": masterproject, "value": masterproject})
65
- else:
66
- masterproject_items = sorted(
67
- activities[
68
- (activities.masterproject != MASTERPROJECT_DELETED_ACTIVITY)
69
- & (activities.masterproject != MASTERPROJECT_LOCAL_PROJECT)
70
- ]["masterproject"].unique(),
71
- key=lambda x: x.upper(),
72
- )
73
-
74
- return masterproject_items
75
-
76
-
77
- def get_projects_items(masterproject, project_activity, category: int = None) -> list:
78
- """
79
- Build the item list for projects to be displayed in a select compoenent
80
-
81
- :param masterproject: selected master project
82
- :param project_activity: True if it is a project rather than a Hito activity
83
- :param category: one of PROJECT_MGT_PROJECT_TYPE_xxx values or None. If None, menas
84
- all active (non disabled) projects/activities
85
- :return: list of projects/activities
86
- """
87
-
88
- if category == PROJECT_MGT_PROJECT_TYPE_LOCAL:
89
- project_prefix = masterproject
90
- masterproject = MASTERPROJECT_LOCAL_PROJECT
91
- elif category == PROJECT_MGT_PROJECT_TYPE_DISABLED:
92
- project_prefix = masterproject
93
- masterproject = MASTERPROJECT_DELETED_ACTIVITY
94
- else:
95
- project_prefix = None
96
-
97
- if masterproject:
98
- activities = get_all_hito_activities(project_activity)
99
- project_items = []
100
- for project in sorted(
101
- activities[activities.masterproject == masterproject]["project"].unique(),
102
- key=lambda x: x.upper(),
103
- ):
104
- if project_prefix is None or re.match(rf"{project_prefix}", project):
105
- if category == PROJECT_MGT_PROJECT_TYPE_DISABLED:
106
- project_name = project.split("/")[1]
107
- else:
108
- project_name = project
109
- project_items.append({"label": project_name, "value": project})
110
- return project_items
111
- else:
112
- return []