Skip to content

Commit f4a446c

Browse files
committed
Fix some typos and convert windows-installer scripts to Python 3
The scripts are poorly converted as Windows is not really supoported anymore and would need some love from a contributor who actually uses Windows
1 parent ef9e1b0 commit f4a446c

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/diffuse/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,7 @@ def save_file(self, f, save_as=False):
534534
info.name, info.encoding, info.revision, info.label = name, encoding, None, label
535535
info.last_stat = info.stat = os.stat(name)
536536
self.setFileInfo(f, info)
537-
# update the syntax highlighting incase we changed the file
538-
# extension
537+
# update the syntax highlighting in case we changed the file extension
539538
syntax = theResources.guessSyntaxForFile(name, ss)
540539
if syntax is not None:
541540
self.setSyntax(syntax)

windows-installer/build.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def copyFile(src, dest, use_text_mode=False,enc=None):
4646
s = f.read()
4747
f.close()
4848
if enc is not None:
49-
s = codecs.encode(unicode(s, 'utf_8'), enc)
49+
s = codecs.encode(str(s, encoding='utf_8'), enc)
5050
f = open(dest, w)
5151
f.write(s)
5252
f.close()
@@ -190,12 +190,12 @@ def extract_tag(s, start, end):
190190
while True:
191191
i = s.find('&#', idx)
192192
if i < 0:
193-
a.append(unicode(s[idx:], 'latin_1'))
193+
a.append(str(s[idx:], encoding='latin_1'))
194194
break
195-
a.append(unicode(s[idx:i], 'latin_1'))
195+
a.append(str(s[idx:i], encoding='latin_1'))
196196
i += 2
197197
j = s.find(';', i)
198-
a.append(unichr(int(s[i:j])))
198+
a.append(chr(int(s[i:j])))
199199
idx = j + 1
200200
s = ''.join(a)
201201
s = codecs.encode(s, 'utf-8')

windows-installer/setup.new.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
# This is the list of dll which are required by PyGI.
1212
# I get this list of DLL using http://technet.microsoft.com/en-us/sysinternals/bb896656.aspx
13-
# Procedure:
13+
# Procedure:
1414
# 1) Run your from from your IDE
1515
# 2) Command for using listdlls.exe
1616
# c:/path/to/listdlls.exe python.exe > output.txt
17-
# 3) This would return lists of all dll required by you program
18-
# in my case most of dll file were located in c:\python27\Lib\site-packages\gnome
17+
# 3) This would return lists of all dll required by you program
18+
# in my case most of dll file were located in c:\python27\Lib\site-packages\gnome
1919
# (I am using PyGI (all in one) installer)
20-
# 4) Below is the list of gnome dll I received from listdlls.exe result.
20+
# 4) Below is the list of gnome dll I received from listdlls.exe result.
2121

2222
# If you prefer you can import all dlls from c:\python27\Lib\site-packages\gnome folder
2323
#missingDll = glob.glob(gnomeSiteDir + "\\" + '*.dll')
@@ -142,10 +142,10 @@
142142
includeFiles.append((os.path.join(gnomeSiteDir, dll), dll))
143143
#includeFiles.append(dll)
144144

145-
# You can import all Gtk Runtime data from gtk folder
145+
# You can import all Gtk Runtime data from gtk folder
146146
#gnomeLibs= ['etc','lib','share']
147147

148-
# You can import only important Gtk Runtime data from gtk folder
148+
# You can import only important Gtk Runtime data from gtk folder
149149
gnomeLibs = [
150150
'lib\\gdk-pixbuf-2.0',
151151
'lib\\girepository-1.0',
@@ -196,7 +196,7 @@ def copyFile(src, dest, use_text_mode=False,enc=None):
196196
s = f.read()
197197
f.close()
198198
if enc is not None:
199-
s = codecs.encode(unicode(s, 'utf_8'), enc)
199+
s = codecs.encode(str(s, encoding='utf_8'), enc)
200200
f = open(dest, w)
201201
f.write(s)
202202
f.close()

0 commit comments

Comments
 (0)