Koji Yokota schrieb:
I have updated the wiki page but still wondering what kind of new
feature the Japanese installer brings. It seems its difference from
ordinary one is as follows:
>
> ...
4) various changes in python code
and I'm wondering what 4) implies. I attach the diff file which this
Japanese installation brings.
I'm forwarding this, because some of the changes might be useful to go into trunk as well, but I'm
no Python expert to qualify the changes as useful or not. José might perhaps have a look.
regards Uwe
diff -ur LyX15/Resources/configure.py LyX15-ja/Resources/configure.py
--- LyX15/Resources/configure.py 2007-12-07 20:51:54.000000000 +0900
+++ LyX15-ja/Resources/configure.py 2007-12-17 17:10:48.000000000 +0900
@@ -199,7 +199,7 @@
def checkLatex(dtl_tools):
''' Check latex, return lyx_check_config '''
path, LATEX = checkProg('a Latex2e program', ['latex $$i', 'latex2e $$i'])
- path, PPLATEX = checkProg('a DVI postprocessing program', ['pplatex $$i'])
+ path, PPLATEX = checkProg('a DVI postprocessing program', ['platex $$i', 'pplatex $$i'])
# use LATEX to convert from latex to dvi if PPLATEX is not available
if PPLATEX == '':
PPLATEX = LATEX
diff -ur LyX15/Resources/encodings LyX15-ja/Resources/encodings
--- LyX15/Resources/encodings 2007-05-08 03:25:24.000000000 +0900
+++ LyX15-ja/Resources/encodings 2007-12-17 17:44:50.000000000 +0900
@@ -150,8 +150,8 @@
End
# For japanese
-Encoding jis JIS JIS variable CJK
-End
+#Encoding jis JIS JIS variable CJK
+#End
# For korean
Encoding euc-kr KS EUC-KR variable CJK
@@ -166,7 +166,18 @@
End
# For japanese
-Encoding euc-jp EUC-JP EUC-JP variable CJK
+#Encoding euc-jp EUC-JP EUC-JP variable CJK
+#End
+
+# encodings for use pTeX
+# For japanese
+Encoding shift-jis SJIS CP932 variable none
+End
+
+Encoding jis JIS ISO-2022-JP variable none
+End
+
+Encoding euc-jp EUC-JP EUC-JP variable none
End
# encodings that do not use a package
diff -ur LyX15/Resources/languages LyX15-ja/Resources/languages
--- LyX15/Resources/languages 2007-10-30 10:35:08.000000000 +0900
+++ LyX15-ja/Resources/languages 2007-12-17 17:28:20.000000000 +0900
@@ -40,7 +40,9 @@
#hungarian hungarian "Hungarian" false iso8859-2 hu_HU ""
irish irish "Irish" false iso8859-15 ga_IE ""
italian italian "Italian" false iso8859-15 it_IT ""
-japanese "" "Japanese" false euc-jp ja_JP ""
+sjapanese "" "Japanese (SJIS)" false shift-jis ja_JP ""
+ejapanese "" "Japanese (EUC-JP)" false euc-jp ja_JP ""
+japanese "" "Japanese (JIS)" false jis ja_JP ""
kazakh kazakh "Kazakh" false pt154 kk_KZ ""
# there is no country code for Korean because ko_KR is the same as ko_KI
korean "" "Korean" false euc-kr ko ""
Only in LyX15-ja/Resources/layouts: jarticle.layout
Only in LyX15-ja/Resources/layouts: jbook.layout
Only in LyX15-ja/Resources/layouts: jreport.layout
Only in LyX15-ja/Resources/layouts: jsarticle.layout
Only in LyX15-ja/Resources/layouts: jsbook.layout
Files LyX15/Resources/locale/ja/LC_MESSAGES/lyx15.mo and LyX15-ja/Resources/locale/ja/LC_MESSAGES/lyx15.mo differ
Files LyX15/Resources/lyx2lyx/LyX.pyc and LyX15-ja/Resources/lyx2lyx/LyX.pyc differ
Files LyX15/Resources/lyx2lyx/lyx2lyx_version.pyc and LyX15-ja/Resources/lyx2lyx/lyx2lyx_version.pyc differ
Files LyX15/Resources/lyx2lyx/parser_tools.pyc and LyX15-ja/Resources/lyx2lyx/parser_tools.pyc differ
diff -ur LyX15/Resources/lyxrc.dist LyX15-ja/Resources/lyxrc.dist
--- LyX15/Resources/lyxrc.dist 2008-03-02 12:29:18.000000000 +0900
+++ LyX15-ja/Resources/lyxrc.dist 2008-03-02 12:15:32.000000000 +0900
@@ -1,4 +1,4 @@
-\path_prefix "C:\Program Files\LyX15\bin;C:\Program Files\LyX15\python;C:\usr\bin;C:\usr\gs8.54\bin;C:\Program Files\ImageMagick-6.3.2-Q16"
+\path_prefix "C:\Program Files\LyX15-ja\bin;C:\Program Files\LyX15-ja\python;C:\usr\bin;C:\usr\gs8.54\bin;C:\Program Files\ImageMagick-6.3.2-Q16"
\screen_font_roman "Times New Roman"
\screen_font_sans "Arial"
\screen_font_typewriter "Courier New"
diff -ur LyX15/Resources/scripts/legacy_lyxpreview2ppm.py LyX15-ja/Resources/scripts/legacy_lyxpreview2ppm.py
--- LyX15/Resources/scripts/legacy_lyxpreview2ppm.py 2006-08-08 19:42:58.000000000 +0900
+++ LyX15-ja/Resources/scripts/legacy_lyxpreview2ppm.py 2007-12-17 17:17:06.000000000 +0900
@@ -10,7 +10,7 @@
# with much advice from members of the preview-latex project:
# David Kastrup, [EMAIL PROTECTED] and
-# Jan-Ã
ke Larsson, [EMAIL PROTECTED]
+# Jan-Ake Larsson, [EMAIL PROTECTED]
# and with much help testing the code under Windows from
# Paul A. Rubin, [EMAIL PROTECTED]
@@ -234,7 +234,7 @@
# External programs used by the script.
path = string.split(os.environ["PATH"], os.pathsep)
- latex = find_exe_or_terminate(["pplatex", "latex2e", "latex"], path)
+ latex = find_exe_or_terminate(["platex", "pplatex", "latex2e", "latex"], path)
dvips = find_exe_or_terminate(["dvips"], path)
gs = find_exe_or_terminate(["gswin32c", "gs"], path)
pnmcrop = find_exe(["pnmcrop"], path)
diff -ur LyX15/Resources/scripts/lyxpreview2bitmap.py LyX15-ja/Resources/scripts/lyxpreview2bitmap.py
--- LyX15/Resources/scripts/lyxpreview2bitmap.py 2006-08-08 19:42:58.000000000 +0900
+++ LyX15-ja/Resources/scripts/lyxpreview2bitmap.py 2007-12-17 17:17:16.000000000 +0900
@@ -8,7 +8,7 @@
# author Angus Leeming
# with much advice from members of the preview-latex project:
# David Kastrup, [EMAIL PROTECTED] and
-# Jan-Ã
ke Larsson, [EMAIL PROTECTED]
+# Jan-Ake Larsson, [EMAIL PROTECTED]
# Full author contact details are available in file CREDITS
@@ -150,7 +150,7 @@
# External programs used by the script.
path = string.split(os.environ["PATH"], os.pathsep)
- latex = find_exe_or_terminate(["pplatex", "latex2e", "latex"], path)
+ latex = find_exe_or_terminate(["platex", "pplatex", "latex2e", "latex"], path)
# This can go once dvipng becomes widespread.
dvipng = find_exe(["dvipng"], path)
Files LyX15/Uninstall-LyX.exe and LyX15-ja/Uninstall-LyX.exe differ
Files LyX15/bin/Aiksaurus.dll and LyX15-ja/bin/Aiksaurus.dll differ
Files LyX15/bin/Console.dll and LyX15-ja/bin/Console.dll differ
Only in LyX15-ja/bin: Microsoft.VC80.CRT.manifest
Only in LyX15/bin: Microsoft.VC90.CRT.manifest
Files LyX15/bin/QtCore4.dll and LyX15-ja/bin/QtCore4.dll differ
Files LyX15/bin/QtGui4.dll and LyX15-ja/bin/QtGui4.dll differ
Files LyX15/bin/aspell.dll and LyX15-ja/bin/aspell.dll differ
Files LyX15/bin/dt2dv.exe and LyX15-ja/bin/dt2dv.exe differ
Files LyX15/bin/dv2dt.exe and LyX15-ja/bin/dv2dt.exe differ
Files LyX15/bin/iconv.dll and LyX15-ja/bin/iconv.dll differ
Files LyX15/bin/intl.dll and LyX15-ja/bin/intl.dll differ
Files LyX15/bin/lyx.exe and LyX15-ja/bin/lyx.exe differ
Files LyX15/bin/lyxc.exe and LyX15-ja/bin/lyxc.exe differ
Only in LyX15-ja/bin: msvcp80.dll
Only in LyX15/bin: msvcp90.dll
Only in LyX15-ja/bin: msvcr80.dll
Only in LyX15/bin: msvcr90.dll
Files LyX15/bin/pdfclose.exe and LyX15-ja/bin/pdfclose.exe differ
Files LyX15/bin/pdfopen.exe and LyX15-ja/bin/pdfopen.exe differ
Files LyX15/bin/pplatex.exe and LyX15-ja/bin/pplatex.exe differ
Files LyX15/bin/tex2lyx.exe and LyX15-ja/bin/tex2lyx.exe differ
Files LyX15/bin/zlib1.dll and LyX15-ja/bin/zlib1.dll differ
diff -ur LyX15/python/Lib/codecs.py LyX15-ja/python/Lib/codecs.py
--- LyX15/python/Lib/codecs.py 2006-12-13 01:20:34.000000000 +0900
+++ LyX15-ja/python/Lib/codecs.py 2006-04-18 11:19:44.000000000 +0900
@@ -329,12 +329,6 @@
"""
return getattr(self.stream, name)
- def __enter__(self):
- return self
-
- def __exit__(self, type, value, tb):
- self.stream.close()
-
###
class StreamReader(Codec):
@@ -574,12 +568,6 @@
"""
return getattr(self.stream, name)
- def __enter__(self):
- return self
-
- def __exit__(self, type, value, tb):
- self.stream.close()
-
###
class StreamReaderWriter:
@@ -653,14 +641,6 @@
"""
return getattr(self.stream, name)
- # these are needed to make "with codecs.open(...)" work properly
-
- def __enter__(self):
- return self
-
- def __exit__(self, type, value, tb):
- self.stream.close()
-
###
class StreamRecoder:
@@ -771,12 +751,6 @@
"""
return getattr(self.stream, name)
- def __enter__(self):
- return self
-
- def __exit__(self, type, value, tb):
- self.stream.close()
-
### Shortcuts
def open(filename, mode='rb', encoding=None, errors='strict', buffering=1):
@@ -850,10 +824,9 @@
"""
if file_encoding is None:
file_encoding = data_encoding
- data_info = lookup(data_encoding)
- file_info = lookup(file_encoding)
- sr = StreamRecoder(file, data_info.encode, data_info.decode,
- file_info.streamreader, file_info.streamwriter, errors)
+ info = lookup(data_encoding)
+ sr = StreamRecoder(file, info.encode, info.decode,
+ info.streamreader, info.streamwriter, errors)
# Add attributes to simplify introspection
sr.data_encoding = data_encoding
sr.file_encoding = file_encoding
diff -ur LyX15/python/Lib/encodings/__init__.py LyX15-ja/python/Lib/encodings/__init__.py
--- LyX15/python/Lib/encodings/__init__.py 2006-10-18 00:19:54.000000000 +0900
+++ LyX15-ja/python/Lib/encodings/__init__.py 2006-03-23 20:56:42.000000000 +0900
@@ -90,7 +90,7 @@
else:
modnames = [norm_encoding]
for modname in modnames:
- if not modname or '.' in modname:
+ if not modname:
continue
try:
mod = __import__('encodings.' + modname,
diff -ur LyX15/python/Lib/encodings/bz2_codec.py LyX15-ja/python/Lib/encodings/bz2_codec.py
--- LyX15/python/Lib/encodings/bz2_codec.py 2006-12-13 01:20:28.000000000 +0900
+++ LyX15-ja/python/Lib/encodings/bz2_codec.py 2006-03-23 20:56:42.000000000 +0900
@@ -52,35 +52,14 @@
return bz2_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
- def __init__(self, errors='strict'):
- assert errors == 'strict'
- self.errors = errors
- self.compressobj = bz2.BZ2Compressor()
-
def encode(self, input, final=False):
- if final:
- c = self.compressobj.compress(input)
- return c + self.compressobj.flush()
- else:
- return self.compressobj.compress(input)
-
- def reset(self):
- self.compressobj = bz2.BZ2Compressor()
+ assert self.errors == 'strict'
+ return bz2.compress(input)
class IncrementalDecoder(codecs.IncrementalDecoder):
- def __init__(self, errors='strict'):
- assert errors == 'strict'
- self.errors = errors
- self.decompressobj = bz2.BZ2Decompressor()
-
def decode(self, input, final=False):
- try:
- return self.decompressobj.decompress(input)
- except EOFError:
- return ''
-
- def reset(self):
- self.decompressobj = bz2.BZ2Decompressor()
+ assert self.errors == 'strict'
+ return bz2.decompress(input)
class StreamWriter(Codec,codecs.StreamWriter):
pass
diff -ur LyX15/python/Lib/encodings/utf_8_sig.py LyX15-ja/python/Lib/encodings/utf_8_sig.py
--- LyX15/python/Lib/encodings/utf_8_sig.py 2006-12-13 01:20:28.000000000 +0900
+++ LyX15-ja/python/Lib/encodings/utf_8_sig.py 2006-06-20 09:25:44.000000000 +0900
@@ -16,7 +16,7 @@
def decode(input, errors='strict'):
prefix = 0
- if input[:3] == codecs.BOM_UTF8:
+ if input.startswith(codecs.BOM_UTF8):
input = input[3:]
prefix = 3
(output, consumed) = codecs.utf_8_decode(input, errors, True)
diff -ur LyX15/python/Lib/encodings/zlib_codec.py LyX15-ja/python/Lib/encodings/zlib_codec.py
--- LyX15/python/Lib/encodings/zlib_codec.py 2006-12-13 01:20:28.000000000 +0900
+++ LyX15-ja/python/Lib/encodings/zlib_codec.py 2006-03-23 20:56:42.000000000 +0900
@@ -51,36 +51,14 @@
return zlib_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
- def __init__(self, errors='strict'):
- assert errors == 'strict'
- self.errors = errors
- self.compressobj = zlib.compressobj()
-
def encode(self, input, final=False):
- if final:
- c = self.compressobj.compress(input)
- return c + self.compressobj.flush()
- else:
- return self.compressobj.compress(input)
-
- def reset(self):
- self.compressobj = zlib.compressobj()
+ assert self.errors == 'strict'
+ return zlib.compress(input)
class IncrementalDecoder(codecs.IncrementalDecoder):
- def __init__(self, errors='strict'):
- assert errors == 'strict'
- self.errors = errors
- self.decompressobj = zlib.decompressobj()
-
def decode(self, input, final=False):
- if final:
- c = self.decompressobj.decompress(input)
- return c + self.decompressobj.flush()
- else:
- return self.decompressobj.decompress(input)
-
- def reset(self):
- self.decompressobj = zlib.decompressobj()
+ assert self.errors == 'strict'
+ return zlib.decompress(input)
class StreamWriter(Codec,codecs.StreamWriter):
pass
diff -ur LyX15/python/Lib/os.py LyX15-ja/python/Lib/os.py
--- LyX15/python/Lib/os.py 2006-12-13 01:20:34.000000000 +0900
+++ LyX15-ja/python/Lib/os.py 2006-08-03 09:27:30.000000000 +0900
@@ -156,17 +156,11 @@
recursive.
"""
- from errno import EEXIST
head, tail = path.split(name)
if not tail:
head, tail = path.split(head)
if head and tail and not path.exists(head):
- try:
- makedirs(head, mode)
- except OSError, e:
- # be happy if someone already created the path
- if e.errno != EEXIST:
- raise
+ makedirs(head, mode)
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
return
mkdir(name, mode)
diff -ur LyX15/python/Lib/posixpath.py LyX15-ja/python/Lib/posixpath.py
--- LyX15/python/Lib/posixpath.py 2006-10-18 00:19:54.000000000 +0900
+++ LyX15-ja/python/Lib/posixpath.py 2005-10-28 20:07:40.000000000 +0900
@@ -328,7 +328,8 @@
except KeyError:
return path
userhome = pwent.pw_dir
- userhome = userhome.rstrip('/')
+ if userhome.endswith('/'):
+ i += 1
return userhome + path[i:]
diff -ur LyX15/python/Lib/random.py LyX15-ja/python/Lib/random.py
--- LyX15/python/Lib/random.py 2007-04-05 01:17:34.000000000 +0900
+++ LyX15-ja/python/Lib/random.py 2006-06-20 09:26:02.000000000 +0900
@@ -205,7 +205,7 @@
raise ValueError, "empty range for randrange()"
if n >= maxwidth:
- return istart + istep*self._randbelow(n)
+ return istart + self._randbelow(n)
return istart + istep*int(self.random() * n)
def randint(self, a, b):
@@ -569,7 +569,7 @@
def betavariate(self, alpha, beta):
"""Beta distribution.
- Conditions on the parameters are alpha > 0 and beta > 0.
+ Conditions on the parameters are alpha > -1 and beta} > -1.
Returned values range between 0 and 1.
"""
diff -ur LyX15/python/Lib/sre.py LyX15-ja/python/Lib/sre.py
--- LyX15/python/Lib/sre.py 2007-04-05 01:17:36.000000000 +0900
+++ LyX15-ja/python/Lib/sre.py 2006-03-23 20:56:44.000000000 +0900
@@ -8,6 +8,3 @@
from re import *
from re import __all__
-
-# old pickles expect the _compile() reconstructor in this module
-from re import _compile
Files LyX15/python/msvcr71.dll and LyX15-ja/python/msvcr71.dll differ
Files LyX15/python/python.exe and LyX15-ja/python/python.exe differ
Files LyX15/python/python25.dll and LyX15-ja/python/python25.dll differ
Files LyX15/python/unicodedata.pyd and LyX15-ja/python/unicodedata.pyd differ