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:
Andrea Gavana
2012-03-27 20:54:15 +00:00
parent 1d54d41e7b
commit 003fb0a804
19 changed files with 337 additions and 7 deletions

View File

@@ -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()