ositah 24.4.dev1__tar.gz → 24.7.dev1__tar.gz
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.
Potentially problematic release.
This version of ositah might be problematic. Click here for more details.
- {ositah-24.4.dev1/ositah.egg-info → ositah-24.7.dev1}/PKG-INFO +1 -1
- ositah-24.7.dev1/docker/Dockerfile +20 -0
- ositah-24.7.dev1/docker/docker-compose.yml +13 -0
- ositah-24.7.dev1/docker/pyproject-poetry.toml +16 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/main.py +5 -1
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/menus.py +1 -1
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/teams.py +42 -42
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/utils.py +1 -2
- {ositah-24.4.dev1 → ositah-24.7.dev1/ositah.egg-info}/PKG-INFO +1 -1
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah.egg-info/SOURCES.txt +3 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/pyproject.toml +4 -1
- {ositah-24.4.dev1 → ositah-24.7.dev1}/.gitignore +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/.gitlab-ci.yml +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/LICENSE +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/README.md +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/gunicorn.config/README.md +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/gunicorn.config/gunicorn.ositah +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/gunicorn.config/gunicorn@.service +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/gunicorn.config/ositah.conf.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/noxfile.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/__init__.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/app.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/__init__.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/analysis.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/__init__.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/callbacks.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/parameters.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/tools.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/export.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/validation/__init__.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/validation/callbacks.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/validation/main.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/validation/parameters.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/validation/tables.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/apps/validation/tools.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/assets/arrow_down_up.svg +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/assets/ositah.css +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/assets/sort_ascending.svg +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/assets/sort_descending.svg +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/assets/sorttable.js +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/main.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/ositah.example.cfg +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/static/style.css +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/templates/base.html +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/templates/bootstrap_login.html +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/templates/login_form.html +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/__init__.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/agents.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/authentication.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/cache.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/core.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/exceptions.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/hito_db.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/hito_db_model.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/period.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah/utils/projects.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah.egg-info/dependency_links.txt +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah.egg-info/entry_points.txt +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah.egg-info/requires.txt +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/ositah.egg-info/top_level.txt +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/setup.cfg +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/setup.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/README.md +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/accordion.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/authentication.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/checkbox.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/checklist.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/file-selector.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/file-upload.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/long_running_callback.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/pandas_split.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/pandas_split_bug_report.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/pattern-matching-callback.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/progess_bar.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/reset_table_checkboxes.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/sortable_table.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/sqlalchemy_test.py +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/templates/base.html +0 -0
- {ositah-24.4.dev1 → ositah-24.7.dev1}/test-dash/templates/login_form.html +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
FROM python
|
|
2
|
+
|
|
3
|
+
WORKDIR /ositah
|
|
4
|
+
|
|
5
|
+
ENV POETRY_HOME=/opt/poetry
|
|
6
|
+
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
|
|
7
|
+
ENV PATH="$POETRY_HOME/bin:$PATH"
|
|
8
|
+
|
|
9
|
+
RUN apt update
|
|
10
|
+
RUN apt upgrade -qy
|
|
11
|
+
RUN apt install -qy libsasl2-dev python-dev libldap2-dev libssl-dev
|
|
12
|
+
|
|
13
|
+
RUN python -c 'from urllib.request import urlopen; print(urlopen("https://install.python-poetry.org").read().decode())' | python -
|
|
14
|
+
|
|
15
|
+
COPY ./pyproject-poetry.toml ./pyproject.toml
|
|
16
|
+
|
|
17
|
+
# Ensure to get latest ositah version
|
|
18
|
+
RUN poetry add ositah@latest
|
|
19
|
+
|
|
20
|
+
RUN poetry install --no-interaction --no-ansi -vvv
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
version: "3.8"
|
|
2
|
+
services:
|
|
3
|
+
ositah:
|
|
4
|
+
image: ositah
|
|
5
|
+
build: .
|
|
6
|
+
container_name: ositah
|
|
7
|
+
command: "/ositah/.venv/bin/gunicorn --chdir /ositah/conf --config /ositah/conf/ositah.conf.py 'ositah.main:make_app()'"
|
|
8
|
+
volumes:
|
|
9
|
+
- <path to ositah.conf.py>:/ositah/conf/ositah.conf.py
|
|
10
|
+
- <path to ositah.cfg>:/ositah/conf/ositah.cfg
|
|
11
|
+
- ./logs:/ositah/logs
|
|
12
|
+
ports:
|
|
13
|
+
- "7777:7777"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "ositah-app"
|
|
3
|
+
version = "1.0"
|
|
4
|
+
description = "Outils de Suivi d'Activités basé sur Hito"
|
|
5
|
+
authors = ["Michel Jouvin"]
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
|
|
8
|
+
[tool.poetry.dependencies]
|
|
9
|
+
python = "^3.11"
|
|
10
|
+
gunicorn = "^20.1.0"
|
|
11
|
+
greenlet = "^2.0.1"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
[build-system]
|
|
15
|
+
requires = ["poetry-core"]
|
|
16
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -55,7 +55,11 @@ def declaration_periods_layout():
|
|
|
55
55
|
|
|
56
56
|
# Disable creation of a new (next) period if the period matching the current already exists
|
|
57
57
|
today = date.today().isoformat()
|
|
58
|
-
if
|
|
58
|
+
if (
|
|
59
|
+
len(declaration_periods) > 0
|
|
60
|
+
and today >= declaration_periods[-1].start_date
|
|
61
|
+
and today <= declaration_periods[-1].end_date
|
|
62
|
+
):
|
|
59
63
|
current_period_exists = True
|
|
60
64
|
else:
|
|
61
65
|
current_period_exists = False
|
|
@@ -324,7 +324,7 @@ def ositah_jumbotron(title: str, main_text: str, details: str = None, title_clas
|
|
|
324
324
|
return html.Div(
|
|
325
325
|
dbc.Container(
|
|
326
326
|
[
|
|
327
|
-
html.H1(title, className=f"display-3 {title_class if (
|
|
327
|
+
html.H1(title, className=f"display-3 {title_class if (title_class) else ''}"),
|
|
328
328
|
html.P(
|
|
329
329
|
main_text,
|
|
330
330
|
className="lead",
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import re
|
|
2
|
-
from typing import Dict, List
|
|
3
|
-
|
|
4
|
-
import pandas as pd
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def get_hito_teams():
|
|
8
|
-
"""
|
|
9
|
-
Return Hito teams as a Dataframe
|
|
10
|
-
|
|
11
|
-
:return: Hito teams
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
from .
|
|
15
|
-
|
|
16
|
-
team_query = Team.query
|
|
17
|
-
|
|
18
|
-
teams = pd.read_sql(team_query.statement, con=db.session.bind)
|
|
19
|
-
|
|
20
|
-
return teams
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def get_project_team_ids(team_config: Dict[str, str], project: str) -> List[str]:
|
|
24
|
-
"""
|
|
25
|
-
Return the list of team ID associated with the project based on the configuration passed.
|
|
26
|
-
The configuration is a dict where the key is a pattern applied to the project name and
|
|
27
|
-
the value is the list of team names.
|
|
28
|
-
|
|
29
|
-
:param team_config: dict describing the teams associated with a project
|
|
30
|
-
:param project: project name
|
|
31
|
-
:return: list of team ids or None if no match is found
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
for pattern, team_list in team_config.items():
|
|
35
|
-
if re.match(pattern, project):
|
|
36
|
-
hito_teams = get_hito_teams()
|
|
37
|
-
hito_teams["selected"] = False
|
|
38
|
-
for team_pattern in team_list:
|
|
39
|
-
hito_teams.loc[hito_teams.nom.str.match(f"{team_pattern}$"), "selected"] = True
|
|
40
|
-
return hito_teams["id"].to_list()
|
|
41
|
-
|
|
42
|
-
return None
|
|
1
|
+
import re
|
|
2
|
+
from typing import Dict, List
|
|
3
|
+
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_hito_teams():
|
|
8
|
+
"""
|
|
9
|
+
Return Hito teams as a Dataframe
|
|
10
|
+
|
|
11
|
+
:return: Hito teams
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from .hito_db_model import Team, db
|
|
15
|
+
|
|
16
|
+
team_query = Team.query
|
|
17
|
+
|
|
18
|
+
teams = pd.read_sql(team_query.statement, con=db.session.bind)
|
|
19
|
+
|
|
20
|
+
return teams
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def get_project_team_ids(team_config: Dict[str, str], project: str) -> List[str]:
|
|
24
|
+
"""
|
|
25
|
+
Return the list of team ID associated with the project based on the configuration passed.
|
|
26
|
+
The configuration is a dict where the key is a pattern applied to the project name and
|
|
27
|
+
the value is the list of team names.
|
|
28
|
+
|
|
29
|
+
:param team_config: dict describing the teams associated with a project
|
|
30
|
+
:param project: project name
|
|
31
|
+
:return: list of team ids or None if no match is found
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
for pattern, team_list in team_config.items():
|
|
35
|
+
if re.match(pattern, project):
|
|
36
|
+
hito_teams = get_hito_teams()
|
|
37
|
+
hito_teams["selected"] = False
|
|
38
|
+
for team_pattern in team_list:
|
|
39
|
+
hito_teams.loc[hito_teams.nom.str.match(f"{team_pattern}$"), "selected"] = True
|
|
40
|
+
return hito_teams["id"].to_list()
|
|
41
|
+
|
|
42
|
+
return None
|
|
@@ -5,7 +5,6 @@ from typing import List
|
|
|
5
5
|
|
|
6
6
|
import dash_bootstrap_components as dbc
|
|
7
7
|
from dash import html
|
|
8
|
-
from dateutil.relativedelta import relativedelta
|
|
9
8
|
from flask import session
|
|
10
9
|
from flask_sqlalchemy import SQLAlchemy
|
|
11
10
|
from hito_tools.exceptions import ConfigFileEmpty, ConfigMissingParam
|
|
@@ -389,7 +388,7 @@ def define_config_params(file):
|
|
|
389
388
|
config["declaration"]["thresholds"] = {"low": 50, "suspect": 75, "good": 100}
|
|
390
389
|
# Default declaration period date defaults to current day if not explicitly defined
|
|
391
390
|
if "default_date" not in config["declaration"]:
|
|
392
|
-
config["declaration"]["default_date"] = datetime.now()
|
|
391
|
+
config["declaration"]["default_date"] = datetime.now()
|
|
393
392
|
global_params.declaration_options = config["declaration"]
|
|
394
393
|
|
|
395
394
|
if "validation" not in config:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ositah"
|
|
7
|
-
version = "24.
|
|
7
|
+
version = "24.7.dev1"
|
|
8
8
|
description = "Outils de Suivi d'Activités basé sur Hito"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -47,3 +47,6 @@ Homepage = "https://gitlab.in2p3.fr/hito/ositah"
|
|
|
47
47
|
|
|
48
48
|
[project.scripts]
|
|
49
49
|
ositah = "ositah.main:main"
|
|
50
|
+
|
|
51
|
+
[tool.setuptools]
|
|
52
|
+
py-modules = [ "ositah" ]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|