175 Copy a string to a file. |
182 Copy a string to a file. |
176 |
183 |
177 @param name the name of the file. |
184 @param name the name of the file. |
178 @param text the contents to copy to the file. |
185 @param text the contents to copy to the file. |
179 """ |
186 """ |
180 f = open(name, "w", encoding="utf-8") |
187 f = open(name, "w") |
181 f.write(text) |
188 f.write(codecs.encode(text, "utf-8")) |
182 f.close() |
189 f.close() |
183 |
190 |
184 |
191 |
185 def wrapperName(dname, wfile): |
192 def wrapperName(dname, wfile): |
186 """ |
193 """ |
297 pdir = os.path.join(cfg['mdir'], "eric5plugins") |
304 pdir = os.path.join(cfg['mdir'], "eric5plugins") |
298 fname = os.path.join(pdir, "__init__.py") |
305 fname = os.path.join(pdir, "__init__.py") |
299 if not os.path.exists(fname): |
306 if not os.path.exists(fname): |
300 if not os.path.exists(pdir): |
307 if not os.path.exists(pdir): |
301 os.mkdir(pdir, 0o755) |
308 os.mkdir(pdir, 0o755) |
302 f = open(fname, "w", encoding="utf-8") |
309 f = open(fname, "w") |
303 f.write( |
310 f.write( |
304 '''# -*- coding: utf-8 -*- |
311 '''# -*- coding: utf-8 -*- |
305 |
312 |
306 """ |
313 """ |
307 Package containing the global plugins. |
314 Package containing the global plugins. |
781 Perform some dependency checks. |
788 Perform some dependency checks. |
782 """ |
789 """ |
783 print('Checking dependencies') |
790 print('Checking dependencies') |
784 |
791 |
785 # perform dependency checks |
792 # perform dependency checks |
786 if sys.version_info < (3, 1, 0): |
793 if sys.version_info < (2, 6, 0): |
|
794 print('Sorry, you must have Python 2.6.0 or higher or Python 3.1.0 or higher.') |
|
795 exit(5) |
|
796 elif sys.version_info < (3, 1, 0): |
787 print('Sorry, you must have Python 3.1.0 or higher.') |
797 print('Sorry, you must have Python 3.1.0 or higher.') |
788 exit(5) |
798 exit(5) |
789 if sys.version_info > (3, 9, 9): |
799 if sys.version_info > (3, 9, 9): |
790 print('Sorry, eric5 requires Python 3 for running.') |
800 print('Sorry, eric5 requires Python 3 for running.') |
791 exit(5) |
801 exit(5) |
792 print("Python Version: {0:d}.{1:d}.{2:d}".format(*sys.version_info[:3])) |
802 print("Python Version: {0:d}.{1:d}.{2:d}".format(*sys.version_info[:3])) |
793 |
803 |
794 try: |
804 try: |
795 import xml.etree # __IGNORE_WARNING__ |
805 import xml.etree # __IGNORE_WARNING__ |
796 except ImportError as msg: |
806 except ImportError as msg: |
797 print('Your Python3 installation is missing the XML module.') |
807 print('Your Python installation is missing the XML module.') |
798 print('Please install it and try again.') |
808 print('Please install it and try again.') |
799 exit(5) |
809 exit(5) |
800 |
810 |
801 try: |
811 try: |
802 from PyQt4.QtCore import qVersion |
812 from PyQt4.QtCore import qVersion |
1112 # step 2: compile the forms |
1122 # step 2: compile the forms |
1113 compileUiFiles() |
1123 compileUiFiles() |
1114 |
1124 |
1115 if doCompile: |
1125 if doCompile: |
1116 print("\nCompiling source files ...") |
1126 print("\nCompiling source files ...") |
|
1127 # Hide compile errors (mainly because of Py2/Py3 differences) |
|
1128 sys.stdout = io.StringIO() |
1117 if distDir: |
1129 if distDir: |
1118 compileall.compile_dir(sourceDir, |
1130 compileall.compile_dir(sourceDir, |
1119 ddir=os.path.join(distDir, modDir, cfg['ericDir']), |
1131 ddir=os.path.join(distDir, modDir, cfg['ericDir']), |
1120 rx=re.compile(r"DebugClients[\\/]Python[\\/]|UtilitiesPython2[\\/]"), |
1132 rx=re.compile(r"DebugClients[\\/]Python[\\/]"), |
1121 quiet=True) |
1133 quiet=True) |
1122 py_compile.compile(configName, |
1134 py_compile.compile(configName, |
1123 dfile=os.path.join(distDir, modDir, "eric5config.py")) |
1135 dfile=os.path.join(distDir, modDir, "eric5config.py")) |
1124 else: |
1136 else: |
1125 compileall.compile_dir(sourceDir, |
1137 compileall.compile_dir(sourceDir, |
1126 ddir=os.path.join(modDir, cfg['ericDir']), |
1138 ddir=os.path.join(modDir, cfg['ericDir']), |
1127 rx=re.compile(r"DebugClients[\\/]Python[\\/]|UtilitiesPython2[\\/]"), |
1139 rx=re.compile(r"DebugClients[\\/]Python[\\/]"), |
1128 quiet=True) |
1140 quiet=True) |
1129 py_compile.compile(configName, |
1141 py_compile.compile(configName, |
1130 dfile=os.path.join(modDir, "eric5config.py")) |
1142 dfile=os.path.join(modDir, "eric5config.py")) |
|
1143 sys.stdout = sys.__stdout__ |
1131 print("\nInstalling eric5 ...") |
1144 print("\nInstalling eric5 ...") |
1132 res = installEric() |
1145 res = installEric() |
1133 |
1146 |
1134 # do some cleanup |
1147 # do some cleanup |
1135 try: |
1148 try: |