@@ -118,7 +118,7 @@ def ShowPythonCredits(self):
118
118
self .display_printer_text (credits , 'About - Python Credits' )
119
119
120
120
def ShowIDLECredits (self ):
121
- self .ViewFile ('About - Credits' ,'CREDITS.txt' )
121
+ self .ViewFile ('About - Credits' ,'CREDITS.txt' , 'iso-8859-1' )
122
122
123
123
def ShowIDLEAbout (self ):
124
124
self .ViewFile ('About - Readme' , 'README.txt' )
@@ -131,9 +131,22 @@ def display_printer_text(self, printer, title):
131
131
data = '\n ' .join (printer ._Printer__lines )
132
132
textView .TextViewer (self , title , None , data )
133
133
134
- def ViewFile (self ,viewTitle ,viewFile ):
134
+ def ViewFile (self , viewTitle , viewFile , encoding = None ):
135
135
fn = os .path .join (os .path .abspath (os .path .dirname (__file__ )),viewFile )
136
- textView .TextViewer (self ,viewTitle ,fn )
136
+ if encoding :
137
+ import codecs
138
+ try :
139
+ textFile = codecs .open (fn , 'r' )
140
+ except IOError :
141
+ tkMessageBox .showerror (title = 'File Load Error' ,
142
+ message = 'Unable to load file ' +
143
+ `fileName` + ' .' )
144
+ return
145
+ else :
146
+ data = textFile .read ()
147
+ else :
148
+ data = None
149
+ textView .TextViewer (self , viewTitle , fn , data = data )
137
150
138
151
def Ok (self , event = None ):
139
152
self .destroy ()
0 commit comments