ScolaSync  4.0
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
debug.py
Aller à la documentation de ce fichier.
1 #!/usr/bin/python3
2 
3 ##
4 #
5 # Ce module facilite le debogage
6 #
7 
8 licence={}
9 licenceEn="""
10  scolasync version %s:
11 
12  a program to manage file transfers between a computer and a collection
13  of USB sticks.
14 
15  Copyright (C) 2010-2013 Georges Khaznadar <georgesk@debian.org>
16 
17  This program is free software: you can redistribute it and/or modify
18  it under the terms of the GNU General Public License as published by
19  the Free Software Foundation, either version 3 of the License, or
20  (at your option) any later version.
21 
22  This program is distributed in the hope that it will be useful,
23  but WITHOUT ANY WARRANTY; without even the implied warranty of
24  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  GNU General Public License for more details.
26 
27  You should have received a copy of the GNU General Public License
28  along with this program. If not, see <http://www.gnu.org/licenses/>.
29 """
30 licence['en']=licenceEn
31 
32 licenceFr="""
33  scolasync version %s :
34 
35  un programme pour gérer des transferts de fichiers entre un
36  ordinateur et une collection de clés USB.
37 
38  Copyright (C) 2010-2013 Georges Khaznadar <georgesk@debian.org>
39 
40  Ce projet est un logiciel libre : vous pouvez le redistribuer, le
41  modifier selon les terme de la GPL (GNU Public License) dans les
42  termes de la Free Software Foundation concernant la version 3 ou
43  plus de la dite licence.
44 
45  Ce programme est fait avec l'espoir qu'il sera utile mais SANS
46  AUCUNE GARANTIE. Lisez la licence pour plus de détails.
47 
48  <http://www.gnu.org/licenses/>.
49 """
50 licence['fr']=licenceFr
51 
52 from PyQt4.QtGui import *
53 from PyQt4.QtCore import *
54 
55 ##
56 #
57 # ajoute un bouton de débogage dans une fenêtre
58 # @param w la fenêtre
59 # @param cb une fonction de rappel à effectuer; celle ci
60 # accepte w comme premier paramètre
61 #
62 def button(w, cb):
63  ##
64  #
65  # fonction pour passer la paramètre mw à la fonction de rappel cb
66  #
67  def cbWrapper():
68  cb(w)
69  return
70 
71  b=QPushButton("Debug",w)
72  b.connect(b, SIGNAL("clicked()"), cbWrapper)
73  b.show()
74  return
75 
76 ##
77 #
78 # renseigne sur la liste des partions cochées de la fenêtre principale
79 # @param w la fenêtre principale
80 #
82  print (w.t)
83