scripts/install-i18n.py

branch
eric7
changeset 8314
e3642a6a1e71
parent 8235
78e6d29eb773
child 8881
54e42bc2437a
equal deleted inserted replaced
8313:dac33c7fce07 8314:e3642a6a1e71
13 import os 13 import os
14 import shutil 14 import shutil
15 import glob 15 import glob
16 16
17 try: 17 try:
18 from eric6config 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.")
21 sys.exit(1) 21 sys.exit(1)
22 except SyntaxError: 22 except SyntaxError:
23 # an incomplete or old config file was found 23 # an incomplete or old config file was found
29 """ 29 """
30 Global function to get the name of the directory storing the config data. 30 Global function to get the name of the directory storing the config data.
31 31
32 @return directory name of the config dir (string) 32 @return directory name of the config dir (string)
33 """ 33 """
34 cdn = ".eric6" 34 cdn = ".eric7"
35 35
36 hp = os.path.join(os.path.expanduser("~"), cdn) 36 hp = os.path.join(os.path.expanduser("~"), cdn)
37 if not os.path.exists(hp): 37 if not os.path.exists(hp):
38 os.mkdir(hp) 38 os.mkdir(hp)
39 return hp 39 return hp
71 71
72 targetDir = (configDir if privateInstall 72 targetDir = (configDir if privateInstall
73 else getConfig('ericTranslationsDir')) 73 else getConfig('ericTranslationsDir'))
74 74
75 try: 75 try:
76 for fn in glob.glob(os.path.join('eric', 'eric6', 'i18n', '*.qm')): 76 for fn in glob.glob(os.path.join('eric', 'eric7', 'i18n', '*.qm')):
77 shutil.copy2(fn, targetDir) 77 shutil.copy2(fn, targetDir)
78 os.chmod(os.path.join(targetDir, os.path.basename(fn)), 0o644) 78 os.chmod(os.path.join(targetDir, os.path.basename(fn)), 0o644)
79 except OSError as msg: 79 except OSError as msg:
80 sys.stderr.write( 80 sys.stderr.write(
81 'OSError: {0}\nTry install-i18n as root.\n'.format(msg)) 81 'OSError: {0}\nTry install-i18n as root.\n'.format(msg))

eric ide

mercurial