diff options
author | Denise sur Lya <sekhmet@lya> | 2021-02-16 14:24:18 +0100 |
---|---|---|
committer | Denise sur Lya <sekhmet@lya> | 2021-02-16 14:24:18 +0100 |
commit | a680b2f78891692be215013481e167da2fffb5d8 (patch) | |
tree | 4b21b675a4a0882dc7920b7ddc6dbb6444de2f79 /gestion_unites.py | |
parent | 685a5f75f63d483d09a593ec69efad882a63a34e (diff) | |
download | oms-a680b2f78891692be215013481e167da2fffb5d8.tar.gz oms-a680b2f78891692be215013481e167da2fffb5d8.tar.zst oms-a680b2f78891692be215013481e167da2fffb5d8.zip |
nettoyage du code + passage en "défaut" de la grille améliorée (améliorée). Correction d'un léger bug sur l'échelle en y.
Diffstat (limited to 'gestion_unites.py')
-rw-r--r-- | gestion_unites.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gestion_unites.py b/gestion_unites.py index b97d90b..d4089bd 100644 --- a/gestion_unites.py +++ b/gestion_unites.py | |||
@@ -2,7 +2,7 @@ | |||
2 | # -*- coding: utf-8 -*- | 2 | # -*- coding: utf-8 -*- |
3 | 3 | ||
4 | from configuration import CONFIG | 4 | from configuration import CONFIG |
5 | from gestion_erreurs import * | 5 | from gestion_erreurs import warning |
6 | 6 | ||
7 | ##################### outils pour affichage et choix de l'unité | 7 | ##################### outils pour affichage et choix de l'unité |
8 | 8 | ||
@@ -31,7 +31,7 @@ def choix_echelle_data(typedonnees, donneemax): | |||
31 | if donneemax>15: | 31 | if donneemax>15: |
32 | return (5,1) | 32 | return (5,1) |
33 | elif donneemax > 10: | 33 | elif donneemax > 10: |
34 | return (2,1) | 34 | return (1,0.5) |
35 | else: | 35 | else: |
36 | return (1,0.2) | 36 | return (1,0.2) |
37 | if typedonnees == "taille": | 37 | if typedonnees == "taille": |
@@ -53,25 +53,25 @@ def choix_echelle_temps(unite, tempsmaxi): | |||
53 | if unite=="jours": | 53 | if unite=="jours": |
54 | if tempsmaxi > 60: # pourquoi mettre en jours ? | 54 | if tempsmaxi > 60: # pourquoi mettre en jours ? |
55 | return (30,1) | 55 | return (30,1) |
56 | elif tempsmaxi >20: | 56 | elif tempsmaxi >15: |
57 | return (7,1) | 57 | return (7,1) |
58 | else: | 58 | else: |
59 | return (1,0) | 59 | return (1,0) |
60 | if unite=="semaines": | 60 | if unite=="semaines": |
61 | if tempsmaxi >50: | 61 | if tempsmaxi >50: |
62 | return (5,1) | 62 | return (5,1) |
63 | elif tempsmaxi > 15: | 63 | elif tempsmaxi > 10: |
64 | return (2,1) | 64 | return (2,1) |
65 | else: | 65 | else: |
66 | return (1,1/7) # On met en jours | 66 | return (1,1/7) # On met en jours |
67 | 67 | ||
68 | if unite=="mois": | 68 | if unite=="mois": |
69 | if tempsmaxi > 30: | 69 | if tempsmaxi > 24: |
70 | return (2,1) | 70 | return (12,1) |
71 | elif tempsmaxi > 10: | 71 | elif tempsmaxi > 10: |
72 | return (1,0) | 72 | return (1,0) |
73 | else: | 73 | else: |
74 | return (1,0.25) # on met en semaines | 74 | return (1,0.25) # on met en semaines à peu près (quart de mois) |
75 | 75 | ||
76 | if unite=="années": | 76 | if unite=="années": |
77 | return (1,1/12) # années / mois | 77 | return (1,1/12) # années / mois |