mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
Phoenix:
1) Update documentation generator for `InfoBar`, `ListCtrl` and new additions; 2) Correct the `writeIfChanged` method, we can't use `str(text)` if the wxWidgets docs contain non-ascii compliant docstrings. Just treat them as unicode objects and use `codecs.open` to compare existing files with new docstrings; 3) Add empty stubs for the `ListCtrl Overview` and `Internationalization`, hopefully someone will populate them... 4) Small fix to the `MigrationGuide.txt`. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,12 +18,15 @@ import fnmatch
|
||||
import tempfile
|
||||
import commands
|
||||
import shutil
|
||||
import codecs
|
||||
|
||||
from distutils.file_util import copy_file
|
||||
from distutils.dir_util import mkpath
|
||||
from distutils.dep_util import newer
|
||||
from distutils.spawn import spawn
|
||||
|
||||
reload(sys)
|
||||
sys.setdefaultencoding('utf-8')
|
||||
|
||||
runSilently = False
|
||||
|
||||
@@ -626,11 +629,15 @@ def writeIfChanged(filename, text):
|
||||
the content is different (therefore preserving the timestamp if there is
|
||||
no update.)
|
||||
"""
|
||||
text = str(text)
|
||||
|
||||
if os.path.exists(filename):
|
||||
current = open(filename, 'rt').read()
|
||||
fid = codecs.open(filename, 'r', 'utf-8')
|
||||
current = fid.read()
|
||||
fid.close()
|
||||
|
||||
if current == text:
|
||||
return
|
||||
f = open(filename, 'wt')
|
||||
f.write(text)
|
||||
|
||||
f = codecs.open(filename, 'w', 'utf-8')
|
||||
f.write(text.encode('utf-8'))
|
||||
f.close()
|
||||
|
||||
Reference in New Issue
Block a user