logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 13-05-2020 22:38:47

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

[mis en dormance] Aide solicitée : programmation d'interfaces

Bonjour à tous,

je vous ai partagé un petit projet d'une interface graphique pour créer des conky il y a quelques temps par ici (qui fonctionne mais a ses limites)
J'essaie ces temps ci de la reproduire en Qt5 avec PyQt5 (par là), mais voilà, je n'arrive pas à organiser mon code
donc je cherche une bonne âme qui voudrai bien jeter un oeil et m'aider/me diriger vers une bonne structure à adopter


Voici un peu plus de détails:
1) à propos :
L'interface doit permettre de dessiner des formes à la souris (cercle, barre, ellipse, texte), d'en éditer manuellement les propriétés (épaisseur, couleur...) et enfin de générer un fichier de configuration pour un conky + lua.

2) mon interface se divise en plusieurs zones:
   * des boutons => qui initient la création d'une forme
   * un zone de dessin, où l'on peut déplacer et modifier la taille des objets
   * une liste des objet créés
   * une liste des propriétés de l'objet sélectionné

3) je pars d'un logiciel : qtdesigner, qui me génère un fichier avec un objet "MainInterface" avec des attributs qui représentent chaque module de mon interface (liste déroulante, zone de dessin, boutons poussoirs...)

4) difficultés:
J'ai du mal à adopter une simple organisation interface <=> données, celles-ci sont en fait représentés en permanence sous forme graphique et de liste de propriétés et la moindre action doit modifier la quasi totalité des éléments de l'interface, ça fait des fils partout et nœuds dans la tête...

Voilà, je pose ça ici sans grand espoir, mais si jamais vous avez l'habitude de ces choses là, des conseils à prodiguer ou des documents qui ont pu vous aidez dans de similaires questionnements. Je suis preneur de tout puisque sinon c'est "hop! oublié au fond des projets pas fini" tant je n'arrive pas à avancer la dessus

Dernière modification par David5647 (04-12-2020 14:41:04)

Hors ligne

#2 27-11-2020 16:31:01

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

salut, je tombe sur ton projet qui a l'air dément,  je n'ai pas réussi à l'installer selon tes recommandations... peut-être avec virtualenv..?
l'interface me paraît suffisament simple à la vue de la capture d'écran pour la compliquer, tu devrais laisser ce même modèle avec Qt5 si possible...

#3 28-11-2020 00:57:43

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

Salut!

Ahah! Quelqu'un! =P

Anonyme-14 a écrit :

je n'ai pas réussi à l'installer selon tes recommandations... peut-être avec virtualenv..?


Ca fait un peu de temps que j'ai pas touché a ça. Je viens de retenter chez moi avec un environnement virtuel.

cd ConkyLuaMakerGUIv2
mkdir .venv
python3 -m venv .venv/
source .venv/bin/activate
 


Normalement (.venv) est indiqué dans le prompt
Bon pygame m'a posé soucis : éditer le fichier requirements.txt et remplacer avec

pygame==2.0.0
pygame-gui==0.4.2


Puisque tu es dans l'environnement virtuel, pour installer les dépendances, simplement:

pip install -r requirements.txt


Si ça passe, tu peux lancer le programme: (tjrs dans le ".venv")

python conky_lua_maker_main.py


Si ça se lance, tu peux faire load_config sur le bouton du haut, ça devrait charger l'exemple visible dans les screenshots.

Voilà, dis-moi où ça plante si ça plante!

Anonyme-14 a écrit :

l'interface me paraît suffisament simple à la vue de la capture d'écran pour la compliquer, tu devrais laisser ce même modèle avec Qt5 si possible...


L'idée était pas forcément de compliquer l'interface, mais de faire plus propre, plus stable (j'ai eu qq soucis avec pygame-gui), et j'aurai bien aimé faire un truc d'alias pour certaines variables. Histoire de pouvoir changer le thème global sans changer une à une toute les composantes. Pyqt aurait été plus simple autant pour faire des onglets que des tableaux de propriétés. Enfin, pyqt c"est assez complexe et je n'ai pas vraiment réussi à faire communiquer la zone de preview et tout ce qu'il y a autour. Bref, trop compliqué.

Dernière modification par David5647 (28-11-2020 00:59:11)

Hors ligne

#4 28-11-2020 01:21:17

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

aaaaa my gosh it's late, j'aimerais tester ton programme, je refais des tentatives demain smile

#5 28-11-2020 10:54:17

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

coucou l'install ne va pas à son terme

toulibre@toulibre:~/Téléchargements/ConkyLuaMakerGUIv2-master$ python3 -m venv .venv/
toulibre@toulibre:~/Téléchargements/ConkyLuaMakerGUIv2-master$ source .venv/bin/activate
(.venv) toulibre@toulibre:~/Téléchargements/ConkyLuaMakerGUIv2-master$ pip install -r requirements.txt
Collecting pygame_gui==0.4.2 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/72/98/8da04a97548221ce220d9bdf11eb741bcff82015c2ac692cd7d9f766e8f9/pygame_gui-0.4.2.tar.gz (938kB)
    100% |████████████████████████████████| 942kB 843kB/s
Collecting pygame==2.0.0 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/81/b1/c84d986be30bbab263eadcf4f553d042c053f9600bdf9b881ce3db69e74d/pygame-2.0.0-cp37-cp37m-manylinux1_x86_64.whl (11.5MB)
    100% |████████████████████████████████| 11.5MB 117kB/s
Building wheels for collected packages: pygame-gui
  Running setup.py bdist_wheel for pygame-gui ... error
  Complete output from command /home/toulibre/Téléchargements/ConkyLuaMakerGUIv2-master/.venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-35esf_1e/pygame-gui/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-cf9tzj_w --python-tag cp37:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
 
  error: invalid command 'bdist_wheel'
 
  ----------------------------------------
  Failed building wheel for pygame-gui
  Running setup.py clean for pygame-gui
Failed to build pygame-gui
Installing collected packages: pygame, pygame-gui
  Running setup.py install for pygame-gui ... done
Successfully installed pygame-2.0.0 pygame-gui-0.4.2
(.venv) toulibre@toulibre:~/Téléchargements/ConkyLuaMakerGUIv2-master$ python conky_lua_maker_main.py
pygame 2.0.0 (SDL 2.0.12, python 3.7.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
/home/toulibre/Téléchargements/ConkyLuaMakerGUIv2-master/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_font_dictionary.py:214: UserWarning: Failed to load font at path: /usr/share/fonts/truetype/noto/NotoSans-Regular.ttf
  warnings.warn("Failed to load font at path: " + self.known_font_paths[font_name][0])
/home/toulibre/Téléchargements/ConkyLuaMakerGUIv2-master/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_font_dictionary.py:127: UserWarning: Finding font with id: notosans_regular_12 that is not already loaded.
Preload this font with {'name': 'notosans', 'point_size': 12, 'style': 'regular'}
  warnings.warn(warning_string, UserWarning)
Traceback (most recent call last):
  File "conky_lua_maker_main.py", line 434, in <module>
    interface = main_interface()
  File "conky_lua_maker_main.py", line 88, in __init__
    self.manager = pygame_gui.UIManager(INTERFACE_SIZE, "themes/label_theme.json")
  File "/home/toulibre/Téléchargements/ConkyLuaMakerGUIv2-master/.venv/lib/python3.7/site-packages/pygame_gui/ui_manager.py", line 21, in __init__
    self.ui_theme.load_theme(theme_path)
  File "/home/toulibre/Téléchargements/ConkyLuaMakerGUIv2-master/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_appearance_theme.py", line 584, in load_theme
    self.load_fonts()  # save to trigger load with the same data as it won't do anything
  File "/home/toulibre/Téléchargements/ConkyLuaMakerGUIv2-master/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_appearance_theme.py", line 226, in load_fonts
    font_info['italic'])
  File "/home/toulibre/Téléchargements/ConkyLuaMakerGUIv2-master/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_font_dictionary.py", line 129, in find_font
    return self.loaded_fonts[font_id]
KeyError: 'notosans_regular_12'
(.venv) toulibre@toulibre:~/Téléchargements/ConkyLuaMakerGUIv2-master$

#6 28-11-2020 13:36:36

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

Il n'a pas réussi à installer pygame-gui
essaie ça:

apt install python3-wheel


edit : et ça :

apt install python3-setuptools


et reprend à partir de source .venv/bin/active

Dernière modification par David5647 (28-11-2020 13:38:29)

Hors ligne

#7 28-11-2020 13:43:13

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

aïe aïe aïe

toulibre@toulibre:~$ sudo apt install python3-wheel
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances      
Lecture des informations d'
état... Fait
python3-wheel est déjà la version la plus récente (0.32.3-2).
python3-wheel passé en « installé manuellement ».
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
toulibre@toulibre:~$ sudo apt install python3-setuptools
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances      
Lecture des informations d'
état... Fait
python3-setuptools est déjà la version la plus récente (40.8.0-1).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
toulibre@toulibre:~$



c'était déjà présent
lorsque je veux lancer le programme avec

python conky_lua_maker_main.py


la fenêtre s'ouvre et se referme en une fraction de seconde

#8 28-11-2020 14:12:57

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

Ok, je vais voir si j'ai pas une machine virtuelle qui traîne, histoire de reprendre tout depuis zéro.

Hors ligne

#9 28-11-2020 14:59:33

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

Bon, j'ai relancé tout ça sous buster netinstall + xfce 32bits,

python3 --version


Python 3.7.3


paquets installés:

apt install git python3-pip python3-setuptools python3-wheel python3-venv


Je viens de penser à un truc, clone le dépôt, mes releases sont un peu cassées il me semble.

git clone https://github.com/Daguhh/ConkyLuaMakerGUIv2.git


On repart sur la même procédure:

cd ConkyLuaMakerGUIv2
mkdir .venv
python3 -m venv .venv/
source .venv/bin/activate


Sans rien modifier au fichiers requirements.txt:(doit y avoir un changement au niveau de la lib sdl pour bullseye qui est bloquant, pas sous buster apparemment)

pip install -r requirements.txt


enfin :

python conky_lua_maker_main.py


Ca se lance bien.

Anonyme-14 a écrit :

la fenêtre s'ouvre et se referme en une fraction de seconde


Pas de message d'erreur?

Sinon, essaie de supprimer le dossier et de repartir de zéro. en prenant bien un clone du dépôt comme source. Normalement pas de raison que ça ne fonctionne pas. Enfin ,je vois pas trop...

Hors ligne

#10 28-11-2020 15:50:21

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

toulibre@toulibre:~$ git clone https://github.com/Daguhh/ConkyLuaMakerGUIv2.git
Clonage dans 'ConkyLuaMakerGUIv2'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 756 (delta 0), reused 0 (delta 0), pack-reused 753
Réception d'objets: 100% (756/756), 1.82 MiB | 1.16 MiB/s, fait.
Résolution des deltas: 100% (488/488), fait.
toulibre@toulibre:~$ cd ConkyLuaMakerGUIv2
toulibre@toulibre:~/ConkyLuaMakerGUIv2$  mkdir .venv
toulibre@toulibre:~/ConkyLuaMakerGUIv2$  python3 -m venv .venv/
toulibre@toulibre:~/ConkyLuaMakerGUIv2$  source .venv/bin/activate
(.venv) toulibre@toulibre:~/ConkyLuaMakerGUIv2$ pip install -r requirements.txt
Collecting pygame_gui==0.4.2 (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/72/98/8da04a97548221ce220d9bdf11eb741bcff82015c2ac692cd7d9f766e8f9/pygame_gui-0.4.2.tar.gz
Collecting pygame==1.9.6 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/18/b3/0bf5afdcf6ef95d2a343cd7865585a6efe5e3e727c1a4f3385c9935248cf/pygame-1.9.6-cp37-cp37m-manylinux1_x86_64.whl (11.4MB)
    87% |████████████████████████████    | 10.0MB 1.1MB/s eta 0:00:0    87% |████████████████████████████    | 10.0MB 1.3MB/s eta 0:00:0    87% |████████████████████████████    | 10.0MB 1.3MB/s eta 0:00:0    87% |████████████████████████████    | 10.0MB 1.3MB/s eta 0:00:0    87% |████████████████████████████    | 10.0MB 1.3MB/s eta 0:00:0    87% |████████████████████████████    | 10.0MB 1.1MB/s eta 0:00:0    87% |████████████████████████████    | 10.0MB 1.3MB/s eta 0:00:0    87% |████████████████████████████    | 10.0MB 1.3MB/s eta 0:00:0    87% |████████████████████████████▏   | 10.0MB 1.1MB/s eta 0:00:0    87% |████████████████████████████▏   | 10.0MB 1.3MB/s eta 0:00:0    88% |████████████████████████████▏   | 10.1MB 1.3MB/s eta 0:00:0    88% |████████████████████████████▏   | 10.1MB 1.3MB/s eta 0:00:0    88% |████████████████████████████▎   | 10.1MB 1.3MB/s eta 0:00:0    88% |████████████████████████████▎   | 10.1MB 1.1MB/s eta 0:00:0    88% |████████████████████████████▎   | 10.1MB 1.3MB/s eta 0:00:0    88% |████████████████████████████▎   | 10.1MB 1.4MB/s eta 0:00:0    88% |████████████████████████████▍   | 10.1MB 1.2MB/s eta 0:00:0    88% |████████████████████████████▍   | 10.1MB 1.3MB/s eta 0:00:0    88% |████████████████████████████▍   | 10.1MB 1.4MB/s eta 0:00:0    88% |████████████████████████████▌   | 10.1MB 1.4MB/s eta 0:00:0    88% |████████████████████████████▌   | 10.2MB 1.4MB/s eta 0:00:0    89% |████████████████████████████▌   | 10.2MB 1.2MB/s eta 0:00:0    89% |████████████████████████████▌   | 10.2MB 1.3MB/s eta 0:00:0    89% |████████████████████████████▋   | 10.2MB 1.4MB/s eta 0:00:0    89% |████████████████████████████▋   | 10.2MB 1.2MB/s eta 0:00:0    89% |████████████████████████████▋   | 10.2MB 1.3MB/s eta 0:00:0    89% |████████████████████████████▋   | 10.2MB 1.3MB/s eta 0:00:0    89% |████████████████████████████▊   | 10.2MB 1.3MB/s eta 0:00:0    89% |████████████████████████████▊   | 10.2MB 1.3MB/s eta 0:00:0    89% |████████████████████████████▊   | 10.3MB 1.2MB/s eta 0:00:0    89% |████████████████████████████▊   | 10.3MB 1.3MB/s eta 0:00:0    89% |████████████████████████████▉   | 10.3MB 1.3MB/s eta 0:00:0    90% |████████████████████████████▉   | 10.3MB 1.2MB/s eta 0:00:0    90% |████████████████████████████▉   | 10.3MB 1.3MB/s eta 0:00:0    90% |████████████████████████████▉   | 10.3MB 1.3MB/s eta 0:00:0    90% |█████████████████████████████   | 10.3MB 1.3MB/s eta 0:00:0    90% |█████████████████████████████   | 10.3MB 1.3MB/s eta 0:00:0    90% |█████████████████████████████   | 10.3MB 1.1MB/s eta 0:00:0    90% |█████████████████████████████   | 10.3MB 1.3MB/s eta 0:00:0    90% |█████████████████████████████   | 10.4MB 1.3MB/s eta 0:00:0    90% |█████████████████████████████   | 10.4MB 1.2MB/s eta 0:00:0    90% |█████████████████████████████   | 10.4MB 1.3MB/s eta 0:00:0    90% |█████████████████████████████   | 10.4MB 1.3MB/s eta 0:00:0    91% |█████████████████████████████▏  | 10.4MB 1.3MB/s eta 0:00:0    91% |█████████████████████████████▏  | 10.4MB 1.3MB/s eta 0:00:0    91% |█████████████████████████████▏  | 10.4MB 1.2MB/s eta 0:00:0    91% |█████████████████████████████▏  | 10.4MB 1.3MB/s eta 0:00:0    91% |█████████████████████████████▎  | 10.4MB 1.4MB/s eta 0:00:0    91% |█████████████████████████████▎  | 10.4MB 1.2MB/s eta 0:00:0    91% |█████████████████████████████▎  | 10.5MB 1.3MB/s eta 0:00:0    91% |█████████████████████████████▍  | 10.5MB 1.3MB/s eta 0:00:0    91% |█████████████████████████████▍  | 10.5MB 1.3MB/s eta 0:00:0    91% |█████████████████████████████▍  | 10.5MB 1.4MB/s eta 0:00:0    91% |█████████████████████████████▍  | 10.5MB 1.2MB/s eta 0:00:0    92% |█████████████████████████████▌  | 10.5MB 1.3MB/s eta 0:00:0    92% |█████████████████████████████▌  | 10.5MB 1.3MB/s eta 0:00:0    92% |█████████████████████████████▌  | 10.5MB 1.2MB/s eta 0:00:0    92% |█████████████████████████████▌  | 10.5MB 1.3MB/s eta 0:00:0    92% |█████████████████████████████▋  | 10.5MB 1.3MB/s eta 0:00:0    92% |█████████████████████████████▋  | 10.6MB 1.3MB/s eta 0:00:0    92% |█████████████████████████████▋  | 10.6MB 1.3MB/s eta 0:00:0    92% |█████████████████████████████▋  | 10.6MB 1.1MB/s eta 0:00:0    92% |█████████████████████████████▊  | 10.6MB 1.3MB/s eta 0:00:0    92% |█████████████████████████████▊  | 10.6MB 1.3MB/s eta 0:00:0    92% |█████████████████████████████▊  | 10.6MB 1.2MB/s eta 0:00:0    93% |█████████████████████████████▊  | 10.6MB 1.3MB/s eta 0:00:0    93% |█████████████████████████████▉  | 10.6MB 1.3MB/s eta 0:00:0    93% |█████████████████████████████▉  | 10.6MB 1.3MB/s eta 0:00:0    93% |█████████████████████████████▉  | 10.6MB 1.3MB/s eta 0:00:0    93% |█████████████████████████████▉  | 10.7MB 1.2MB/s eta 0:00:0    93% |██████████████████████████████  | 10.7MB 1.3MB/s eta 0:00:0    93% |██████████████████████████████  | 10.7MB 1.3MB/s eta 0:00:0    93% |██████████████████████████████  | 10.7MB 1.2MB/s eta 0:00:0    93% |██████████████████████████████  | 10.7MB 1.3MB/s eta 0:00:0    93% |██████████████████████████████  | 10.7MB 1.3MB/s eta 0:00:0    93% |██████████████████████████████  | 10.7MB 1.3MB/s eta 0:00:0    94% |██████████████████████████████  | 10.7MB 1.3MB/s eta 0:00:0    94% |██████████████████████████████▏ | 10.7MB 1.2MB/s eta 0:00:0    94% |██████████████████████████████▏ | 10.8MB 1.3MB/s eta 0:00:0    94% |██████████████████████████████▏ | 10.8MB 1.3MB/s eta 0:00:0    94% |██████████████████████████████▏ | 10.8MB 1.1MB/s eta 0:00:0    94% |██████████████████████████████▎ | 10.8MB 1.3MB/s eta 0:00:0    94% |██████████████████████████████▎ | 10.8MB 1.3MB/s eta 0:00:0    94% |██████████████████████████████▎ | 10.8MB 1.3MB/s eta 0:00:0    94% |██████████████████████████████▎ | 10.8MB 1.4MB/s eta 0:00:0    94% |██████████████████████████████▍ | 10.8MB 1.2MB/s eta 0:00:0    94% |██████████████████████████████▍ | 10.8MB 1.3MB/s eta 0:00:0    94% |██████████████████████████████▍ | 10.8MB 1.3MB/s eta 0:00:0    95% |██████████████████████████████▍ | 10.9MB 1.1MB/s eta 0:00:0    95% |██████████████████████████████▌ | 10.9MB 1.3MB/s eta 0:00:0    95% |██████████████████████████████▌ | 10.9MB 1.4MB/s eta 0:00:0    95% |██████████████████████████████▌ | 10.9MB 1.4MB/s eta 0:00:0    95% |██████████████████████████████▌ | 10.9MB 1.3MB/s eta 0:00:0    95% |██████████████████████████████▋ | 10.9MB 1.2MB/s eta 0:00:0    95% |██████████████████████████████▋ | 10.9MB 1.3MB/s eta 0:00:0    95% |██████████████████████████████▋ | 10.9MB 1.3MB/s eta 0:00:0    95% |██████████████████████████████▋ | 10.9MB 1.2MB/s eta 0:00:0    95% |██████████████████████████████▊ | 10.9MB 1.3MB/s eta 0:00:0    95% |██████████████████████████████▊ | 11.0MB 1.3MB/s eta 0:00:0    96% |██████████████████████████████▊ | 11.0MB 1.3MB/s eta 0:00:0    96% |██████████████████████████████▊ | 11.0MB 1.3MB/s eta 0:00:0    96% |██████████████████████████████▉ | 11.0MB 1.2MB/s eta 0:00:0    96% |██████████████████████████████▉ | 11.0MB 1.3MB/s eta 0:00:0    96% |██████████████████████████████▉ | 11.0MB 1.4MB/s eta 0:00:0    96% |██████████████████████████████▉ | 11.0MB 1.2MB/s eta 0:00:0    96% |███████████████████████████████ | 11.0MB 1.3MB/s eta 0:00:0    96% |███████████████████████████████ | 11.0MB 1.3MB/s eta 0:00:0    96% |███████████████████████████████ | 11.0MB 1.3MB/s eta 0:00:0    96% |███████████████████████████████ | 11.1MB 1.4MB/s eta 0:00:0    96% |███████████████████████████████ | 11.1MB 1.2MB/s eta 0:00:0    97% |███████████████████████████████ | 11.1MB 1.3MB/s eta 0:00:0    97% |███████████████████████████████ | 11.1MB 1.4MB/s eta 0:00:0    97% |███████████████████████████████▏| 11.1MB 1.2MB/s eta 0:00:0    97% |███████████████████████████████▏| 11.1MB 1.3MB/s eta 0:00:0    97% |███████████████████████████████▏| 11.1MB 1.3MB/s eta 0:00:0    97% |███████████████████████████████▏| 11.1MB 1.3MB/s eta 0:00:0    97% |███████████████████████████████▎| 11.1MB 1.3MB/s eta 0:00:0    97% |███████████████████████████████▎| 11.2MB 1.1MB/s eta 0:00:0    97% |███████████████████████████████▎| 11.2MB 1.3MB/s eta 0:00:0    97% |███████████████████████████████▎| 11.2MB 1.3MB/s eta 0:00:0    97% |███████████████████████████████▍| 11.2MB 1.2MB/s eta 0:00:0    98% |███████████████████████████████▍| 11.2MB 1.3MB/s eta 0:00:0    98% |███████████████████████████████▍| 11.2MB 1.3MB/s eta 0:00:0    98% |███████████████████████████████▍| 11.2MB 1.3MB/s eta 0:00:0    98% |███████████████████████████████▌| 11.2MB 1.4MB/s eta 0:00:0    98% |███████████████████████████████▌| 11.2MB 1.2MB/s eta 0:00:0    98% |███████████████████████████████▌| 11.2MB 1.3MB/s eta 0:00:0    98% |███████████████████████████████▌| 11.3MB 1.3MB/s eta 0:00:0    98% |███████████████████████████████▋| 11.3MB 1.2MB/s eta 0:00:0    98% |███████████████████████████████▋| 11.3MB 1.3MB/s eta 0:00:0    98% |███████████████████████████████▋| 11.3MB 1.3MB/s eta 0:00:0    98% |███████████████████████████████▋| 11.3MB 1.3MB/s eta 0:00:0    99% |███████████████████████████████▊| 11.3MB 1.3MB/s eta 0:00:0    99% |███████████████████████████████▊| 11.3MB 1.2MB/s eta 0:00:0    99% |███████████████████████████████▊| 11.3MB 1.3MB/s eta 0:00:0    99% |███████████████████████████████▊| 11.3MB 1.3MB/s eta 0:00:0    99% |███████████████████████████████▉| 11.3MB 1.1MB/s eta 0:00:0    99% |███████████████████████████████▉| 11.4MB 1.3MB/s eta 0:00:0    99% |███████████████████████████████▉| 11.4MB 1.3MB/s eta 0:00:0    99% |████████████████████████████████| 11.4MB 1.3MB/s eta 0:00:0    99% |████████████████████████████████| 11.4MB 1.3MB/s eta 0:00:0    99% |████████████████████████████████| 11.4MB 1.1MB/s eta 0:00:0    99% |████████████████████████████████| 11.4MB 1.3MB/s eta 0:00:0    100% |████████████████████████████████| 11.4MB 119kB/s
Building wheels for collected packages: pygame-gui
  Running setup.py bdist_wheel for pygame-gui ... error
  Complete output from command /home/toulibre/ConkyLuaMakerGUIv2/.venv/bin/python3 -u -c "import setuptools, tokenize;__file__='
/tmp/pip-install-77z4hfcg/pygame-gui/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-umhtu5gz --python-tag cp37:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
 
  error: invalid command '
bdist_wheel'
 
  ----------------------------------------
  Failed building wheel for pygame-gui
  Running setup.py clean for pygame-gui
Failed to build pygame-gui
Installing collected packages: pygame, pygame-gui
  Running setup.py install for pygame-gui ... done
Successfully installed pygame-1.9.6 pygame-gui-0.4.2
(.venv) toulibre@toulibre:~/ConkyLuaMakerGUIv2$ python conky_lua_maker_main.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_font_dictionary.py:214: UserWarning: Failed to load font at path: /usr/share/fonts/truetype/noto/NotoSans-Regular.ttf
  warnings.warn("Failed to load font at path: " + self.known_font_paths[font_name][0])
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_font_dictionary.py:127: UserWarning: Finding font with id: notosans_regular_12 that is not already loaded.
Preload this font with {'
name': 'notosans', 'point_size': 12, 'style': 'regular'}
  warnings.warn(warning_string, UserWarning)
Traceback (most recent call last):
  File "conky_lua_maker_main.py", line 434, in <module>
    interface = main_interface()
  File "conky_lua_maker_main.py", line 88, in __init__
    self.manager = pygame_gui.UIManager(INTERFACE_SIZE, "themes/label_theme.json")
  File "/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/ui_manager.py", line 21, in __init__
    self.ui_theme.load_theme(theme_path)
  File "/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_appearance_theme.py", line 584, in load_theme
    self.load_fonts()  # save to trigger load with the same data as it won'
t do anything
  File "/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_appearance_theme.py", line 226, in load_fonts
    font_info['italic'])
  File "/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/core/ui_font_dictionary.py", line 129, in find_font
    return self.loaded_fonts[font_id]
KeyError: 'notosans_regular_12'
(.venv) toulibre@toulibre:~/ConkyLuaMakerGUIv2$



zut, même souci sad
les dépendances sont pourtant installées
la fenêtre s'ouvre toujours et se referme en une fraction de seconde
l'erreur à l'install dans le terminal

  error: invalid command 'bdist_wheel'
 
  ----------------------------------------
  Failed building wheel for pygame-gui
  Running setup.py clean for pygame-gui
Failed to build pygame-gui

#11 28-11-2020 16:08:43

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

Bon en fait, depuis le début je sais pas lire, déso:

Successfully installed pygame-1.9.6 pygame-gui-0.4.2


self.ui_theme.load_theme(theme_path)
...
KeyError: 'notosans_regular_12'


C'est la police d'écriture notosans_regular qui doit poser problème:
1) la police est bien installée :
regarder dans le fichier themes/label_theme.json si les chemins vers les polices sont bons ou faire comme en 2.2.3
2) n'est pas installée
2.1) Tu l'installes, ça doit être un de ceux là:

i A fonts-noto-core                                                              - "No Tofu" font families with large Unicode coverage (core)                                 
i A fonts-noto-mono                                                              - "No Tofu" monospaced font family with large Unicode coverage                           
i A fonts-noto-ui-core                                                           - familles de fontes « No Tofu » avec une vaste couverture d’Unicode (cœur d’interface ut


2.2) Sinon, modifier le fichier themes/label_theme.json :
2.2.1) mettre une police qui est installée sur ton système,
2.2.2) voire retirer les entrées qui réfèrencent la police
2.2.3) tout retirer:

cat themes/label_theme.json


{
     "label_test":
     {
     },

     "button_theme":
     {
     }
 }

Dernière modification par David5647 (28-11-2020 16:11:51)

Hors ligne

#12 28-11-2020 16:37:01

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

ok j'ai installé les polices
201128043815865663.png
même erreurs et ne fonctionne pas

puis passé directement au 2.2.3
201128043950252999.png

et oui, là ça fonctionne ! smile
201128044112403470.png

il y a encore queqlues avertissement pendant que le terminal tourne

(.venv) toulibre@toulibre:~/ConkyLuaMakerGUIv2$ python conky_lua_maker_main.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 0 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 1 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 2 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 3 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 4 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 5 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 6 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 7 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 8 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 9 - size diff: (132, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 10 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 11 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 12 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 13 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 14 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 15 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 16 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 17 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 18 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 19 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 20 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 21 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 22 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 23 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 24 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 25 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
/home/toulibre/ConkyLuaMakerGUIv2/.venv/lib/python3.7/site-packages/pygame_gui/elements/ui_label.py:73: UserWarning: Label Rect is too small for text: 26 - size diff: (124, -1)
  warnings.warn(warn_text, UserWarning)
mean loop time = 66.08ms
mean loop time = 66.05ms
mean loop time = 66.06ms
mean loop time = 66.06ms

Dernière modification par Anonyme-14 (28-11-2020 16:41:06)

#13 28-11-2020 16:50:42

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

Ok, bah pour les polices, je sais pas, ce qu'il se passe...

  warnings.warn(warn_text, UserWarning)

ça c'est pas des erreurs, c'est des avertissement (warning) pour signifier que les boites de texte sont plus petites que le texte, donc pas de soucis outre le fait que, bah, c'est pas très beau.
"Load Config" devrait permettre de charger l'exemple maintenant.
Après tu verras c'est pas exempt de bug, sauvegarde régulièrement si tu fais qqc d'assez important. Et il n'y a aucune sécurité : tu mets un caractère à la place d'un chiffre => ça plante.

Dernière modification par David5647 (28-11-2020 16:51:23)

Hors ligne

#14 28-11-2020 17:06:15

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

j'ai vu, je l'ai planté à la 1ère utilisation big_smile
tu devrais garder cette interface et améliorer la stabilité !
purée ça tête sur le processeur même à vide lol !
perso j'aime bien ce que je vois !

#15 28-11-2020 23:12:05

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

mini_201128111408865035.png
bah sinon je vois que c'est le même type d'interface avec PyQt5, je découvre Qt 5 Designer ça n'a pas l'air simple ...

#16 04-12-2020 11:18:32

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

salut, à part avoir mis l'interface en français (pas très utile s'il y a la traduction auto) je ne saisis pas comment utiliser Qt5 Designer ...
existe t'il un programme plus intuitif ?

#17 04-12-2020 14:37:47

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

Salut!

Que cherches tu à faire avec QtDesigner?
Je ne maîtrise pas non plus beaucoup qtdesigner, et, à ma connaissance c'est le seul outil graphique permettant de concevoir des interfaces en Qt.
Si tu fais quelques recherches, tu peux aussi tomber sur l'outil qtcreator qui englobe le précédent.

Pour ce qui est de mon usage, je m'en sers simplement pour construire l'interface (je veux un bouton là, une liste ici, un menu là-bas...),
je convertis ensuite le fichier .ui créé pat qtdesigner en une classe python avec la commande pyuic.
enfin, à partir de cette classe, je créé mon code, je lie les éléments (bouton, slider, liste, zone graphique) entre eux avec des fonctions, des rétroactions...
Actuellement c'est beaucoup de ce code là qui manque, pour ne pas dire qu'il est inexistant.

Il faut noter que l'utilisation du logiciel graphique pour créer une interface n'est pas obligatoire, on peut très bien tout coder à la mano.

Qtdesigner doit permettre de faire un peu du travail de création d'actions, de rétroactions mais j'ai jamais trop poussé, là aussi c'est assez obscur et compliqué pour moi, je m'y retrouve mieux en codant directement en python

Anonyme-14 a écrit :

existe t'il un programme plus intuitif ?


PyQt n'est pas réputé intuitif en lui même, c'est toujours ce problème de balance fonctionnalités/simplicité  (c'est même un sujet de controverse à propos de kde qui est basé sur Qt, conséquence?)

Bref! Que cherches tu à faire avec QtDesigner?

Hors ligne

#18 04-12-2020 15:29:20

Anonyme-14
Invité

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

je voulais essayer de comprendre les relations des commandes avec tel ou tel menu ou bouton, suis largué complet smile
tant pis, quelqu'un j'espère pourra te filer la main sur ce projet qui a l'air vraiment sympa

#19 04-12-2020 15:39:56

David5647
Membre
Distrib. : Debian Sid
Noyau : 5.15.0-2-amd64
(G)UI : i3wm + des bouts de kde
Inscription : 27-08-2017

Re : [mis en dormance] Aide solicitée : programmation d'interfaces

Ah?! Du coup la réponse c'est : la relation entre les éléments est dans le code python, pas dans le fichier .ui.

Hors ligne

Pied de page des forums