pymultilame
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
pymultilame [2018/08/28 12:04] – serge | pymultilame [2021/08/21 15:47] – ↷ Liens modifiés en raison d'un déplacement. 216.244.66.228 | ||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
**Des scripts pour les tâches de tous les jours** | **Des scripts pour les tâches de tous les jours** | ||
</ | </ | ||
+ | |||
+ | =====Les sources sur GitHub===== | ||
+ | * **[[https:// | ||
===== pymultilame ===== | ===== pymultilame ===== | ||
Ligne 17: | Ligne 20: | ||
qui n'est plus maintenu. | qui n'est plus maintenu. | ||
- | === Comprend les rubriques | + | === Rubriques proposées |
* Blender: Des scripts spécifiques pour le Blender Game Engine 2.7x et qui ne peuvent tourner que dans Blender | * Blender: Des scripts spécifiques pour le Blender Game Engine 2.7x et qui ne peuvent tourner que dans Blender | ||
Ligne 28: | Ligne 31: | ||
=== Installation de Twisted pour python 3.x === | === Installation de Twisted pour python 3.x === | ||
- | * [[https:// | + | * [[archives: |
< | < | ||
sudo pip3 install twisted | sudo pip3 install twisted | ||
</ | </ | ||
+ | |||
=== Installation de pymultilame === | === Installation de pymultilame === | ||
- | * [[https:// | + | * [[creer_son_propre_package_python|Python: |
< | < | ||
sudo pip3 install -e git+https:// | sudo pip3 install -e git+https:// | ||
</ | </ | ||
+ | |||
Mise à jour: | Mise à jour: | ||
Ligne 45: | Ligne 50: | ||
sudo pip3 install --upgrade git+https:// | sudo pip3 install --upgrade git+https:// | ||
</ | </ | ||
+ | |||
==== Utilisation ==== | ==== Utilisation ==== | ||
<code python> | <code python> | ||
+ | # Imports en python3 | ||
from pymultilame import HttpDownload | from pymultilame import HttpDownload | ||
from pymultilame import MyTools | from pymultilame import MyTools | ||
- | from pymultilame import | + | from pymultilame import |
from pymultilame import MyConfig | from pymultilame import MyConfig | ||
from pymultilame import get_my_ip | from pymultilame import get_my_ip | ||
Ligne 62: | Ligne 69: | ||
from pymultilame import TextureChange | from pymultilame import TextureChange | ||
- | from pymultilame.blendertools | + | from pymultilame import scene_change, |
- | from pymultilame.blendergetobject | + | from pymultilame import get_all_objects, |
+ | |||
+ | |||
+ | # Imports en python2 | ||
+ | |||
+ | from pymultilame.myconfig2 import MyConfig2 | ||
+ | from pymultilame.tcpclient2 import TcpClient2 | ||
</ | </ | ||
+ | |||
==== Licence ==== | ==== Licence ==== | ||
Ligne 73: | Ligne 87: | ||
voir le fichier LICENSE | voir le fichier LICENSE | ||
- | ==== Documentation | + | =====Documentation |
- | + | Le script qui génère cette doc est dans le module | |
- | * [[https:// | + | |
- | * [[https:// | + | |
- | + | ||
- | ==== Conversion de README.md en dokuwiki | + | |
- | + | ||
- | pour la page pymultilame | + | |
- | + | ||
- | < | + | |
- | pandoc README.md -f markdown -t dokuwiki -s -o README.dokuwiki | + | |
- | </ | + | |
- | + | ||
- | =====La documentation issue des docstrings===== | + | |
====blendergetobject==== | ====blendergetobject==== | ||
<code txt> | <code txt> | ||
FUNCTIONS | FUNCTIONS | ||
get_all_objects() | get_all_objects() | ||
- | | + | |
+ | Retourne un dict {nom de l' | ||
| | ||
get_all_scenes() | get_all_scenes() | ||
+ | Récupération des scènes | ||
| | ||
get_scene_with_name(scn) | get_scene_with_name(scn) | ||
+ | Récupération de la scène avec le nom | ||
</ | </ | ||
Ligne 102: | Ligne 107: | ||
<code txt> | <code txt> | ||
DESCRIPTION | DESCRIPTION | ||
- | | + | |
dans le Blender Game Engine BGE. | dans le Blender Game Engine BGE. | ||
| | ||
Ligne 126: | Ligne 131: | ||
| | ||
class EasyAudio(builtins.dict) | class EasyAudio(builtins.dict) | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
| | ||
| | ||
Ligne 146: | Ligne 143: | ||
| | ||
| | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
| | ||
class Factory(builtins.object) | class Factory(builtins.object) | ||
+ | | ||
+ | | ||
| | ||
| | ||
Ligne 258: | Ligne 154: | ||
| | ||
| | ||
+ | | ||
| | ||
| | ||
Ligne 263: | Ligne 160: | ||
| | ||
| | ||
+ | | ||
| | ||
| | ||
+ | | ||
| | ||
| | ||
+ | | ||
| | ||
| | ||
- | | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Ligne 291: | Ligne 183: | ||
| | ||
| | ||
- | | + | |
| | ||
| | ||
Ligne 313: | Ligne 205: | ||
| | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
class TempoFactory(builtins.object) | class TempoFactory(builtins.object) | ||
| | ||
| | ||
+ | | ||
| | ||
| | ||
Ligne 433: | Ligne 230: | ||
| | ||
| | ||
- | | + | |
- | | ---------------------------------------------------------------------- | + | FUNCTIONS |
- | | Data descriptors defined here: | + | test() |
- | | + | |
- | | + | |
- | | + | |
- | | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Ligne 471: | Ligne 263: | ||
| | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Ligne 509: | Ligne 292: | ||
FUNCTIONS | FUNCTIONS | ||
disable_viewport(cam) | disable_viewport(cam) | ||
+ | Disable | ||
| | ||
enable_full_viewport(cam) | enable_full_viewport(cam) | ||
Ligne 528: | Ligne 312: | ||
CLASSES | CLASSES | ||
class PileFIFO(builtins.object) | class PileFIFO(builtins.object) | ||
- | | + | |
+ | | ||
| | ||
| | ||
Ligne 544: | Ligne 329: | ||
| | ||
| | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | </ | ||
- | |||
- | ====get_docstring==== | ||
- | <code txt> | ||
- | DESCRIPTION | ||
- | Récupère la doc de tous les scripts pour le wiki | ||
- | et enregistre dans tools/ | ||
- | |||
- | CLASSES | ||
- | class GetDoc(builtins.object) | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
</ | </ | ||
Ligne 657: | Ligne 384: | ||
| | ||
| | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
FUNCTIONS | FUNCTIONS | ||
Ligne 681: | Ligne 399: | ||
CLASSES | CLASSES | ||
class Multicast(builtins.object) | class Multicast(builtins.object) | ||
- | | + | |
| | ||
| | ||
Ligne 696: | Ligne 414: | ||
| | ||
| | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
</ | </ | ||
Ligne 711: | Ligne 420: | ||
<code txt> | <code txt> | ||
DESCRIPTION | DESCRIPTION | ||
+ | Le fichier ini doit être défini avec son chemin absolu | ||
| | ||
Pour un projet python: | Pour un projet python: | ||
Ligne 731: | Ligne 441: | ||
| | ||
| | ||
- | | ||
| | ||
| | ||
Ligne 739: | Ligne 448: | ||
| | ||
| | ||
- | | ||
| | ||
+ | |||
+ | </ | ||
+ | |||
+ | ====myconfig2==== | ||
+ | <code txt> | ||
+ | DESCRIPTION | ||
+ | Le fichier ini doit être défini avec son chemin absolu | ||
+ | | ||
+ | Pour un projet python: | ||
+ | import os | ||
+ | dossier = os.path.dirname(os.path.abspath(__file__)) | ||
+ | ou | ||
+ | os.getcwd() | ||
+ | | ||
+ | Pour un projet Blender, le chemin complet est trouvé avec: | ||
+ | bge.logic.expandPath() | ||
+ | |||
+ | CLASSES | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
| | ||
- | | + | |
- | | + | |
| | ||
- | | + | |
- | | + | |
+ | | ||
| | ||
- | | + | |
- | | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
</ | </ | ||
Ligne 780: | Ligne 514: | ||
| | ||
| | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
| | ||
| | ||
Ligne 794: | Ligne 532: | ||
| | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
| | ||
- | | + | |
- | | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | ====tcpclient2==== | ||
+ | <code txt> | ||
+ | CLASSES | ||
+ | | ||
+ | | ||
| | ||
- | | + | |
- | | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
| | ||
- | | + | |
- | | + | |
| | ||
- | | + | |
- | | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
</ | </ | ||
- | ====tcpclient==== | + | ====tcpclient3==== |
<code txt> | <code txt> | ||
CLASSES | CLASSES | ||
- | class TcpClient(builtins.object) | + | class TcpClient3(builtins.object) |
+ | | ||
| | ||
| | ||
Ligne 823: | Ligne 591: | ||
| | ||
| | ||
+ | | ||
+ | | ||
| | ||
| | ||
Ligne 828: | Ligne 598: | ||
| | ||
| | ||
- | | ||
| | ||
| | ||
| | ||
| | ||
- | | + | |
- | | + | |
+ | | ||
+ | | ||
| | ||
| | ||
Ligne 841: | Ligne 612: | ||
| | ||
| | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
</ | </ | ||
Ligne 859: | Ligne 621: | ||
de réseau, ça se reconnecte tout seul. | de réseau, ça se reconnecte tout seul. | ||
Par contre, le port éphémère du recvfrom changera à chaque fois. | Par contre, le port éphémère du recvfrom changera à chaque fois. | ||
- | | ||
- | Dans Blender, où il est impossible de créer un thread, socketserver, | ||
- | ou d' | ||
- | | ||
- | Doit encore être testé, en particulier si défaut réseau, serveur etc ... | ||
CLASSES | CLASSES | ||
class UdpClient(builtins.object) | class UdpClient(builtins.object) | ||
| | ||
- | | + | |
| | ||
| | ||
Ligne 890: | Ligne 647: | ||
| | ||
| | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
</ | </ | ||
- | {{tag> | + | |
+ | |||
+ | {{tag> |