scripts/install-i18n.py

branch
eric7
changeset 9328
49a0a9cb2505
parent 9221
bf71ee032bb4
child 9448
ea215f7afab3
equal deleted inserted replaced
9327:2b768afcaee1 9328:49a0a9cb2505
7 7
8 """ 8 """
9 Installation script for the eric IDE translation files. 9 Installation script for the eric IDE translation files.
10 """ 10 """
11 11
12 import sys 12 import glob
13 import os 13 import os
14 import shutil 14 import shutil
15 import glob 15 import sys
16 16
17 try: 17 try:
18 from eric7config import getConfig 18 from eric7config import getConfig
19 except ImportError: 19 except ImportError:
20 print("The eric IDE doesn't seem to be installed. Aborting.") 20 print("The eric IDE doesn't seem to be installed. Aborting.")
74 try: 74 try:
75 for fn in glob.glob(os.path.join("eric", "src", "eric7", "i18n", "*.qm")): 75 for fn in glob.glob(os.path.join("eric", "src", "eric7", "i18n", "*.qm")):
76 shutil.copy2(fn, targetDir) 76 shutil.copy2(fn, targetDir)
77 os.chmod(os.path.join(targetDir, os.path.basename(fn)), 0o644) 77 os.chmod(os.path.join(targetDir, os.path.basename(fn)), 0o644)
78 except OSError as msg: 78 except OSError as msg:
79 sys.stderr.write("OSError: {0}\nTry install-i18n as root.\n".format(msg)) 79 if sys.platform.startswith(("win", "cygwin")):
80 except OSError as msg: 80 sys.stderr.write(
81 sys.stderr.write( 81 "OSError: {0}\nTry install-i18n with admin rights.\n".format(msg)
82 "OSError: {0}\nTry install-i18n with admin rights.\n".format(msg) 82 )
83 ) 83 else:
84 sys.stderr.write("OSError: {0}\nTry install-i18n as root.\n".format(msg))
84 85
85 86
86 def main(argv): 87 def main(argv):
87 """ 88 """
88 The main function of the script. 89 The main function of the script.

eric ide

mercurial