The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
Install ekd sous windows (avec interface Tkinter)
Posted by: ekd | December 3, 2010 @ 3:58pm
Python Code
[
Download
]
# -*- coding: windows-1252 -*- # sys.stdout.encoding # --> 'cp850' # sys.getdefaultencoding() # --> 'latin1' # locale.getdefaultlocale() # --> 'cp1252' # Apparemment sous win 2000 --> cp1252 # ----------------------------------------------------------- # Voir http://pythonfacile.free.fr/python/unicode.html # --> Terminal de sortie --> La fenetre DOS # Encodage de la fenetre DOS --> 'cp850' # ----------------------------------------------------------- import os import sys import time import glob import _winreg import subprocess import locale import string import webbrowser import tarfile #import Tkinter from Tkinter import * from SimpleDialog import SimpleDialog import tkMessageBox "#! "+sys.executable class DetectionRegistreApplis(object): def __init__(self): # Initialisation de la fonction contenant les # textes (version fran�aise et anglaise) self.txt = self.textes() self.root = Tk() self.root.geometry("666x234+160+50") self.root.maxsize(666, 234) self.root.minsize(666, 234) self.root.config(relief=GROOVE) self.root.title(self.titre_fenetre) frame_parent = Frame(self.root, height=300, width=700, relief=GROOVE) frame_parent.pack() framePresentation = Frame(frame_parent, height=126, width=660, bd=0, relief=GROOVE) framePresentation.pack() frameCheck = Frame(frame_parent, height=200, width=400, bd=0, relief=GROOVE) frameCheck.pack() frameVide = Frame(frame_parent, height=20, width=500, bd=0, relief=GROOVE) frameVide.pack() frameBoutonCapture = Frame(frame_parent, height=66, width=500, bd=2, relief=GROOVE) frameBoutonCapture.pack() image_logo = PhotoImage(file = "logo_ekd.gif") Label(framePresentation, image = image_logo).place(x=6, y=8) texteCheck = Message(framePresentation, text=self.presentation, width=570) texteCheck.place(x=110, y=2) # Definition de chaque variable pour les lecteurs v = (IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False), IntVar(value=False)) # ... (self.varC, self.varD, self.varE, self.varF, self.varG, self.varH, self.varI, self.varJ, self.varK, self.varL, self.varM, self.varN, self.varO, self.varP, self.varQ, self.varR, self.varS, self.varT, self.varU, self.varV, self.varW, self.varX, self.varY, self.varZ) = v # # Liste des donnees pour les cases a cocher listeCheck = [["C:", self.varC, self.capture, 0, 0], ["D:", self.varD, self.capture, 0, 1], ["E:", self.varE, self.capture, 0, 2], ["F:", self.varF, self.capture, 0, 3], ["G:", self.varG, self.capture, 0, 4], ["H:", self.varH, self.capture, 0, 5], ["I:", self.varI, self.capture, 0, 6], ["J:", self.varJ, self.capture, 0, 7], ["K:", self.varK, self.capture, 0, 8], ["L:", self.varL, self.capture, 0, 9], ["M:", self.varM, self.capture, 0, 10], ["N:", self.varN, self.capture, 0, 11],["O:", self.varO, self.capture, 0, 12], ["P:", self.varP, self.capture, 0, 13], ["Q:", self.varQ, self.capture, 1, 0], ["R:", self.varR, self.capture, 1, 1], ["S:", self.varS, self.capture, 1, 2], ["T:", self.varT, self.capture, 1, 3], ["U:", self.varU, self.capture, 1, 4], ["V:", self.varV, self.capture, 1, 5], ["W:", self.varW, self.capture, 1, 6], ["X:", self.varX, self.capture, 1, 7], ["Y:", self.varY, self.capture, 1, 8], ["Z:", self.varZ, self.capture, 1, 9]] # # Boucle d'assignation des cases a cocher for parcCheck in listeCheck: Checkbutton(frameCheck, text=parcCheck[0], variable=parcCheck[1], command=parcCheck[2]).grid(row = parcCheck[3], column = parcCheck[4]) # button_quitter = Button(frameBoutonCapture, text = self.bouton_quitter, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = self.root.quit) button_quitter.place(x = 8, y = 8) # button_aide = Button(frameBoutonCapture, text = self.bouton_aide, bg = 'blue', fg = 'white', activebackground = 'blue', activeforeground = 'white', command = self.aide) button_aide.place(x = 161, y = 8) # button_install = Button(frameBoutonCapture, text = self.demarr_install, bg = 'blue', fg = 'white', activebackground = 'blue', activeforeground = 'white', command = self.action) button_install.place(x = 300, y = 8) # self.root.mainloop() def capture(self, event=None): # Liste contenant la capture de tous les lecteurs [[capture_lecteur, nom_lecteur], ...] listeCapt = [[self.varC.get(), "C:"], [self.varD.get(), "D:"], [self.varE.get(), "E:"], [self.varF.get(), "F:"], [self.varG.get(), "G:"], [self.varH.get(), "H:"], [self.varI.get(), "I:"], [self.varJ.get(), "J:"], [self.varK.get(), "K:"], [self.varL.get(), "L:"], [self.varM.get(), "M:"], [self.varN.get(), "N:"], [self.varO.get(), "O:"], [self.varP.get(), "P:"], [self.varQ.get(), "Q:"], [self.varR.get(), "R:"], [self.varS.get(), "S:"], [self.varT.get(), "T:"], [self.varU.get(), "U:"], [self.varV.get(), "V:"], [self.varW.get(), "W:"], [self.varX.get(), "X:"], [self.varY.get(), "Y:"], [self.varZ.get(), "Z:"]] # Liste contenant les lecteurs selectionnes par l'utilisateur self.liste_capt_lecteur = [parcCaptLect[1] for parcCaptLect in listeCapt if parcCaptLect[0] == 1] # print self.liste_retenue, self.liste_capt_lecteur def aide(self): "Fenetre supplementaire pour afficher l'aide en ligne" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x220+242+70") top.maxsize(500, 200) top.minsize(500, 200) top.config(relief=GROOVE) top.title(self.titre_fen) frame_lien_aide = Frame(top, height=250, width=500, bd=0, relief=GROOVE) frame_lien_aide.pack() texte_lien_1_aide = Message(frame_lien_aide, text=self.txt_lien_1_aide, width=500) texte_lien_1_aide.pack(side=TOP) bouton_lien_1_aide = Button(frame_lien_aide, text = self.bouton_lien_1_aide, bg = 'yellow', fg = 'black', activebackground = 'yellow', activeforeground = 'black', command = self.lien_1_aide) bouton_lien_1_aide.pack() texte_lien_2_aide = Message(frame_lien_aide, text=self.txt_lien_2_aide, width=500) texte_lien_2_aide.pack(side=TOP) bouton_lien_2_aide = Button(frame_lien_aide, text = self.bouton_lien_2_aide, bg = 'yellow', fg = 'black', activebackground = 'yellow', activeforeground = 'black', command = self.lien_2_aide) bouton_lien_2_aide.pack() texte_lien_3_aide = Message(frame_lien_aide, text=self.txt_lien_3_aide, width=500) texte_lien_3_aide.pack(side=TOP) bouton_lien_3_aide = Button(frame_lien_aide, text = self.bouton_lien_3_aide, bg = 'yellow', fg = 'black', activebackground = 'yellow', activeforeground = 'black', command = self.lien_3_aide) bouton_lien_3_aide.pack() frame_bout_fermer = Frame(top, height=200, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 170) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def lien_1_aide(self): webbrowser.open('http://ekd.tuxfamily.org/index.php/Telechargement/Windows#toc3') def lien_2_aide(self): webbrowser.open('http://ekd.tuxfamily.org/index.php/Telechargement/Windows#toc5') def lien_3_aide(self): webbrowser.open('http://ekd.tuxfamily.org/index.php/Telechargement/Windows#toc4') def erreurDepMencoder(self): "Fenetre supplementaire pour afficher l'erreur si Mplayer-Mencoder absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_menc = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_menc.pack() texte_err_menc = Message(frame_err_menc, text=self.txt_mencoder_manq, width=500) texte_err_menc.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepFFmpeg(self): "Fenetre supplementaire pour afficher l'erreur si FFmpeg absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_ffmpeg = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_ffmpeg.pack() texte_err_ffmpeg = Message(frame_err_ffmpeg, text=self.txt_ffmpeg_manq, width=500) texte_err_ffmpeg.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepFFmpeg2theora(self): "Fenetre supplementaire pour afficher l'erreur si FFmpeg2theora absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_ffmpeg2theora = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_ffmpeg2theora.pack() texte_err_ffmpeg2theora = Message(frame_err_ffmpeg2theora, text=self.txt_ffmpeg2theora_manq, width=500) texte_err_ffmpeg2theora.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepImageMagick(self): "Fenetre supplementaire pour afficher l'erreur si ImageMagick absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_imageMagick = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_imageMagick.pack() texte_err_imageMagick = Message(frame_err_imageMagick, text=self.txt_imageMagick_manq, width=500) texte_err_imageMagick.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepImagePIL(self): "Fenetre supplementaire pour afficher l'erreur si Python Imaging Library absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_pil = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_pil.pack() texte_err_pil = Message(frame_err_pil, text=self.txt_pil_manq, width=500) texte_err_pil.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepImagePyQt4(self): "Fenetre supplementaire pour afficher l'erreur si PyQt4 absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_pyqt4 = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_pyqt4.pack() texte_err_pyqt4 = Message(frame_err_pyqt4, text=self.txt_pyqt4_manq, width=500) texte_err_pyqt4.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepImageNumpy(self): "Fenetre supplementaire pour afficher l'erreur si Numpy absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_numpy = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_numpy.pack() texte_err_numpy = Message(frame_err_numpy, text=self.txt_numpy_manq, width=500) texte_err_numpy.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepImageLame(self): "Fenetre supplementaire pour afficher l'erreur si Lame absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_lame = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_lame.pack() texte_err_lame = Message(frame_err_lame, text=self.txt_lame_manq, width=500) texte_err_lame.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepImageMjpegtools(self): "Fenetre supplementaire pour afficher l'erreur si Mjpegtools absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_mjpegtools = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_mjpegtools.pack() texte_err_mjpegtools = Message(frame_err_mjpegtools, text=self.txt_mjpegtools_manq, width=500) texte_err_mjpegtools.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepImageSox(self): "Fenetre supplementaire pour afficher l'erreur si Sox absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_sox = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_sox.pack() texte_err_sox = Message(frame_err_sox, text=self.txt_sox_manq, width=500) texte_err_sox.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def erreurDepImageGMIC(self): "Fenetre supplementaire pour afficher l'erreur si GMIC absent" # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() top = Toplevel() top.geometry("500x86+242+100") top.maxsize(500, 86) top.minsize(500, 86) top.config(relief=GROOVE) top.title(self.titre_dep_manq) frame_err_gmic = Frame(top, height=86, width=500, bd=0, relief=GROOVE) frame_err_gmic.pack() texte_err_gmic = Message(frame_err_gmic, text=self.txt_gmic_manq, width=500) texte_err_gmic.pack() frame_bout_fermer = Frame(top, height=86, width=300, bd=2, relief=GROOVE) frame_bout_fermer.place(x = 210, y = 42) bouton_fermer_top = Button(frame_bout_fermer, text = self.bouton_fermer, bg = 'red', fg = 'white', activebackground = 'red', activeforeground = 'white', command = top.destroy) bouton_fermer_top.pack() def textes(self): # Version de la locale (fr pour langue francaise) langue = locale.getdefaultlocale()[0][:2] # Date et heure courante from time import strftime #self.date = strftime("%Y-%m-%d %H:%M:%S") if langue == 'fr': # francais self.titre_fenetre = "Installation graphique d'EKD sous Windows" self.bouton_quitter = "Quitter" self.bouton_fermer = "Fermer" self.bouton_aide = "Aide" self.demarr_install = "Cliquez ici pour d�marrer l'installation" self.presentation = "EKD est une application de post-production pour vid�o, image et fichier audio. Voici la fen�tre d'installation pour Windows (XP, Vista et Seven).\n\nDans un premier temps il vous est demand� de renseigner dans quel(s) lecteur(s) est/sont install�(es) les d�pendances utiles au fonctionnement du logiciel (les d�pendances en question sont le pack codec Satsuki, ImageMagick, Python, Python Imaging Library, Numpy et PyQt4). Cochez (ou d�cochez) les cases ci-dessous:" self.liste_retenue = "Liste des disques retenus: " self.titreInfoQuest = "Informations/Question" self.TitreErrNonSelectLect = "Erreur" self.errNonSelectLect = "Premier cas d'erreur ; vous devez s�lectionner au moins un lecteur ! Retournez dans la fen�tre principale et cochez les bonnes cases.\nDeuxi�me cas d'erreur ; vous essayez d'installer EKD mais votre nom d'utilisateur comporte un accent EKD ne peut pas s'installer si votre nom d'utilisateur comporte un accent)." self.date = strftime("%d/%m/%Y � %H:%M:%S") self.renseignements_collectes = "Installation faite le %s\n" % self.date # Aide self.titre_fen = "Aide � l'installation d'EKD" self.txt_lien_1_aide = "1) Tout d'abord, vous devez installer les d�pendances d'EKD (indispensable pour son fonctionnement !):" self.bouton_lien_1_aide = "Installation des d�pendances" self.txt_lien_2_aide = "2) Ensuite, installez l'ex�cutable d'EKD (suivez bien les indications si vous installez sous windows Vista ou windows Seven !):" self.bouton_lien_2_aide = "Installation de l'ex�cutable d'EKD" self.txt_lien_3_aide = "3) Pour finir proc�dez � l'�tape finale de l'installation (celle que vous �tes en train d'effectuer en ce moment):" self.bouton_lien_3_aide = "Rep�rage des d�pendances d'EKD" # Titre fenetre erreur installation depeandance self.titre_dep_manq = "Erreur, d�pendance manquante !" # Erreur install dependance --> Mplayer-Mencoder self.txt_mencoder_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� Mplayer-Mencoder. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de Mplayer-Mencoder." # Erreur install dependance --> FFmpeg self.txt_ffmpeg_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� FFmpeg. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de FFmpeg." # Erreur install dependance --> FFmpeg2theora self.txt_ffmpeg2theora_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� FFmpeg2theora. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de FFmpeg2theora." # Erreur install dependance --> ImageMagick self.txt_imageMagick_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� ImageMagick. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de ImageMagick." # Erreur install dependance --> Python Imaging Library self.txt_pil_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� Python Imaging Library. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de Python Imaging Library." # Erreur install dependance --> PyQt4 self.txt_pyqt4_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� PyQt4. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de PyQt4." # Erreur install dependance --> Numpy self.txt_numpy_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� Numpy. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de Numpy." # Erreur install dependance --> Lame self.txt_lame_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� Lame. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de Lame." # Erreur install dependance --> Mjpegtools self.txt_mjpegtools_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� Mjpegtools. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de Mjpegtools." # Erreur install dependance --> Sox self.txt_sox_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� Sox. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de Sox." # Erreur install dependance --> GMIC self.txt_gmic_manq = "EKD ne d�marrera pas tant que vous n'aurez pas install� G'MIC. Cliquez sur le bouton Aide pour plus d'informations sur l'installation de G'MIC." def action(self): # Initialisation de la fonction contenant les # textes (version francaise et anglaise) self.txt = self.textes() # Version de la locale (fr pour langue francaise) langue = locale.getdefaultlocale()[0][:2] separ = "# ----------------------------------------------------- #" # Liste qui devra contenir toutes les informations collect�es lors de l'installation liste_ecr_fichier = [] liste_ecr_fichier.append(separ+"\n"+self.renseignements_collectes+separ+"\n"+"Utilisateur courant: "+os.path.expanduser('~')+'\n') # Ecriture prealable du fichier sauv_txt_install_ekd.txt si erreur quelconque chemSauvInstall_1 = open(os.path.expanduser('~')+os.sep+'sauv_txt_install_ekd.txt', 'w') #chemSauvInstall_1.write("".join(liste_ecr_fichier)+'\n'+self.erreur_ecr_fich_install) chemSauvInstall_1.write("".join(liste_ecr_fichier)+'\n') chemSauvInstall_1.close() # ---------------------------------------------------------- # # Exception principale (du moteur) # ---------------------------------------------------------- # try: # Lecteurs s�lectionnes sous forme de chaine de caractere choixLect = ", ".join(self.liste_capt_lecteur) # if langue == 'fr': # francais texteInfo = "Recherche des d�pendances pour le bon fonctionnement du logiciel, sur le(s) lecteur(s): %s.\nA la fin de cette proc�dure votre ordinateur va red�marrer (n'oubliez pas de fermer toutes les applications en cours de fonctionnement).\n\nEtes-vous d'accord pour continuer ?" % choixLect liste_ecr_fichier.append(self.liste_retenue+choixLect+'\n') tkMessageBox.askyesno(self.titreInfoQuest, texteInfo) # --------------------- DEBUT MOTEUR ----------------------- # "Detection des applications utiles pour le bon fonctionnement d'EKD sous Windows Xp" # Temps debut pour calcul self.debut = time.clock() ### Debut decompactage de l'archibve .tar.gz ################################ # Chemin du script courant en eliminant dependances_windows chemin = os.getcwd() # Recherche du chemin de l'archive .tar.gz recherche_tar_gz = glob.glob(chemin + os.sep + 'windows' + os.sep + '*.tar.gz') recherche_tar_gz = recherche_tar_gz[0] # Repertoire ds lequel sera decompacte l'archive rep_tar_gz = os.path.dirname(recherche_tar_gz) # Repertoire Mplayer rep_mplayer = recherche_tar_gz.split('.') rep_mplayer = rep_mplayer[0] if os.path.exists(recherche_tar_gz) is True: # Si le repertoire Mplayer existe deja pas la peine de decompacter l'archive if os.path.exists(rep_mplayer) is False: # Decompactage de trunk.tar.gz dans le repertoire courant t = tarfile.open(name=recherche_tar_gz, mode='r', fileobj=None, bufsize=10240) t.extractall(path=rep_tar_gz, members=None) print separ if langue == 'fr': # francais extract_tar_gz_fr = "Extraction de l'archive: %s --> OK" % os.path.basename(recherche_tar_gz) liste_ecr_fichier.append(extract_tar_gz_fr+'\n') print extract_tar_gz_fr else: # autre que fr extract_tar_gz_en = 'Extracting the archive: %s --> OK' % os.path.basename(recherche_tar_gz) liste_ecr_fichier.append(extract_tar_gz_fr+'\n') print extract_tar_gz_en print separ else: pass # Elimination de l'archive elle-meme # N'est pas elimine pour l'instant #os.remove(recherche_tar_gz) ### Fin decompactage de l'archibve .tar.gz ################################## # Si il manque un fichier dans le repertoire 'windows\chemin_install_applis' # dans l'arborescence d'EKD (il doit y en avoir 11): # --> install_de_mencoder.txt # --> install_de_ffmpeg.txt # --> install_de_pil.txt # --> install_de_numpy.txt # --> install_de_pyqt4.txt # --> install_de_imagemagick.txt # --> install_de_ffmpeg2theora.txt # --> install_de_lame.txt # --> install_de_mjpegtools.txt # --> install_de_sox.txt # --> install_de_gmic.txt # ... les fichiers presents sont elimines ... et tout recommencera # a fonctionner normalement quand l'utilisateur aura bien installe # toutes les dependances # Si il y a 11 elements, il faut mettre --> < 11 if len(glob.glob('windows/chemin_install_applis/*')) < 11: for fichManq in glob.glob('windows/chemin_install_applis/*'): os.remove(fichManq) listeAppliWin = [('install_de_mencoder.txt','mplayer,mencoder'),('install_de_ffmpeg.txt','ffmpeg'),('install_de_pil.txt','pil'),('install_de_numpy.txt','numpy'),('install_de_pyqt4.txt','pyqt4'),('install_de_imagemagick.txt','imagemagick'),('install_de_ffmpeg2theora.txt','ffmpeg2theora'),('install_de_lame.txt','lame'),('install_de_mjpegtools.txt','mjpegtools'),('install_de_sox.txt','sox'),('install_de_gmic.txt','gmic')] # Boucle de parcours de la listeAppliWin pour verifier la presence des fichiers de config et qu'ils sont non nuls. z = 0 for depWin in listeAppliWin: if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\'+depWin[0]): if os.path.getsize(os.getcwd()+'\\windows\\chemin_install_applis\\'+depWin[0])>0: ouv1 = open(os.getcwd()+'\\windows\\chemin_install_applis\\'+depWin[0], 'r') self.repOuSeTrouveMplayMenc = ouv1.read() # print '* '+depWin[1]+' --> OK' ouv1.close() else: os.remove(os.getcwd()+'\\windows\\chemin_install_applis\\'+depWin[0]) z = 1 else : z = 1 if z == 1: # Si le repertoire n'existe pas, il est cree if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis') is False: os.mkdir(os.getcwd()+os.sep+'windows'+os.sep+'chemin_install_applis') mencoder = 'mencoder.exe' ffmpeg = 'ffmpeg.exe' ffmpeg2theora = 'ffmpeg2theora.exe' imgMagick = 'composite.exe' pil = 'Image.py' pyQt4 = 'QtGui.pyd' numpy = 'fftpack.py' lame = 'lame.exe' mjpegtools_ppmtoy4m = 'ppmtoy4m.exe' sox = 'sox.exe' gmic = 'gmic.exe' # site.py pour pour changer l'encodage sitePointPy = 'site.py' listeChemMencoder = [] listeChemFfmpeg = [] listeChemFfmpeg2Theora = [] listeChemImageMagick = [] listeChemPil = [] listeChemPyQt4 = [] listeChemNumpy = [] listeChemLame = [] listeChemMjpegtools = [] listeChemSox = [] listeChemGMIC = [] # Pour fichier site.py listeChemSitePointPy = [] # Liste des applications a chercher liste_applis = [[mencoder,listeChemMencoder,0], [ffmpeg,listeChemFfmpeg,0], [ffmpeg2theora,listeChemFfmpeg2Theora,0], [imgMagick,listeChemImageMagick,0], [pil,listeChemPil,0], [pyQt4,listeChemPyQt4,0], [numpy,listeChemNumpy,0], [lame,listeChemLame,0], [mjpegtools_ppmtoy4m,listeChemMjpegtools,0], [sox,listeChemSox,0], [gmic,listeChemGMIC,0], [sitePointPy,listeChemSitePointPy,0]] # Temps debut pour calcul debut = time.clock() # Appel de la fonction find. Ajoute par Mireaux pour augmenter la rapidite de # detection du chemin vers les dependances d'EKD (donc la 2eme partie de # l'install d'EKD). Discussion visible ici: # http://ekd.tuxfamily.org/forum/showthread.php?tid=210&page=1 remaining = len(liste_applis) for parc_dd in self.liste_capt_lecteur: remaining = self.find(parc_dd, liste_applis, remaining) if remaining == 0: break # Si la recherche echoue (logs non installes par exemple) # elle donne lieu a une liste vide (ne contenant rien --> # meme par a une chaine vide). Le code ci-dessous insere # (dans ce cas) une chaine vide dans les listes concernees if listeChemMencoder == []: listeChemMencoder.append('') if listeChemFfmpeg == []: listeChemFfmpeg.append('') if listeChemFfmpeg2Theora == []: listeChemFfmpeg2Theora.append('') if listeChemImageMagick == []: listeChemImageMagick.append('') if listeChemPil == []: listeChemPil.append('') if listeChemPyQt4 == []: listeChemPyQt4.append('') if listeChemNumpy == []: listeChemNumpy.append('') if listeChemLame == []: listeChemLame.append('') if listeChemMjpegtools == []: listeChemMjpegtools.append('') if listeChemSox == []: listeChemSox.append('') if listeChemGMIC == []: listeChemGMIC.append('') # Repertoire ou se trouve mplayer.exe et mencoder.exe self.repOuSeTrouveMplayMenc = listeChemMencoder[0] # Si Mplayer-Mencoder n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveMplayMenc == '': self.erreurDepMencoder() # Repertoire ou se trouve ffmpeg.exe self.repOuSeTrouveFfmpeg = listeChemFfmpeg[0] # Si FFmpeg n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveFfmpeg == '': self.erreurDepFFmpeg() # Repertoire ou se trouve ffmeg2theora self.repOuSeTrouveFfmpeg2theora = listeChemFfmpeg2Theora[0] # Si FFmpeg2theora n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveFfmpeg2theora == '': self.erreurDepFFmpeg2theora() # Repertoire ou se trouve composite.exe d'ImageMagick self.repOuSeTrouveImgMagick = listeChemImageMagick[0] # Si ImageMagick n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveImgMagick == '': self.erreurDepImageMagick() # Repertoire ou se trouve Python Imaging Library self.repOuSeTrouvePIL = listeChemPil[0] # Si Python Imaging Library n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouvePIL == '': self.erreurDepImagePIL() # Repertoire ou se trouve PyQt4 self.repOuSeTrouvePyQt4 = listeChemPyQt4[0] # Si PyQt4 n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouvePyQt4 == '': self.erreurDepImagePyQt4() # Repertoire ou se trouve Numpy self.repOuSeTrouveNumpy = listeChemNumpy[0] # Si Numpy n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveNumpy == '': self.erreurDepImageNumpy() # Repertoire ou se trouve Lame self.repOuSeTrouveLame = listeChemLame[0] # Si Lame n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveLame == '': self.erreurDepImageLame() # Repertoire ou se trouve Mjpegtools self.repOuSeTrouveMjpegtools = listeChemMjpegtools[0] # Si Mjpegtools n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveMjpegtools == '': self.erreurDepImageMjpegtools() # Repertoire ou se trouve Sox self.repOuSeTrouveSox = listeChemSox[0] # Si Sox n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveSox == '': self.erreurDepImageSox() # Repertoire ou se trouve G'MIC self.repOuSeTrouveGMIC = listeChemGMIC[0] # Si G'MIC n'est pas installe, la fenetre d'erreur s'affiche if self.repOuSeTrouveGMIC == '': self.erreurDepImageGMIC() # Repertoire ou se trouve site.py (pour chang encodage ascii vers latin1) self.repOuSeTrouveSitePointPy = listeChemSitePointPy[0] """ if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_mencoder.txt') is False: # Ecriture dans le fichier 'install_de_mencoder.txt' du chemin d'installation de mencoder (et mplayer) chemInstallMencoder=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_mencoder.txt', 'w') chemInstallMencoder.write(self.repOuSeTrouveMplayMenc) chemInstallMencoder.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_ffmpeg.txt') is False: # Ecriture dans le fichier 'install_de_ffmpeg.txt' du chemin d'installation de ffmpeg chemInstallFfmpeg=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_ffmpeg.txt', 'w') chemInstallFfmpeg.write(self.repOuSeTrouveFfmpeg) chemInstallFfmpeg.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_imagemagick.txt') is False: # Ecriture dans le fichier 'install_de_imagemagick.txt' du chemin d'installation d'ImageMagick chemInstallImgMagick=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_imagemagick.txt', 'w') chemInstallImgMagick.write(self.repOuSeTrouveImgMagick) chemInstallImgMagick.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_pil.txt') is False: # Ecriture dans le fichier 'install_de_pil.txt' du chemin d'installation de Python Imaging Library chemInstallPIL=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_pil.txt', 'w') chemInstallPIL.write(self.repOuSeTrouvePIL) chemInstallPIL.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_pyqt4.txt') is False: # Ecriture dans le fichier 'install_de_pyqt4.txt' du chemin de PyQt4 chemInstallPyQt4=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_pyqt4.txt', 'w') chemInstallPyQt4.write(self.repOuSeTrouvePyQt4) chemInstallPyQt4.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_numpy.txt') is False: # Ecriture dans le fichier 'install_de_numpy.txt' du chemin d'installation de Numpy chemInstallNumpy=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_numpy.txt', 'w') chemInstallNumpy.write(self.repOuSeTrouveNumpy) chemInstallNumpy.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_ffmpeg2theora.txt') is False: # Ecriture dans le fichier 'install_de_ffmpeg2theora.txt' du chemin de ffmpeg2theora chemInstallFfmpeg2theora=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_ffmpeg2theora.txt', 'w') chemInstallFfmpeg2theora.write(self.repOuSeTrouveFfmpeg2theora) chemInstallFfmpeg2theora.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_lame.txt') is False: # Ecriture dans le fichier 'install_de_lame.txt' du chemin de Lame chemInstallLame=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_lame.txt', 'w') chemInstallLame.write(self.repOuSeTrouveLame) chemInstallLame.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_mjpegtools.txt') is False: # Ecriture dans le fichier 'install_de_mjpegtools.txt' du chemin de Mjpegtools chemInstallMjpegtools=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_mjpegtools.txt', 'w') chemInstallMjpegtools.write(self.repOuSeTrouveMjpegtools) chemInstallMjpegtools.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_sox.txt') is False: # Ecriture dans le fichier 'install_de_sox.txt' du chemin de Sox chemInstallSox=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_sox.txt', 'w') chemInstallSox.write(self.repOuSeTrouveSox) chemInstallSox.close() if os.path.exists(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_gmic.txt') is False: # Ecriture dans le fichier 'install_de_gmic.txt' du chemin de G'MIC chemInstallGMIC=open(os.getcwd()+'\\windows\\chemin_install_applis\\install_de_gmic.txt', 'w') chemInstallGMIC.write(self.repOuSeTrouveGMIC) chemInstallGMIC.close() """ # Pour windows liste_chem_app = [[os.getcwd()+'\\windows\\chemin_install_applis\\install_de_mencoder.txt', self.repOuSeTrouveMplayMenc, 'Mplayer-Mencoder'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_ffmpeg.txt', self.repOuSeTrouveFfmpeg, 'FFmpeg'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_imagemagick.txt', self.repOuSeTrouveImgMagick, 'ImageMagick'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_pil.txt', self.repOuSeTrouvePIL, 'Python Imaging Library'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_pyqt4.txt', self.repOuSeTrouvePyQt4, 'PyQt4'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_numpy.txt', self.repOuSeTrouveNumpy, 'Numpy'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_ffmpeg2theora.txt', self.repOuSeTrouveFfmpeg2theora, 'FFmpeg2theora'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_lame.txt', self.repOuSeTrouveLame, 'Lame'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_mjpegtools.txt', self.repOuSeTrouveMjpegtools, 'Mjpegtools'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_sox.txt', self.repOuSeTrouveSox, 'Sox'], [os.getcwd()+'\\windows\\chemin_install_applis\\install_de_gmic.txt', self.repOuSeTrouveGMIC, "G'MIC"]] for parc_l_chem_app in liste_chem_app: if os.path.exists(parc_l_chem_app[0]) is False: # if langue == 'fr': # francais txt_install_app = "Chemin d'installation de %s: " % (parc_l_chem_app[2]) liste_ecr_fichier.append(txt_install_app+parc_l_chem_app[1]+'\n') else: # autres langues txt_install_app = "Installation path of %s: " % (parc_l_chem_app[2]) liste_ecr_fichier.append(txt_install_app+parc_l_chem_app[1]+'\n') # # Ecriture dans les differents fichiers d'install chemInstall = open(parc_l_chem_app[0], 'w') chemInstall.write(parc_l_chem_app[1]) chemInstall.close() # Suite de l'ecriture dans le fichier sauv_txt_install_ekd.txt si ok chemSauvInstall_3 = open(os.path.expanduser('~')+os.sep+'sauv_txt_install_ekd.txt', 'w') chemSauvInstall_3.write("".join(liste_ecr_fichier)) chemSauvInstall_3.close() # Si le francais est detecte pour un pays (ou region) a langage francophone ... # C'est la seule solution qui fonctionne sous windows (pour la gestion des # chemins et/ou fichiers) avec accents. Il s'agit de modifier la variable # encoding dans le fichier site.py situee dans le repertoire (si Python 2.6 # par exemple): ...\Python26\Lib. L'encodage par defaut ascii est transforme # en latin1 loc = locale.getdefaultlocale()[0] if loc in ['fr_BE', 'fr_CA', 'fr_CH', 'fr_FR', 'fr_LU']: ouvSPPy = open(self.repOuSeTrouveSitePointPy+"\\site.py", "rb") enrSPPy = open("windows\\chemin_install_applis\\site.py", "wb") # Ecriture dans le fichier lEncSite = ouvSPPy.readlines() for parcEncSite in lEncSite: if parcEncSite == ' encoding = "ascii" # Default value set by _PyUnicode_Init()\r\n': parcEncSite = ' encoding = "latin1" # Default value set by _PyUnicode_Init()\r\n' enrSPPy.write(parcEncSite) else: enrSPPy.write(parcEncSite) # Fermeture ouvSPPy.close() enrSPPy.close() # Copie/ecrasement de site.py contenu dans ...\Python26\Lib (si Python 2.6) import shutil shutil.copy(os.getcwd()+'\\windows\\chemin_install_applis\\site.py', self.repOuSeTrouveSitePointPy+'\\site.py') # Elimination du fichier (car cela pourrait poser des problemes lors # d'une nouvelle recherche de site.py) os.remove(os.getcwd()+'\\windows\\chemin_install_applis\\site.py') self.fin = time.clock() tempsDeTraitement = self.fin - self.debut if langue == 'fr': # francais tmps_rech = 'Temps de la recherche: %d secondes' % tempsDeTraitement print tmps_rech liste_ecr_fichier.append(tmps_rech) # Suite de l'ecriture dans le fichier sauv_txt_install_ekd.txt si ok chemSauvInstall_4 = open(os.path.expanduser('~')+os.sep+'sauv_txt_install_ekd.txt', 'w') chemSauvInstall_4.write("".join(liste_ecr_fichier)) chemSauvInstall_4.close() # Application des variables d'environnement et redemarrage # de la machine uniquement si les dependances n'avaient # prealablement pas ete installees. self.variableEnv() except: tkMessageBox.showerror(self.TitreErrNonSelectLect, self.errNonSelectLect) def quitter(self): self.root.destroy sys.exit(0) # Fonction ajoutee par Mireaux pour augmenter la rapidite de # detection du chemin vers les dependances d'EKD (donc la # 2eme partie de l'install d'EKD). Discussion visible ici: # http://ekd.tuxfamily.org/forum/showthread.php?tid=210&page=1 def find(self,dir,liste,remaining): try: xdir = dir if len(xdir) == 2: xdir += os.sep files = os.listdir(xdir) except: return remaining # Recherche des fichiers for item in files : if os.path.isdir(dir + os.sep + item): continue for litem in liste : if litem[2] : continue if (litem[0] == item): litem[1].append(dir) litem[2] = True remaining -= 1 if remaining == 0: return 0 # Exploration des sous-repertoires for item in files: dir2 = dir + os.sep + item if os.path.isfile(dir2) : continue remaining = self.find(dir2,liste,remaining) if remaining == 0 : return 0 return remaining def variableEnv(self): "Application des variables d'environnement dans la base de registre. Adapte de l'excellent script: http://mail.python.org/pipermail/python-list/2003-December/240977.html" self.item='path' self.keypath = r'SYSTEM\CurrentControlSet\Control\Session Manager\Environment' if self.repOuSeTrouveMplayMenc!='' and self.repOuSeTrouveFfmpeg!='' and self.repOuSeTrouveFfmpeg2theora!='' and self.repOuSeTrouveLame!='' and self.repOuSeTrouveMjpegtools!='' and self.repOuSeTrouveSox!='' and self.repOuSeTrouveGMIC!='': # Boucle pour inserer les chemins (detectes ds la fonction detect_1) dans la base de registre for self.newPart in [self.repOuSeTrouveMplayMenc, self.repOuSeTrouveFfmpeg, self.repOuSeTrouveFfmpeg2theora, self.repOuSeTrouveLame, self.repOuSeTrouveMjpegtools, self.repOuSeTrouveSox, self.repOuSeTrouveGMIC]: self.key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, self.keypath) self.path, self.dataType = _winreg.QueryValueEx(self.key, self.item) self.key.Close() #print #print "Le chemin actuel des variables d'environnement est:\n\n%s" % self.path #print if self.path.lower().find(self.newPart.lower()) == -1: #print #print 'Il ne contient pas', self.newPart #print self.path = os.pathsep.join(self.path.split(os.pathsep) + [self.newPart]) self.key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, self.keypath, 0, _winreg.KEY_SET_VALUE) _winreg.SetValueEx(self.key, self.item, 0, self.dataType, self.path) self.key.Close() #print #print "Nouveau chemin des variables d'environnement:\n\n%s" % self.path #print #else: #print "Rien a faire -- tout est deja ok pour les variables d'environnement" if (len(self.repOuSeTrouveMplayMenc) > 0) and (len(self.repOuSeTrouveFfmpeg) > 0) and (len(self.repOuSeTrouveFfmpeg2theora) > 0) and (len(self.repOuSeTrouveImgMagick) > 0) and (len(self.repOuSeTrouvePIL) > 0) and (len(self.repOuSeTrouvePyQt4) > 0) and (len(self.repOuSeTrouveNumpy) > 0) and (len(self.repOuSeTrouveLame) > 0) and (len(self.repOuSeTrouveMjpegtools) > 0) and (len(self.repOuSeTrouveSox) > 0) and (len(self.repOuSeTrouveGMIC) > 0): # Redemarrage de la machine afin que les variables d'environnement soient actives os.system('shutdown -r -t 0 -f')
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.44 / 8
41 Votes
http://codebin.yi.org/994
page generated in 0.00 seconds