1 # CONFIGURATION MANAGEMENT OF EDF VERSION
2 # ======================================================================
3 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
4 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
5 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
6 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
7 # (AT YOUR OPTION) ANY LATER VERSION.
9 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
10 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
11 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
12 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
14 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
15 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
16 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
19 # ======================================================================
21 Ce module joue le role de cache pour les images stockées
22 dans le repertoire ICONDIR
28 if __name__ == '__main__':
33 frame = Tkinter.Frame(root)
34 frame.pack(expand=1,fill='both')
36 for name in ('About24','Save24'):
37 Tkinter.Label(frame, image=images.get_image(name)).pack(side=Tkinter.TOP)
46 # Par defaut on utilise le repertoire local icons
47 ICONDIR=os.path.join(os.path.abspath(os.path.dirname(__file__)),'icons')
52 if dico_images.has_key(name):
53 return dico_images[name]
55 fic_image = os.path.join(ICONDIR,name)
56 if not os.path.isfile(fic_image):
57 file, ext = os.path.splitext(fic_image)
58 fic_image = file + '.gif'
59 image = Tkinter.PhotoImage(file=fic_image)
60 dico_images[name]=image