Sat, 09 Nov 2024 13:28:47 +0100
Modified install script to ignore an issue creating the APIs directory (in case environment was created with --system-site-packages).
12
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
1 | #!/usr/bin/env python3 |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | # -*- coding: utf-8 -*- |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
3 | |
10439
21c28b0f9e41
Updated copyright for 2024.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10420
diff
changeset
|
4 | # Copyright (c) 2002 - 2024 Detlev Offenbach <detlev@die-offenbachs.de> |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | # |
7960
e8fc383322f7
Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
6 | # This is the install script for eric. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
7960
e8fc383322f7
Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
9 | Installation script for the eric IDE and all eric related tools. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
12 | import argparse |
8501
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
13 | import compileall |
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
14 | import contextlib |
10868
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
15 | import copy |
8501
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
16 | import datetime |
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
17 | import fnmatch |
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
18 | import getpass |
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
19 | import glob |
9485
0f3620304d7a
Changed code to use 'iimportlib.import_module()' instead of '__import__()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
20 | import importlib |
10496
f9925e08dbce
Changed some import statements for 'importlib' to 'importlib.util' because sometimes the first doesn't work properly (reason unknown but somewhere in the interpreter).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
21 | import importlib.util |
8501
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
22 | import io |
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
23 | import json |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | import os |
8501
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
25 | import py_compile |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | import re |
8501
7b5f10581c35
Removed the support for the deprecated distutils package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8476
diff
changeset
|
27 | import shlex |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | import shutil |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
29 | import subprocess # secok |
9420
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
30 | import sys |
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
31 | import sysconfig |
5214
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
32 | import time |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | # Define the globals. |
1658
c61997a63efe
Changed the install script to deal with installations initiated from a directory not containing the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1538
diff
changeset
|
35 | currDir = os.getcwd() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | modDir = None |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | pyModDir = None |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | platBinDir = None |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | distDir = None |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | apisDir = None |
3943
37d88bed7bb9
Extended install script to mark more files with Python variant markers and added the '--noapis' switch to suppress API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3942
diff
changeset
|
41 | installApis = True |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | doCleanup = True |
6663
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
43 | doCleanDesktopLinks = False |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
44 | forceCleanDesktopLinks = False |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | doCompile = True |
7333 | 46 | yes2All = False |
9356
803a7a85b071
Changed the install script to only install the qt6-applications package if requested explicitly (--with-tools).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9347
diff
changeset
|
47 | withPyqt6Tools = False |
8656
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
48 | verbose = False |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
49 | proxy = None |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | cfg = {} |
9361
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
51 | progLanguages = ["MicroPython", "Python3", "QSS"] |
622
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
52 | sourceDir = "eric" |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
53 | eric7SourceDir = "" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
54 | configName = "eric7config.py" |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
55 | defaultMacAppBundleName = "eric7.app" |
10264
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
56 | defaultMacAppBundlePath = "/Applications" |
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
57 | defaultMacUserAppBundlePath = os.path.expanduser("~/Applications") |
3955
9c3e54d351e2
Changed some code in the install script to improve virtualenv support for Mac.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3950
diff
changeset
|
58 | defaultMacPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
59 | sys.exec_prefix |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
60 | ) |
7584
328d92d8db48
install: fixed an issue causing a faulty application bundle being created for macOS installations when installing into a Python virtual environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7566
diff
changeset
|
61 | if not os.path.exists(defaultMacPythonExe): |
328d92d8db48
install: fixed an issue causing a faulty application bundle being created for macOS installations when installing into a Python virtual environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7566
diff
changeset
|
62 | defaultMacPythonExe = "" |
3955
9c3e54d351e2
Changed some code in the install script to improve virtualenv support for Mac.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3950
diff
changeset
|
63 | macAppBundleName = defaultMacAppBundleName |
9c3e54d351e2
Changed some code in the install script to improve virtualenv support for Mac.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3950
diff
changeset
|
64 | macAppBundlePath = defaultMacAppBundlePath |
9c3e54d351e2
Changed some code in the install script to improve virtualenv support for Mac.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3950
diff
changeset
|
65 | macPythonExe = defaultMacPythonExe |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
67 | createInstallInfoFile = True |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
68 | installInfoName = "eric7install.json" |
7804
1cbc27e34ec6
Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7799
diff
changeset
|
69 | installInfo = {} |
7813
5d0dbec7b815
Main Window: added code to update the saved install information after an update.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7812
diff
changeset
|
70 | installCwd = "" |
7804
1cbc27e34ec6
Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7799
diff
changeset
|
71 | |
10983
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
72 | # Windows specific stuff |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
73 | pywin32_installed = False |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
74 | |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
75 | # Define blocklisted versions of the prerequisites |
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
76 | BlockLists = { |
6942
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
77 | "sip": [], |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
78 | "PyQt6": [], |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
79 | "QScintilla2": [], |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
80 | } |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
81 | PlatformsBlockLists = { |
10334 | 82 | "freebsd": { |
1914
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
83 | "sip": [], |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
84 | "PyQt6": [], |
1914
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
85 | "QScintilla2": [], |
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
86 | }, |
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
87 | "linux": { |
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
88 | "sip": [], |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
89 | "PyQt6": [], |
1914
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
90 | "QScintilla2": [], |
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
91 | }, |
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
92 | "mac": { |
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
93 | "sip": [], |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
94 | "PyQt6": [], |
1914
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
95 | "QScintilla2": [], |
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
96 | }, |
10334 | 97 | "windows": { |
98 | "sip": [], | |
99 | "PyQt6": [], | |
100 | "QScintilla2": [], | |
101 | }, | |
1914
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
102 | } |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
103 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
104 | |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
105 | def exit(rcode=0): |
390
daa7c6ae6248
Change install script to always keep it open on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
386
diff
changeset
|
106 | """ |
daa7c6ae6248
Change install script to always keep it open on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
386
diff
changeset
|
107 | Exit the install script. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
108 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
109 | @param rcode result code to report back |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
110 | @type int |
390
daa7c6ae6248
Change install script to always keep it open on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
386
diff
changeset
|
111 | """ |
1658
c61997a63efe
Changed the install script to deal with installations initiated from a directory not containing the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1538
diff
changeset
|
112 | global currDir |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
113 | |
5963
14522ec8cd08
Made QtWebKit/QtWebKitWidgets or QtWebEngineWidgets a mandatory installation prerequisite and reverted the code, that made the HTML code info viewer optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5810
diff
changeset
|
114 | print() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
115 | |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
116 | if sys.platform.startswith(("win", "cygwin")): |
9328
49a0a9cb2505
Fixed some code style issues detected by the new checks.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9314
diff
changeset
|
117 | with contextlib.suppress(EOFError): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
118 | input("Press enter to continue...") # secok |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
119 | |
1658
c61997a63efe
Changed the install script to deal with installations initiated from a directory not containing the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1538
diff
changeset
|
120 | os.chdir(currDir) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
121 | |
390
daa7c6ae6248
Change install script to always keep it open on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
386
diff
changeset
|
122 | sys.exit(rcode) |
daa7c6ae6248
Change install script to always keep it open on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
386
diff
changeset
|
123 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
124 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
125 | def initGlobals(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
126 | """ |
2965
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2763
diff
changeset
|
127 | Module function to set the values of globals that need more than a |
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2763
diff
changeset
|
128 | simple assignment. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
129 | """ |
10264
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
130 | global platBinDir, modDir, pyModDir, apisDir, macAppBundlePath |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
131 | |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
132 | if sys.platform.startswith(("win", "cygwin")): |
9420
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
133 | platBinDir = sysconfig.get_path("scripts") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
134 | else: |
9420
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
135 | # install the eric scripts along the python executable |
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
136 | platBinDir = sysconfig.get_path("scripts") |
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
137 | if not os.access(platBinDir, os.W_OK): |
6214
89a53d80e729
install, uninstall: Modified the install and uninstall scripts such, that they can be used without being administrator (i.e. if installing into a virtual environment).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6213
diff
changeset
|
138 | # install them in the user's bin directory |
89a53d80e729
install, uninstall: Modified the install and uninstall scripts such, that they can be used without being administrator (i.e. if installing into a virtual environment).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6213
diff
changeset
|
139 | platBinDir = os.path.expanduser("~/bin") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
141 | modDir = sysconfig.get_path("platlib") |
10091
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
142 | if not os.access(modDir, os.W_OK): |
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
143 | # can't write to the standard path, use the 'user' path instead |
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
144 | if sys.platform.startswith(("win", "cygwin")): |
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
145 | scheme = "nt_user" |
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
146 | elif sys.platform == "darwin": |
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
147 | scheme = "osx_framework_user" |
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
148 | else: |
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
149 | scheme = "posix_user" |
ac6edcfe7831
Corrected the install and uninstall scripts to cope use the user site-packages if a global install without admin rights is done.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10090
diff
changeset
|
150 | modDir = sysconfig.get_path("platlib", scheme) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
151 | pyModDir = modDir |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
152 | |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
153 | pyqtDataDir = os.path.join(modDir, "PyQt6") |
2608
01118174a2f5
Changed code to be compatible with latest PyQt4 Windows installers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2586
diff
changeset
|
154 | if os.path.exists(os.path.join(pyqtDataDir, "qsci")): |
01118174a2f5
Changed code to be compatible with latest PyQt4 Windows installers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2586
diff
changeset
|
155 | # it's the installer |
01118174a2f5
Changed code to be compatible with latest PyQt4 Windows installers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2586
diff
changeset
|
156 | qtDataDir = pyqtDataDir |
8640
b4e75efa081d
Corrected the APIs installation path in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8634
diff
changeset
|
157 | elif os.path.exists(os.path.join(pyqtDataDir, "Qt6", "qsci")): |
6214
89a53d80e729
install, uninstall: Modified the install and uninstall scripts such, that they can be used without being administrator (i.e. if installing into a virtual environment).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6213
diff
changeset
|
158 | # it's the wheel |
8640
b4e75efa081d
Corrected the APIs installation path in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8634
diff
changeset
|
159 | qtDataDir = os.path.join(pyqtDataDir, "Qt6") |
2608
01118174a2f5
Changed code to be compatible with latest PyQt4 Windows installers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2586
diff
changeset
|
160 | else: |
6214
89a53d80e729
install, uninstall: Modified the install and uninstall scripts such, that they can be used without being administrator (i.e. if installing into a virtual environment).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6213
diff
changeset
|
161 | # determine dynamically |
2608
01118174a2f5
Changed code to be compatible with latest PyQt4 Windows installers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2586
diff
changeset
|
162 | try: |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
163 | from PyQt6.QtCore import QLibraryInfo # noqa: I101, I102 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
164 | |
8615
d43e7eb22319
Fixed some issues related to Qt enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8611
diff
changeset
|
165 | qtDataDir = QLibraryInfo.path(QLibraryInfo.LibraryPath.DataPath) |
2608
01118174a2f5
Changed code to be compatible with latest PyQt4 Windows installers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2586
diff
changeset
|
166 | except ImportError: |
01118174a2f5
Changed code to be compatible with latest PyQt4 Windows installers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2586
diff
changeset
|
167 | qtDataDir = None |
8214
51f0d3e047ec
install script: fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8205
diff
changeset
|
168 | apisDir = os.path.join(qtDataDir, "qsci", "api") if qtDataDir else None |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
169 | |
10264
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
170 | if sys.platform == "darwin": |
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
171 | if os.getuid() == 0: |
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
172 | macAppBundlePath = defaultMacAppBundlePath |
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
173 | else: |
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
174 | macAppBundlePath = defaultMacUserAppBundlePath |
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
175 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
176 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
177 | def copyToFile(name, text): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
178 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
179 | Copy a string to a file. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
180 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
181 | @param name name of the file |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
182 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
183 | @param text contents to copy to the file |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
184 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
185 | """ |
7785
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
186 | with open(name, "w") as f: |
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
187 | f.write(text) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
190 | def copyDesktopFile(src, dst): |
3931
ff8e034662d6
Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3897
diff
changeset
|
191 | """ |
ff8e034662d6
Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3897
diff
changeset
|
192 | Modify a desktop file and write it to its destination. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
193 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
194 | @param src source file name |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
195 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
196 | @param dst destination file name |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
197 | @type str |
3931
ff8e034662d6
Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3897
diff
changeset
|
198 | """ |
6275
8ce9f9c467ec
Fixed some install script issues related to defining the bin dir via -b switch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6216
diff
changeset
|
199 | global cfg, platBinDir |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
200 | |
7785
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
201 | with open(src, "r", encoding="utf-8") as f: |
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
202 | text = f.read() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
203 | |
6275
8ce9f9c467ec
Fixed some install script issues related to defining the bin dir via -b switch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6216
diff
changeset
|
204 | text = text.replace("@BINDIR@", platBinDir) |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
205 | text = text.replace("@MARKER@", "") |
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
206 | text = text.replace("@PY_MARKER@", "") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
207 | |
9347
da982d5b0718
Improved the install script to create some more non-existing directories and deal with permission errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9328
diff
changeset
|
208 | dstPath = os.path.dirname(dst) |
da982d5b0718
Improved the install script to create some more non-existing directories and deal with permission errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9328
diff
changeset
|
209 | if not os.path.isdir(dstPath): |
da982d5b0718
Improved the install script to create some more non-existing directories and deal with permission errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9328
diff
changeset
|
210 | os.makedirs(dstPath) |
7785
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
211 | with open(dst, "w", encoding="utf-8") as f: |
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
212 | f.write(text) |
3931
ff8e034662d6
Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3897
diff
changeset
|
213 | os.chmod(dst, 0o644) |
ff8e034662d6
Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3897
diff
changeset
|
214 | |
ff8e034662d6
Modified the install script to allow parallel installation for Python2 and Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3897
diff
changeset
|
215 | |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
216 | def copyAppStreamFile(src, dst): |
5214
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
217 | """ |
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
218 | Modify an appstream file and write it to its destination. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
219 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
220 | @param src source file name |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
221 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
222 | @param dst destination file name |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
223 | @type str |
5214
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
224 | """ |
10716
11cdcc824469
Relocated the Version information into a top level '__version__.py' module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10679
diff
changeset
|
225 | if os.path.exists(os.path.join("eric", "src", "eric7", "__version__.py")): |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
226 | # Installing from installer archive |
10716
11cdcc824469
Relocated the Version information into a top level '__version__.py' module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10679
diff
changeset
|
227 | from eric.src.eric7.__version__ import Version # noqa: I101, I102 |
11cdcc824469
Relocated the Version information into a top level '__version__.py' module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10679
diff
changeset
|
228 | elif os.path.exists(os.path.join("src", "eric7", "__version__.py")): |
5214
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
229 | # Installing from source tree |
10716
11cdcc824469
Relocated the Version information into a top level '__version__.py' module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10679
diff
changeset
|
230 | from src.eric7.__version__ import Version # noqa: I101, I102 |
5214
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
231 | else: |
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
232 | Version = "Unknown" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
233 | |
7785
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
234 | with open(src, "r", encoding="utf-8") as f: |
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
235 | text = f.read() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
236 | |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
237 | text = ( |
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
238 | text.replace("@MARKER@", "") |
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
239 | .replace("@VERSION@", Version.split(None, 1)[0]) |
5214
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
240 | .replace("@DATE@", time.strftime("%Y-%m-%d")) |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
241 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
242 | |
9347
da982d5b0718
Improved the install script to create some more non-existing directories and deal with permission errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9328
diff
changeset
|
243 | dstPath = os.path.dirname(dst) |
da982d5b0718
Improved the install script to create some more non-existing directories and deal with permission errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9328
diff
changeset
|
244 | if not os.path.isdir(dstPath): |
da982d5b0718
Improved the install script to create some more non-existing directories and deal with permission errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9328
diff
changeset
|
245 | os.makedirs(dstPath) |
7785
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
246 | with open(dst, "w", encoding="utf-8") as f: |
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
247 | f.write(text) |
5214
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
248 | os.chmod(dst, 0o644) |
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
249 | |
0473e5256ca9
Fixes to comply with the current AppStream file format and contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5145
diff
changeset
|
250 | |
6495
6e73d31af3af
Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6476
diff
changeset
|
251 | def wrapperNames(dname, wfile): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | """ |
6495
6e73d31af3af
Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6476
diff
changeset
|
253 | Create the platform specific names for the wrapper script. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
254 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
255 | @param dname name of the directory to place the wrapper into |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
256 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
257 | @param wfile basename (without extension) of the wrapper script |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
258 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
259 | @return list containing the names of the wrapper scripts |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
260 | @rtype list of str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | """ |
8260
2161475d9639
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8258
diff
changeset
|
262 | wnames = ( |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
263 | [dname + "\\" + wfile + ".cmd", dname + "\\" + wfile + ".bat"] |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
264 | if sys.platform.startswith(("win", "cygwin")) |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
265 | else [dname + "/" + wfile] |
8260
2161475d9639
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8258
diff
changeset
|
266 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
267 | |
6495
6e73d31af3af
Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6476
diff
changeset
|
268 | return wnames |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
269 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
270 | |
6942
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
271 | def createPyWrapper(pydir, wfile, saveDir, isGuiScript=True): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
272 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
273 | Create an executable wrapper for a Python script. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
274 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
275 | @param pydir name of the directory where the Python script will |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
276 | eventually be installed |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
277 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
278 | @param wfile basename of the wrapper |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
279 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
280 | @param saveDir directory to save the file into |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
281 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
282 | @param isGuiScript flag indicating a wrapper script for a GUI application |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
283 | @type bool |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
284 | @return the platform specific name of the wrapper |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
285 | @rtype str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
286 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
287 | # all kinds of Windows systems |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
288 | if sys.platform.startswith(("win", "cygwin")): |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
289 | wname = wfile + ".cmd" |
899
4687532058ba
Fixed an issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
896
diff
changeset
|
290 | if isGuiScript: |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
291 | wrapper = ( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
292 | """@echo off\n""" |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
293 | '''start "" "{2}\\pythonw.exe"''' |
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
294 | ''' "{0}\\{1}.pyw"''' |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
295 | """ %1 %2 %3 %4 %5 %6 %7 %8 %9\n""".format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
296 | pydir, wfile, os.path.dirname(sys.executable) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
297 | ) |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
298 | ) |
899
4687532058ba
Fixed an issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
896
diff
changeset
|
299 | else: |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
300 | wrapper = ( |
7302
875a9a29c38f
install: fixed an issue installing eric into a venv on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7288
diff
changeset
|
301 | '''@"{0}" "{1}\\{2}.py"''' |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
302 | """ %1 %2 %3 %4 %5 %6 %7 %8 %9\n""".format(sys.executable, pydir, wfile) |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
303 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
304 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
305 | # Mac OS X |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
306 | elif sys.platform == "darwin": |
3612
786d97a08a14
Extended the install script and fixed a few issue related to installations with Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3609
diff
changeset
|
307 | major = sys.version_info.major |
786d97a08a14
Extended the install script and fixed a few issue related to installations with Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3609
diff
changeset
|
308 | pyexec = "{0}/bin/pythonw{1}".format(sys.exec_prefix, major) |
2618
bc7339209500
Fixed an issue in the install script related to the usage of a virtual environment on Mac.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2608
diff
changeset
|
309 | if not os.path.exists(pyexec): |
3612
786d97a08a14
Extended the install script and fixed a few issue related to installations with Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3609
diff
changeset
|
310 | pyexec = "{0}/bin/python{1}".format(sys.exec_prefix, major) |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
311 | wname = wfile |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
312 | wrapper = ( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
313 | """#!/bin/sh\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
314 | """\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
315 | """exec "{0}" "{1}/{2}.py" "$@"\n""".format(pyexec, pydir, wfile) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
316 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
317 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
318 | # *nix systems |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
319 | else: |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
320 | wname = wfile |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
321 | wrapper = ( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
322 | """#!/bin/sh\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
323 | """\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
324 | """exec "{0}" "{1}/{2}.py" "$@"\n""".format(sys.executable, pydir, wfile) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
325 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
326 | |
6942
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
327 | wname = os.path.join(saveDir, wname) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
328 | copyToFile(wname, wrapper) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
329 | os.chmod(wname, 0o755) # secok |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
330 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
331 | return wname |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
332 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
333 | |
5651
982465f8389c
Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5628
diff
changeset
|
334 | def copyTree(src, dst, filters, excludeDirs=None, excludePatterns=None): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
335 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
336 | Copy Python, translation, documentation, wizards configuration, |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
337 | designer template files and DTDs of a directory tree. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
338 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
339 | @param src name of the source directory |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
340 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
341 | @param dst name of the destination directory |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
342 | @type str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
343 | @param filters list of filter pattern determining the files to be copied |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
344 | @type list of str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
345 | @param excludeDirs list of (sub)directories to exclude from copying |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
346 | @type list of str |
7900
72b88fb20261
Corrected the use of '@keyparam' in the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7894
diff
changeset
|
347 | @param excludePatterns list of filter pattern determining the files to |
2992
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
348 | be skipped |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
349 | @type list of str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
350 | """ |
5651
982465f8389c
Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5628
diff
changeset
|
351 | if excludeDirs is None: |
982465f8389c
Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5628
diff
changeset
|
352 | excludeDirs = [] |
982465f8389c
Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5628
diff
changeset
|
353 | if excludePatterns is None: |
982465f8389c
Fixed a few code style issues related to the usage of mutable types for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5628
diff
changeset
|
354 | excludePatterns = [] |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
355 | try: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
356 | names = os.listdir(src) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
357 | except OSError: |
2992
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
358 | # ignore missing directories (most probably the i18n directory) |
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
359 | return |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
360 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
361 | for name in names: |
1115
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
362 | skipIt = False |
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
363 | for excludePattern in excludePatterns: |
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
364 | if fnmatch.fnmatch(name, excludePattern): |
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
365 | skipIt = True |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
366 | break |
1115
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
367 | if not skipIt: |
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
368 | srcname = os.path.join(src, name) |
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
369 | dstname = os.path.join(dst, name) |
5597
3d88d53f8c2b
Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5588
diff
changeset
|
370 | for fileFilter in filters: |
3d88d53f8c2b
Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5588
diff
changeset
|
371 | if fnmatch.fnmatch(srcname, fileFilter): |
1115
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
372 | if not os.path.isdir(dst): |
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
373 | os.makedirs(dst) |
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
374 | shutil.copy2(srcname, dstname) |
2160
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
375 | os.chmod(dstname, 0o644) |
1115
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
376 | break |
3032cc87dee2
Enhanced the install script a little bit.
detlev@die-offenbachs.de
parents:
945
diff
changeset
|
377 | else: |
3621
15f23ed3f216
Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3613
diff
changeset
|
378 | if os.path.isdir(srcname) and srcname not in excludeDirs: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
379 | copyTree(srcname, dstname, filters, excludePatterns=excludePatterns) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
380 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
381 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
382 | def createGlobalPluginsDir(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
383 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
384 | Create the global plugins directory, if it doesn't exist. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
385 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
386 | global cfg, distDir |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
387 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
388 | pdir = os.path.join(cfg["mdir"], "eric7plugins") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
389 | fname = os.path.join(pdir, "__init__.py") |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
390 | if not os.path.exists(fname): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
391 | if not os.path.exists(pdir): |
3507
b09e10d4f343
Changed the install script to accept a '-n' option to set the name of the directory where the Mac application bundle should be created in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3468
diff
changeset
|
392 | os.mkdir(pdir, 0o755) |
7785
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
393 | with open(fname, "w") as f: |
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
394 | f.write( |
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
395 | '''# -*- coding: utf-8 -*- |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
396 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
397 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
398 | Package containing the global plugins. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
399 | """ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
400 | ''' |
7785
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
401 | ) |
2160
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
402 | os.chmod(fname, 0o644) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
403 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
404 | |
3593
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
405 | def cleanupSource(dirName): |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
406 | """ |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
407 | Cleanup the sources directory to get rid of leftover files |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
408 | and directories. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
409 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
410 | @param dirName name of the directory to prune |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
411 | @type str |
3593
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
412 | """ |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
413 | # step 1: delete all Ui_*.py files without a corresponding |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
414 | # *.ui file |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
415 | dirListing = os.listdir(dirName) |
3597
137370f7114b
Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3596
diff
changeset
|
416 | for formName, sourceName in [ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
417 | (f.replace("Ui_", "").replace(".py", ".ui"), f) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
418 | for f in dirListing |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
419 | if fnmatch.fnmatch(f, "Ui_*.py") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
420 | ]: |
3594
778ae276540f
Fixed an issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3593
diff
changeset
|
421 | if not os.path.exists(os.path.join(dirName, formName)): |
3593
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
422 | os.remove(os.path.join(dirName, sourceName)) |
3594
778ae276540f
Fixed an issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3593
diff
changeset
|
423 | if os.path.exists(os.path.join(dirName, sourceName + "c")): |
3593
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
424 | os.remove(os.path.join(dirName, sourceName + "c")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
425 | |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4915
diff
changeset
|
426 | # step 2: delete the __pycache__ directory and all remaining *.pyc files |
3594
778ae276540f
Fixed an issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3593
diff
changeset
|
427 | if os.path.exists(os.path.join(dirName, "__pycache__")): |
3593
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
428 | shutil.rmtree(os.path.join(dirName, "__pycache__")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
429 | for name in [f for f in os.listdir(dirName) if fnmatch.fnmatch(f, "*.pyc")]: |
3612
786d97a08a14
Extended the install script and fixed a few issue related to installations with Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3609
diff
changeset
|
430 | os.remove(os.path.join(dirName, name)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
431 | |
6637
54a92e8dca00
install: extended the source cleanup function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6636
diff
changeset
|
432 | # step 3: delete *.orig files |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
433 | for name in [f for f in os.listdir(dirName) if fnmatch.fnmatch(f, "*.orig")]: |
6637
54a92e8dca00
install: extended the source cleanup function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6636
diff
changeset
|
434 | os.remove(os.path.join(dirName, name)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
435 | |
6637
54a92e8dca00
install: extended the source cleanup function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6636
diff
changeset
|
436 | # step 4: descent into subdirectories and delete them if empty |
3593
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
437 | for name in os.listdir(dirName): |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
438 | name = os.path.join(dirName, name) |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
439 | if os.path.isdir(name): |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
440 | cleanupSource(name) |
3595
a8433c7a0d8c
Fixed another issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3594
diff
changeset
|
441 | if len(os.listdir(name)) == 0: |
a8433c7a0d8c
Fixed another issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3594
diff
changeset
|
442 | os.rmdir(name) |
3593
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
443 | |
e3435c1ce0cf
Extended the install script to clean out the source directory when installing from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3542
diff
changeset
|
444 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
445 | def cleanUp(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
446 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
447 | Uninstall the old eric files. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
448 | """ |
9420
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
449 | global platBinDir |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
450 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
451 | try: |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
452 | from eric7.Globals import getConfig # noqa: I101 |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
453 | except ImportError: |
7960
e8fc383322f7
Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
454 | # eric wasn't installed previously |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
455 | return |
7211
1c97f3142fa8
install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7203
diff
changeset
|
456 | except SyntaxError: |
1c97f3142fa8
install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7203
diff
changeset
|
457 | # an incomplete or old config file was found |
1c97f3142fa8
install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7203
diff
changeset
|
458 | return |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
459 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
460 | global pyModDir, progLanguages |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
461 | |
146
afeb742e7148
Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
133
diff
changeset
|
462 | # Remove the menu entry for Linux systems |
10334 | 463 | if sys.platform.startswith(("linux", "freebsd")): |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
464 | cleanUpLinuxSpecifics() |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
465 | # Remove the Desktop and Start Menu entries for Windows systems |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
466 | elif sys.platform.startswith(("win", "cygwin")): |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
467 | cleanUpWindowsLinks() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
468 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
469 | # Remove the wrapper scripts |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
470 | rem_wnames = [ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
471 | "eric7_api", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
472 | "eric7_browser", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
473 | "eric7_compare", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
474 | "eric7_configure", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
475 | "eric7_diff", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
476 | "eric7_doc", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
477 | "eric7_editor", |
10864
8917b1a45546
Added the eric7_fido2.py script to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10854
diff
changeset
|
478 | "eric7_fido2", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
479 | "eric7_hexeditor", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
480 | "eric7_iconeditor", |
9377 | 481 | "eric7_ide", |
10518 | 482 | "eric7_mpy", |
9697
cdaa3cc805f7
Started implementing a PDF viewer tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9694
diff
changeset
|
483 | "eric7_pdf", |
10084
125166c6b66c
pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10065
diff
changeset
|
484 | "eric7_pip", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
485 | "eric7_plugininstall", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
486 | "eric7_pluginrepository", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
487 | "eric7_pluginuninstall", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
488 | "eric7_qregularexpression", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
489 | "eric7_re", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
490 | "eric7_shell", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
491 | "eric7_snap", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
492 | "eric7_sqlbrowser", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
493 | "eric7_testing", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
494 | "eric7_tray", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
495 | "eric7_trpreviewer", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
496 | "eric7_uipreviewer", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
497 | "eric7_virtualenv", |
9066
a219ade50f7c
Performed some refactoring to avoid possible name clashes on case-insensitive systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9034
diff
changeset
|
498 | # obsolete scripts below |
a219ade50f7c
Performed some refactoring to avoid possible name clashes on case-insensitive systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9034
diff
changeset
|
499 | "eric7_unittest", |
9377 | 500 | "eric7", |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
501 | ] |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
502 | |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
503 | try: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
504 | dirs = [platBinDir, getConfig("bindir")] |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
505 | for rem_wname in rem_wnames: |
4456
9a2304647d95
Changed installation destination on Windows to be the Scripts subdirectory of the Python installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4455
diff
changeset
|
506 | for d in dirs: |
6495
6e73d31af3af
Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6476
diff
changeset
|
507 | for rwname in wrapperNames(d, rem_wname): |
6e73d31af3af
Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6476
diff
changeset
|
508 | if os.path.exists(rwname): |
6e73d31af3af
Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6476
diff
changeset
|
509 | os.remove(rwname) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
510 | |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
511 | # Cleanup our config file(s) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
512 | for name in ["eric7config.py", "eric7config.pyc", "eric7.pth"]: |
6214
89a53d80e729
install, uninstall: Modified the install and uninstall scripts such, that they can be used without being administrator (i.e. if installing into a virtual environment).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6213
diff
changeset
|
513 | e6cfile = os.path.join(pyModDir, name) |
89a53d80e729
install, uninstall: Modified the install and uninstall scripts such, that they can be used without being administrator (i.e. if installing into a virtual environment).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6213
diff
changeset
|
514 | if os.path.exists(e6cfile): |
89a53d80e729
install, uninstall: Modified the install and uninstall scripts such, that they can be used without being administrator (i.e. if installing into a virtual environment).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6213
diff
changeset
|
515 | os.remove(e6cfile) |
6942
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
516 | e6cfile = os.path.join(pyModDir, "__pycache__", name) |
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
517 | path, ext = os.path.splitext(e6cfile) |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
518 | for f in glob.glob("{0}.*{1}".format(path, ext)): |
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
519 | os.remove(f) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
520 | |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
521 | # Cleanup the install directories |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
522 | for name in [ |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
523 | "ericExamplesDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
524 | "ericDocDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
525 | "ericDTDDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
526 | "ericCSSDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
527 | "ericIconDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
528 | "ericPixDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
529 | "ericTemplatesDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
530 | "ericCodeTemplatesDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
531 | "ericOthersDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
532 | "ericStylesDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
533 | "ericThemesDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
534 | "ericDir", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
535 | ]: |
8821
0485c183b718
Ignore unknown configuration keys during cleanup of install.py and uninstall.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8820
diff
changeset
|
536 | with contextlib.suppress(AttributeError): |
0485c183b718
Ignore unknown configuration keys during cleanup of install.py and uninstall.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8820
diff
changeset
|
537 | if os.path.exists(getConfig(name)): |
10403
ea3320d5e8e9
Changed code using "shutil.rmtree()" more readable by adding "ignore_errors=" where this parameter is non-default.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
538 | shutil.rmtree(getConfig(name), ignore_errors=True) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
539 | |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
540 | # Cleanup translations |
1387
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
541 | for name in glob.glob( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
542 | os.path.join(getConfig("ericTranslationsDir"), "eric7_*.qm") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
543 | ): |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
544 | if os.path.exists(name): |
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
545 | os.remove(name) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
546 | |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
547 | # Cleanup API files |
8243
cc717c2ae956
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8240
diff
changeset
|
548 | with contextlib.suppress(AttributeError): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
549 | apidir = getConfig("apidir") |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
550 | for progLanguage in progLanguages: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
551 | for name in getConfig("apis"): |
9361
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
552 | # step 1: programming language as given |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
553 | apiname = os.path.join(apidir, progLanguage, name) |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
554 | if os.path.exists(apiname): |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
555 | os.remove(apiname) |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
556 | # step 2: programming language as lowercase |
1381
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
557 | apiname = os.path.join(apidir, progLanguage.lower(), name) |
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
558 | if os.path.exists(apiname): |
b66bcd609f83
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1346
diff
changeset
|
559 | os.remove(apiname) |
1387
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
560 | for apiname in glob.glob( |
9361
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
561 | os.path.join(apidir, progLanguage, "*.bas") |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
562 | ) + glob.glob(os.path.join(apidir, progLanguage.lower(), "*.bas")): |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
563 | if os.path.exists(apiname): |
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
564 | os.remove(apiname) |
9361
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
565 | |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
566 | # remove empty directories |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
567 | with contextlib.suppress(FileNotFoundError, OSError): |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
568 | os.rmdir(os.path.join(apidir, progLanguage)) |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
569 | with contextlib.suppress(FileNotFoundError, OSError): |
718bc86e1c3f
Changed the handling of 'installed API files' a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9356
diff
changeset
|
570 | os.rmdir(os.path.join(apidir, progLanguage.lower())) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
571 | |
1387
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
572 | if sys.platform == "darwin": |
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
573 | # delete the Mac app bundle |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
574 | cleanUpMacAppBundle() |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
575 | except OSError as msg: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
576 | sys.stderr.write("Error: {0}\nTry install with admin rights.\n".format(msg)) |
1385
9eaf0cda4fb4
Fixed an issue in the install script trying to install without admin rights.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1381
diff
changeset
|
577 | exit(7) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
578 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
579 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
580 | def cleanUpLinuxSpecifics(): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
581 | """ |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
582 | Clean up Linux specific files. |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
583 | """ |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
584 | if os.getuid() == 0: |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
585 | for name in [ |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
586 | "/usr/share/appdata/eric7.appdata.xml", |
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
587 | "/usr/share/metainfo/eric7.appdata.xml", |
9381
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
588 | "/usr/share/applications/eric7_browser.desktop", |
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
589 | "/usr/share/applications/eric7_ide.desktop", |
10518 | 590 | "/usr/share/applications/eric7_mpy.desktop", |
8254
259484b0fc75
install.py, uninstall.py: changed the Linux path where our icons get installed
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8243
diff
changeset
|
591 | "/usr/share/icons/eric.png", |
10518 | 592 | "/usr/share/icons/ericMPy.png", |
9381
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
593 | "/usr/share/icons/ericWeb.png", |
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
594 | "/usr/share/pixmaps/eric.png", |
10518 | 595 | "/usr/share/pixmaps/ericMPy.png", |
8634
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
596 | "/usr/share/pixmaps/ericWeb.png", |
9381
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
597 | # obsolete entries below |
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
598 | "/usr/share/applications/eric7.desktop", |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
599 | ]: |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
600 | if os.path.exists(name): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
601 | os.remove(name) |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
602 | elif os.getuid() >= 1000: |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
603 | # it is assumed that user ids start at 1000 |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
604 | for name in [ |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
605 | "~/.local/share/appdata/eric7.appdata.xml", |
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
606 | "~/.local/share/metainfo/eric7.appdata.xml", |
9381
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
607 | "~/.local/share/applications/eric7_browser.desktop", |
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
608 | "~/.local/share/applications/eric7_ide.desktop", |
10518 | 609 | "~/.local/share/applications/eric7_mpy.desktop", |
8254
259484b0fc75
install.py, uninstall.py: changed the Linux path where our icons get installed
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8243
diff
changeset
|
610 | "~/.local/share/icons/eric.png", |
10518 | 611 | "~/.local/share/icons/ericMPy.png", |
9381
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
612 | "~/.local/share/icons/ericWeb.png", |
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
613 | "~/.local/share/pixmaps/eric.png", |
10518 | 614 | "~/.local/share/pixmaps/ericMPy.png", |
8634
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
615 | "~/.local/share/pixmaps/ericWeb.png", |
9381
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
616 | # obsolete entries below |
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
617 | "~/.local/share/applications/eric7.desktop", |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
618 | ]: |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
619 | path = os.path.expanduser(name) |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
620 | if os.path.exists(path): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
621 | os.remove(path) |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
622 | |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
623 | |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
624 | def cleanUpMacAppBundle(): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
625 | """ |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
626 | Uninstall the macOS application bundle. |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
627 | """ |
9448
ea215f7afab3
Fixed an issue importing the eric7config module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9425
diff
changeset
|
628 | from eric7.Globals import getConfig |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
629 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
630 | try: |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
631 | macAppBundlePath = getConfig("macAppBundlePath") |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
632 | macAppBundleName = getConfig("macAppBundleName") |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
633 | except AttributeError: |
10264
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
634 | macAppBundlePath = ( |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
635 | defaultMacAppBundlePath if os.getpid() == 0 else defaultMacUserAppBundlePath |
10264
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
636 | ) |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
637 | macAppBundleName = defaultMacAppBundleName |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
638 | for bundlePath in [ |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
639 | os.path.join(defaultMacAppBundlePath, macAppBundleName), |
10264
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
640 | os.path.join(defaultMacUserAppBundlePath, macAppBundleName), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
641 | os.path.join(macAppBundlePath, macAppBundleName), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
642 | ]: |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
643 | if os.path.exists(bundlePath): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
644 | shutil.rmtree(bundlePath) |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
645 | |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
646 | |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
647 | def cleanUpWindowsLinks(): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
648 | """ |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
649 | Clean up the Desktop and Start Menu entries for Windows. |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
650 | """ |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
651 | if importlib.util.find_spec("pywintypes") is None: |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
652 | # links were not created by install.py |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
653 | return |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
654 | |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
655 | global doCleanDesktopLinks, forceCleanDesktopLinks |
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
656 | |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
657 | regPath = ( |
10372
1444b4bee64b
Fixed some code style issue related to implicitly and explicitly concatenated strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10341
diff
changeset
|
658 | "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders" |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
659 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
660 | |
6663
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
661 | if doCleanDesktopLinks or forceCleanDesktopLinks: |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
662 | # 1. cleanup desktop links |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
663 | regName = "Desktop" |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
664 | desktopEntry = getWinregEntry(regName, regPath) |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
665 | if desktopEntry: |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
666 | desktopFolder = os.path.normpath(os.path.expandvars(desktopEntry)) |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
667 | for linkName in windowsDesktopNames(clean=True): |
6663
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
668 | linkPath = os.path.join(desktopFolder, linkName) |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
669 | if os.path.exists(linkPath): |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
670 | try: |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
671 | os.remove(linkPath) |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
672 | except OSError: |
6663
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
673 | # maybe restrictions prohibited link removal |
fe9da2b5d148
install.py: updated help texts and added an option (--clean-desktop) to delete the desktop links before installation on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6660
diff
changeset
|
674 | print("Could not remove '{0}'.".format(linkPath)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
675 | |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
676 | # 2. cleanup start menu entry |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
677 | regName = "Programs" |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
678 | programsEntry = getWinregEntry(regName, regPath) |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
679 | if programsEntry: |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
680 | programsFolder = os.path.normpath(os.path.expandvars(programsEntry)) |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
681 | eric7EntryPath = os.path.join(programsFolder, windowsProgramsEntry()) |
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
682 | if os.path.exists(eric7EntryPath): |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
683 | try: |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
684 | shutil.rmtree(eric7EntryPath) |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
685 | except OSError: |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
686 | # maybe restrictions prohibited link removal |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
687 | print("Could not remove '{0}'.".format(eric7EntryPath)) |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
688 | |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
689 | |
2177
a59ffbc5fe4c
Fixed an error in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2160
diff
changeset
|
690 | def shutilCopy(src, dst, perm=0o644): |
2160
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
691 | """ |
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
692 | Wrapper function around shutil.copy() to ensure the permissions. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
693 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
694 | @param src source file name |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
695 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
696 | @param dst destination file name or directory name |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
697 | @type str |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
698 | @param perm permissions to be set |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
699 | @type int |
2160
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
700 | """ |
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
701 | shutil.copy(src, dst) |
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
702 | if os.path.isdir(dst): |
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
703 | dst = os.path.join(dst, os.path.basename(src)) |
2177
a59ffbc5fe4c
Fixed an error in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2160
diff
changeset
|
704 | os.chmod(dst, perm) |
2160
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
705 | |
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
706 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
707 | def installEric(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
708 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
709 | Actually perform the installation steps. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
710 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
711 | @return result code |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
712 | @rtype int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
713 | """ |
10781
0e3d6e22efaf
Added scripts to install or uninstall the eric-ide server from sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10743
diff
changeset
|
714 | global distDir, cfg, progLanguages, sourceDir, configName |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
715 | global installApis |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
716 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
717 | # Create the platform specific wrappers. |
6942
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
718 | scriptsDir = "install_scripts" |
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
719 | if not os.path.isdir(scriptsDir): |
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
720 | os.mkdir(scriptsDir) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
721 | wnames = [] |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
722 | for name in ["eric7_api", "eric7_doc"]: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
723 | wnames.append(createPyWrapper(cfg["ericDir"], name, scriptsDir, False)) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
724 | for name in [ |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
725 | "eric7_browser", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
726 | "eric7_compare", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
727 | "eric7_configure", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
728 | "eric7_diff", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
729 | "eric7_editor", |
10864
8917b1a45546
Added the eric7_fido2.py script to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10854
diff
changeset
|
730 | "eric7_fido2", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
731 | "eric7_hexeditor", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
732 | "eric7_iconeditor", |
9377 | 733 | "eric7_ide", |
10518 | 734 | "eric7_mpy", |
9697
cdaa3cc805f7
Started implementing a PDF viewer tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9694
diff
changeset
|
735 | "eric7_pdf", |
10084
125166c6b66c
pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10065
diff
changeset
|
736 | "eric7_pip", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
737 | "eric7_plugininstall", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
738 | "eric7_pluginrepository", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
739 | "eric7_pluginuninstall", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
740 | "eric7_qregularexpression", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
741 | "eric7_re", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
742 | "eric7_shell", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
743 | "eric7_snap", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
744 | "eric7_sqlbrowser", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
745 | "eric7_tray", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
746 | "eric7_trpreviewer", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
747 | "eric7_uipreviewer", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
748 | "eric7_testing", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
749 | "eric7_virtualenv", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
750 | ]: |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
751 | wnames.append(createPyWrapper(cfg["ericDir"], name, scriptsDir)) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
752 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
753 | # set install prefix, if not None |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
754 | if distDir: |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10372
diff
changeset
|
755 | for key in cfg: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
756 | cfg[key] = os.path.normpath(os.path.join(distDir, cfg[key].lstrip(os.sep))) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
757 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
758 | try: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
759 | # Install the files |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
760 | # make the install directories |
8205
4a0f1f896341
Applied some code simplifications suggested by the new Simplify checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8128
diff
changeset
|
761 | for key in cfg: |
3948
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
762 | if cfg[key] and not os.path.isdir(cfg[key]): |
11043
8cfceca767e1
Modified install script to ignore an issue creating the APIs directory (in case environment was created with --system-site-packages).
Detlev Offenbachs <detlev@die-offenbachs.de>
parents:
11022
diff
changeset
|
763 | try: |
8cfceca767e1
Modified install script to ignore an issue creating the APIs directory (in case environment was created with --system-site-packages).
Detlev Offenbachs <detlev@die-offenbachs.de>
parents:
11022
diff
changeset
|
764 | os.makedirs(cfg[key]) |
8cfceca767e1
Modified install script to ignore an issue creating the APIs directory (in case environment was created with --system-site-packages).
Detlev Offenbachs <detlev@die-offenbachs.de>
parents:
11022
diff
changeset
|
765 | except OSError: |
8cfceca767e1
Modified install script to ignore an issue creating the APIs directory (in case environment was created with --system-site-packages).
Detlev Offenbachs <detlev@die-offenbachs.de>
parents:
11022
diff
changeset
|
766 | if key != "apidir": |
8cfceca767e1
Modified install script to ignore an issue creating the APIs directory (in case environment was created with --system-site-packages).
Detlev Offenbachs <detlev@die-offenbachs.de>
parents:
11022
diff
changeset
|
767 | raise |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
768 | |
7960
e8fc383322f7
Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
769 | # copy the eric config file |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
770 | if distDir: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
771 | shutilCopy(configName, cfg["mdir"]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
772 | if os.path.exists(configName + "c"): |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
773 | shutilCopy(configName + "c", cfg["mdir"]) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
774 | else: |
2160
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
775 | shutilCopy(configName, modDir) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
776 | if os.path.exists(configName + "c"): |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
777 | shutilCopy(configName + "c", modDir) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
778 | |
7960
e8fc383322f7
Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
779 | # copy the various parts of eric |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
780 | copyTree( |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
781 | eric7SourceDir, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
782 | cfg["ericDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
783 | ["*.py", "*.pyc", "*.pyo", "*.pyw"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
784 | excludePatterns=["eric7config.py*"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
785 | ) |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
786 | copyTree( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
787 | os.path.join(eric7SourceDir, "Plugins"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
788 | os.path.join(cfg["ericDir"], "Plugins"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
789 | ["*.svgz", "*.svg", "*.png", "*.style", "*.tmpl", "*.txt"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
790 | ) |
2992
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
791 | copyTree( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
792 | os.path.join(eric7SourceDir, "Documentation"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
793 | cfg["ericDocDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
794 | ["*.html", "*.qch"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
795 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
796 | copyTree(os.path.join(eric7SourceDir, "CSSs"), cfg["ericCSSDir"], ["*.css"]) |
2992
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
797 | copyTree( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
798 | os.path.join(eric7SourceDir, "Styles"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
799 | cfg["ericStylesDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
800 | ["*.qss", "*.ehj"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
801 | ) |
2992
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
802 | copyTree( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
803 | os.path.join(eric7SourceDir, "Themes"), cfg["ericThemesDir"], ["*.ethj"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
804 | ) |
8820
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
805 | copyTree( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
806 | os.path.join(eric7SourceDir, "i18n"), cfg["ericTranslationsDir"], ["*.qm"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
807 | ) |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
808 | copyTree( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
809 | os.path.join(eric7SourceDir, "icons"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
810 | cfg["ericIconDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
811 | ["*.svgz", "*.svg", "*.png", "LICENSE*.*", "readme.txt"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
812 | ) |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
813 | copyTree( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
814 | os.path.join(eric7SourceDir, "pixmaps"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
815 | cfg["ericPixDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
816 | ["*.svgz", "*.svg", "*.png", "*.xpm", "*.ico", "*.gif"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
817 | ) |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
818 | copyTree( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
819 | os.path.join(eric7SourceDir, "DesignerTemplates"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
820 | cfg["ericTemplatesDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
821 | ["*.tmpl"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
822 | ) |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
823 | copyTree( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
824 | os.path.join(eric7SourceDir, "CodeTemplates"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
825 | cfg["ericCodeTemplatesDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
826 | ["*.tmpl"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
827 | ) |
8776
07b8c13b0607
Updated the setup and install script for the updated coverage package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8754
diff
changeset
|
828 | copyTree( |
07b8c13b0607
Updated the setup and install script for the updated coverage package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8754
diff
changeset
|
829 | os.path.join(eric7SourceDir, "DebugClients", "Python", "coverage"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
830 | os.path.join(cfg["ericDir"], "DebugClients", "Python", "coverage"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
831 | ["*.js", "*.html", "*.png", "*.css", "*.scss", "*.txt", "*.rst"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
832 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
833 | |
7717
f32d7965a17e
Changed the code to not rely on the Qt Resource system anymore (no .qrc files and no use of pyrcc5 anymore).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7716
diff
changeset
|
834 | # copy some data files needed at various places |
f32d7965a17e
Changed the code to not rely on the Qt Resource system anymore (no .qrc files and no use of pyrcc5 anymore).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7716
diff
changeset
|
835 | copyTree( |
9127
22e94bac751a
Modified the install script to ensure the trove license list file is installed locally.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9117
diff
changeset
|
836 | os.path.join(eric7SourceDir, "data"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
837 | os.path.join(cfg["ericDir"], "data"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
838 | ["*.txt"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
839 | ) |
9127
22e94bac751a
Modified the install script to ensure the trove license list file is installed locally.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9117
diff
changeset
|
840 | copyTree( |
8354
12ebd3934fef
Renamed 'E5Utilities' to 'EricUtilities' and 'E5Network' to 'EricNetwork'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8343
diff
changeset
|
841 | os.path.join(eric7SourceDir, "EricNetwork", "data"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
842 | os.path.join(cfg["ericDir"], "EricNetwork", "data"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
843 | ["*.dat", "*.txt"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
844 | ) |
7717
f32d7965a17e
Changed the code to not rely on the Qt Resource system anymore (no .qrc files and no use of pyrcc5 anymore).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7716
diff
changeset
|
845 | copyTree( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
846 | os.path.join(eric7SourceDir, "IconEditor", "cursors"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
847 | os.path.join(cfg["ericDir"], "IconEditor", "cursors"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
848 | ["*.xpm"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
849 | ) |
7717
f32d7965a17e
Changed the code to not rely on the Qt Resource system anymore (no .qrc files and no use of pyrcc5 anymore).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7716
diff
changeset
|
850 | copyTree( |
9917
0160b2816f84
Corrected the install script to install the UF2 families file as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9819
diff
changeset
|
851 | os.path.join(eric7SourceDir, "MicroPython", "Tools"), |
0160b2816f84
Corrected the install script to install the UF2 families file as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9819
diff
changeset
|
852 | os.path.join(cfg["ericDir"], "MicroPython", "Tools"), |
0160b2816f84
Corrected the install script to install the UF2 families file as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9819
diff
changeset
|
853 | ["*.json"], |
0160b2816f84
Corrected the install script to install the UF2 families file as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9819
diff
changeset
|
854 | ) |
0160b2816f84
Corrected the install script to install the UF2 families file as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9819
diff
changeset
|
855 | copyTree( |
10090 | 856 | os.path.join(eric7SourceDir, "MicroPython", "BluetoothDialogs", "data"), |
857 | os.path.join(cfg["ericDir"], "MicroPython", "BluetoothDialogs", "data"), | |
858 | ["*.yaml"], | |
859 | ) | |
860 | copyTree( | |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
861 | os.path.join(eric7SourceDir, "UI", "data"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
862 | os.path.join(cfg["ericDir"], "UI", "data"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
863 | ["*.css"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
864 | ) |
8566
0df55126fdf4
Preliminary change to install the eric7 web browser unconditionally (for development and testing only).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8553
diff
changeset
|
865 | copyTree( |
0df55126fdf4
Preliminary change to install the eric7 web browser unconditionally (for development and testing only).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8553
diff
changeset
|
866 | os.path.join(eric7SourceDir, "WebBrowser"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
867 | os.path.join(cfg["ericDir"], "WebBrowser"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
868 | ["*.xbel", "*.xml", "*.html", "*.png", "*.gif", "*.js"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
869 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
870 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
871 | # copy the wrappers |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
872 | for wname in wnames: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
873 | shutilCopy(wname, cfg["bindir"], perm=0o755) |
622
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
874 | os.remove(wname) |
6942
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
875 | shutil.rmtree(scriptsDir) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
876 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
877 | # copy the license file |
9674
43dd357b3bff
Modified the pyproject.toml file to include a reference to the license file and changed its extension to be .txt.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
878 | shutilCopy(os.path.join(sourceDir, "docs", "LICENSE.txt"), cfg["ericDir"]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
879 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
880 | # create the global plugins directory |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
881 | createGlobalPluginsDir() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
882 | |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
883 | except OSError as msg: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
884 | sys.stderr.write("Error: {0}\nTry install with admin rights.\n".format(msg)) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
885 | return 7 |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
886 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
887 | # copy some text files to the doc area |
9680
4acdf7c7101d
Corrected an issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9679
diff
changeset
|
888 | for name in ["LICENSE.txt", "THANKS", "changelog.md", "ThirdParty.md"]: |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
889 | try: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
890 | shutilCopy(os.path.join(sourceDir, "docs", name), cfg["ericDocDir"]) |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
891 | except OSError: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
892 | print( |
9722
63135ab601e7
Corrected some code formatting and style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9697
diff
changeset
|
893 | "\nCould not install '{0}'.".format( |
63135ab601e7
Corrected some code formatting and style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9697
diff
changeset
|
894 | os.path.join(sourceDir, "docs", name) |
63135ab601e7
Corrected some code formatting and style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9697
diff
changeset
|
895 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
896 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
897 | for name in glob.glob(os.path.join(sourceDir, "docs", "README*.*")): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
898 | try: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
899 | shutilCopy(name, cfg["ericDocDir"]) |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
900 | except OSError: |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
901 | print("\nCould not install '{0}'.".format(name)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
902 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
903 | # copy some more stuff |
10595
59579e8aff98
Removed support for the deprecated eric-ide specific XML file formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10525
diff
changeset
|
904 | for name in ("default.ekj", "default_Mac.ekj"): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
905 | try: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
906 | shutilCopy(os.path.join(sourceDir, "others", name), cfg["ericOthersDir"]) |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
907 | except OSError: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
908 | print( |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
909 | "\nCould not install '{0}'.".format( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
910 | os.path.join(sourceDir, "others", name) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
911 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
912 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
913 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
914 | # install the API file |
3943
37d88bed7bb9
Extended install script to mark more files with Python variant markers and added the '--noapis' switch to suppress API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3942
diff
changeset
|
915 | if installApis: |
9366
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
916 | if os.access(cfg["apidir"], os.W_OK): |
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
917 | for progLanguage in progLanguages: |
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
918 | apidir = os.path.join(cfg["apidir"], progLanguage) |
9347
da982d5b0718
Improved the install script to create some more non-existing directories and deal with permission errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9328
diff
changeset
|
919 | if not os.path.exists(apidir): |
da982d5b0718
Improved the install script to create some more non-existing directories and deal with permission errors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9328
diff
changeset
|
920 | os.makedirs(apidir) |
9366
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
921 | for apiName in glob.glob( |
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
922 | os.path.join(eric7SourceDir, "APIs", progLanguage, "*.api") |
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
923 | ): |
2160
1874d4410904
Changed the install script to ensure proper permissions of the installed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2145
diff
changeset
|
924 | shutilCopy(apiName, apidir) |
9366
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
925 | for apiName in glob.glob( |
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
926 | os.path.join(eric7SourceDir, "APIs", progLanguage, "*.bas") |
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
927 | ): |
3943
37d88bed7bb9
Extended install script to mark more files with Python variant markers and added the '--noapis' switch to suppress API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3942
diff
changeset
|
928 | shutilCopy(apiName, apidir) |
9366
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
929 | else: |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
930 | print("\nThe API directory '{0}' is not writable.".format(cfg["apidir"])) |
9366
57980203d6f8
Improved the install script with respect to API files installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9361
diff
changeset
|
931 | print("Use the API files provided by the 'API Files' plug-in.") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
932 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
933 | # Create menu entry for Linux systems |
10334 | 934 | if sys.platform.startswith(("linux", "freebsd")): |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
935 | createLinuxSpecifics() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
936 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
937 | # Create Desktop and Start Menu entries for Windows systems |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
938 | elif sys.platform.startswith(("win", "cygwin")): |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
939 | createWindowsLinks() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
940 | |
1390
f4a7915db1e6
Fixed the Mac part of the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1389
diff
changeset
|
941 | # Create a Mac application bundle |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
942 | elif sys.platform == "darwin": |
10065
de4ae767b0e3
Corrected and checked some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10046
diff
changeset
|
943 | createMacAppBundle() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
944 | |
2383
e999256385bd
Extended the installation routine by the creation of a desktop file for the eric5 web browser.
"Detlev Offenbach <detlev@die-offenbachs.de>"
parents:
2312
diff
changeset
|
945 | return 0 |
1387
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
946 | |
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
947 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
948 | def createLinuxSpecifics(): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
949 | """ |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
950 | Install Linux specific files. |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
951 | """ |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
952 | global distDir, sourceDir |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
953 | |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
954 | dataSourceDir = os.path.join(eric7SourceDir, "data", "linux") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
955 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
956 | if distDir: |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
957 | # create directories first |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
958 | for directory in ( |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
959 | os.path.normpath(os.path.join(distDir, name)) |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
960 | for name in ( |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
961 | "usr/share/icons", |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
962 | "usr/share/icons/hicolor/48x48/apps", |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
963 | "usr/share/applications", |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
964 | "usr/share/metainfo", |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
965 | "usr/share/appdata", |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
966 | ) |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
967 | ): |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
968 | if not os.path.exists(directory): |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
969 | os.makedirs(directory) |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
970 | |
8254
259484b0fc75
install.py, uninstall.py: changed the Linux path where our icons get installed
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8243
diff
changeset
|
971 | dst = os.path.normpath(os.path.join(distDir, "usr/share/icons")) |
10518 | 972 | for icon in ("eric_icon.png", "ericMPy48_icon.png", "ericWeb48_icon.png"): |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
973 | shutilCopy( |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
974 | os.path.join(eric7SourceDir, "pixmaps", icon), |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
975 | os.path.join(dst, icon.replace("_icon", "").replace("48", "")), |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
976 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
977 | |
8660
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
978 | dst = os.path.normpath( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
979 | os.path.join(distDir, "usr/share/icons/hicolor/48x48/apps") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
980 | ) |
10518 | 981 | for icon in ("eric48_icon.png", "ericMPy48_icon.png", "ericWeb48_icon.png"): |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
982 | shutilCopy( |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
983 | os.path.join(eric7SourceDir, "pixmaps", icon), |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
984 | os.path.join(dst, icon.replace("48_icon", "")), |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
985 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
986 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
987 | dst = os.path.normpath(os.path.join(distDir, "usr/share/applications")) |
10518 | 988 | for desktop in ("eric7_ide", "eric7_browser", "eric7_mpy"): |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
989 | copyDesktopFile( |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
990 | os.path.join(dataSourceDir, desktop + ".desktop.in"), |
10517
aecd5a8c958c
Corrected some code style and formatting issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10513
diff
changeset
|
991 | os.path.join(dst, desktop + ".desktop"), |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
992 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
993 | |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
994 | for dst in ( |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
995 | os.path.normpath(os.path.join(distDir, "usr/share/metainfo")), |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
996 | os.path.normpath(os.path.join(distDir, "usr/share/appdata")), |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
997 | ): |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
998 | copyAppStreamFile( |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
999 | os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1000 | os.path.join(dst, "eric7.appdata.xml"), |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1001 | ) |
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1002 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1003 | elif os.getuid() == 0: |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1004 | # eric meta data |
7519
0e93f5167e71
install.py: fixed an issue caused by renaming the old 'default' icon directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7453
diff
changeset
|
1005 | shutilCopy( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
1006 | os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1007 | "/usr/share/icons/eric.png", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1008 | ) |
8660
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
1009 | shutilCopy( |
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
1010 | os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1011 | "/usr/share/icons/hicolor/48x48/apps/eric.png", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1012 | ) |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1013 | copyDesktopFile( |
9381
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
1014 | os.path.join(dataSourceDir, "eric7_ide.desktop.in"), |
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
1015 | "/usr/share/applications/eric7_ide.desktop", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1016 | ) |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1017 | if os.path.exists("/usr/share/metainfo"): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1018 | copyAppStreamFile( |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
1019 | os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1020 | "/usr/share/metainfo/eric7.appdata.xml", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1021 | ) |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1022 | elif os.path.exists("/usr/share/appdata"): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1023 | copyAppStreamFile( |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
1024 | os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1025 | "/usr/share/appdata/eric7.appdata.xml", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1026 | ) |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1027 | |
10518 | 1028 | # eric MicroPython meta data |
1029 | shutilCopy( | |
1030 | os.path.join(eric7SourceDir, "pixmaps", "ericMPy48_icon.png"), | |
1031 | "/usr/share/icons/ericMPy.png", | |
1032 | ) | |
1033 | shutilCopy( | |
1034 | os.path.join(eric7SourceDir, "pixmaps", "ericMPy48_icon.png"), | |
1035 | "/usr/share/icons/hicolor/48x48/apps/ericMPy.png", | |
1036 | ) | |
1037 | copyDesktopFile( | |
1038 | os.path.join(dataSourceDir, "eric7_mpy.desktop.in"), | |
1039 | "/usr/share/applications/eric7_mpy.desktop", | |
1040 | ) | |
1041 | ||
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1042 | # eric web browser meta data |
7519
0e93f5167e71
install.py: fixed an issue caused by renaming the old 'default' icon directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7453
diff
changeset
|
1043 | shutilCopy( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
1044 | os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1045 | "/usr/share/icons/ericWeb.png", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1046 | ) |
8660
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
1047 | shutilCopy( |
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
1048 | os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1049 | "/usr/share/icons/hicolor/48x48/apps/ericWeb.png", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1050 | ) |
8634
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
1051 | copyDesktopFile( |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
1052 | os.path.join(dataSourceDir, "eric7_browser.desktop.in"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1053 | "/usr/share/applications/eric7_browser.desktop", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1054 | ) |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1055 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1056 | elif os.getuid() >= 1000: |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1057 | # it is assumed, that user ids start at 1000 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1058 | localPath = os.path.join(os.path.expanduser("~"), ".local", "share") |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1059 | # create directories first |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1060 | for directory in [ |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1061 | os.path.join(localPath, name) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1062 | for name in ( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1063 | "icons", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1064 | "icons/hicolor/48x48/apps", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1065 | "applications", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1066 | "metainfo", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1067 | "appdata", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1068 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1069 | ]: |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1070 | if not os.path.isdir(directory): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1071 | os.makedirs(directory) |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1072 | |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1073 | # now copy the files |
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1074 | # eric meta data |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1075 | shutilCopy( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
1076 | os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1077 | os.path.join(localPath, "icons", "eric.png"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1078 | ) |
8660
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
1079 | shutilCopy( |
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
1080 | os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1081 | os.path.join(localPath, "icons/hicolor/48x48/apps", "eric.png"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1082 | ) |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1083 | copyDesktopFile( |
9381
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
1084 | os.path.join(dataSourceDir, "eric7_ide.desktop.in"), |
3c9192161833
Adjusted the Linux specific meta files to the eric7_ide change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9380
diff
changeset
|
1085 | os.path.join(localPath, "applications", "eric7_ide.desktop"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1086 | ) |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1087 | copyAppStreamFile( |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
1088 | os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1089 | os.path.join(localPath, "metainfo", "eric7.appdata.xml"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1090 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1091 | copyAppStreamFile( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1092 | os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1093 | os.path.join(localPath, "appdata", "eric7.appdata.xml"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1094 | ) |
10518 | 1095 | |
1096 | # eric MicroPython meta data | |
1097 | shutilCopy( | |
1098 | os.path.join(eric7SourceDir, "pixmaps", "ericMPy48_icon.png"), | |
1099 | os.path.join(localPath, "icons", "ericMPy.png"), | |
1100 | ) | |
1101 | shutilCopy( | |
1102 | os.path.join(eric7SourceDir, "pixmaps", "ericMPy48_icon.png"), | |
1103 | os.path.join(localPath, "icons/hicolor/48x48/apps", "ericMPy.png"), | |
1104 | ) | |
1105 | copyDesktopFile( | |
1106 | os.path.join(dataSourceDir, "eric7_mpy.desktop.in"), | |
1107 | os.path.join(localPath, "applications", "eric7_mpy.desktop"), | |
1108 | ) | |
1109 | ||
10513
805a0450862d
Install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10503
diff
changeset
|
1110 | # eric web browser meta data |
8660
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
1111 | shutilCopy( |
1848e8e4b380
Improved installation procedure to also create application icons on ChromeOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8656
diff
changeset
|
1112 | os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1113 | os.path.join(localPath, "icons", "ericWeb.png"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1114 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1115 | shutilCopy( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1116 | os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1117 | os.path.join(localPath, "icons/hicolor/48x48/apps", "ericWeb.png"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1118 | ) |
8634
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
1119 | copyDesktopFile( |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
1120 | os.path.join(dataSourceDir, "eric7_browser.desktop.in"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1121 | os.path.join(localPath, "applications", "eric7_browser.desktop"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1122 | ) |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1123 | |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1124 | |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1125 | def createWindowsLinks(): |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1126 | """ |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1127 | Create Desktop and Start Menu links. |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1128 | """ |
10983
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1129 | if pywin32_installed: |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1130 | # create the links via an external script to get around some |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1131 | # startup magic done by pywin32.pth |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1132 | args = [ |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1133 | sys.executable, |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1134 | os.path.join(os.path.dirname(__file__), "create_windows_links.py"), |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1135 | ] |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1136 | subprocess.run(args) # secok |
6594
7ecac3b1c7aa
install: second attempt to cope with tricks done by pywin32 at interpreter startup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6593
diff
changeset
|
1137 | return |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1138 | |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
1139 | regPath = ( |
10372
1444b4bee64b
Fixed some code style issue related to implicitly and explicitly concatenated strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10341
diff
changeset
|
1140 | "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders" |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
1141 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1142 | |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1143 | # 1. create desktop shortcuts |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1144 | regName = "Desktop" |
7566
7845da7a7ec2
install.py: added fault handler for desktop shortcut creation on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7519
diff
changeset
|
1145 | desktopEntry = getWinregEntry(regName, regPath) |
7845da7a7ec2
install.py: added fault handler for desktop shortcut creation on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7519
diff
changeset
|
1146 | if desktopEntry: |
7845da7a7ec2
install.py: added fault handler for desktop shortcut creation on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7519
diff
changeset
|
1147 | desktopFolder = os.path.normpath(os.path.expandvars(desktopEntry)) |
7845da7a7ec2
install.py: added fault handler for desktop shortcut creation on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7519
diff
changeset
|
1148 | for linkName, targetPath, iconPath in windowsDesktopEntries(): |
7845da7a7ec2
install.py: added fault handler for desktop shortcut creation on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7519
diff
changeset
|
1149 | linkPath = os.path.join(desktopFolder, linkName) |
7845da7a7ec2
install.py: added fault handler for desktop shortcut creation on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7519
diff
changeset
|
1150 | createWindowsShortcut(linkPath, targetPath, iconPath) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1151 | |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1152 | # 2. create start menu entry and shortcuts |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1153 | regName = "Programs" |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1154 | programsEntry = getWinregEntry(regName, regPath) |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1155 | if programsEntry: |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1156 | programsFolder = os.path.normpath(os.path.expandvars(programsEntry)) |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
1157 | eric7EntryPath = os.path.join(programsFolder, windowsProgramsEntry()) |
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
1158 | if not os.path.exists(eric7EntryPath): |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1159 | try: |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
1160 | os.makedirs(eric7EntryPath) |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
1161 | except OSError: |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1162 | # maybe restrictions prohibited link creation |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1163 | return |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1164 | |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1165 | for linkName, targetPath, iconPath in windowsDesktopEntries(): |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
1166 | linkPath = os.path.join(eric7EntryPath, linkName) |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1167 | createWindowsShortcut(linkPath, targetPath, iconPath) |
6500
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1168 | |
0373580fc86c
install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6495
diff
changeset
|
1169 | |
10065
de4ae767b0e3
Corrected and checked some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10046
diff
changeset
|
1170 | def createMacAppBundle(): |
1387
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
1171 | """ |
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
1172 | Create a Mac application bundle. |
1734bc5f4f82
Mac related changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1385
diff
changeset
|
1173 | """ |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1174 | global cfg, macAppBundleName, macPythonExe, macAppBundlePath |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1175 | |
7141
a479c75c6643
install.py: fixed an issue causing installation to fail in certain situations on macOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7121
diff
changeset
|
1176 | directories = { |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1177 | "contents": "{0}/{1}/Contents/".format(macAppBundlePath, macAppBundleName), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1178 | "exe": "{0}/{1}/Contents/MacOS".format(macAppBundlePath, macAppBundleName), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1179 | "icns": "{0}/{1}/Contents/Resources".format(macAppBundlePath, macAppBundleName), |
3507
b09e10d4f343
Changed the install script to accept a '-n' option to set the name of the directory where the Mac application bundle should be created in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3468
diff
changeset
|
1180 | } |
7227
5ba312e6599a
install.py: fixed an issue causing installation on macOS to fail.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7220
diff
changeset
|
1181 | for directory in directories.values(): |
7141
a479c75c6643
install.py: fixed an issue causing installation to fail in certain situations on macOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7121
diff
changeset
|
1182 | if not os.path.exists(directory): |
a479c75c6643
install.py: fixed an issue causing installation to fail in certain situations on macOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7121
diff
changeset
|
1183 | os.makedirs(directory) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1184 | |
7584
328d92d8db48
install: fixed an issue causing a faulty application bundle being created for macOS installations when installing into a Python virtual environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7566
diff
changeset
|
1185 | if macPythonExe == defaultMacPythonExe and macPythonExe: |
7141
a479c75c6643
install.py: fixed an issue causing installation to fail in certain situations on macOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7121
diff
changeset
|
1186 | starter = os.path.join(directories["exe"], "eric") |
2308
f83826045e51
Change install.py for Mac again.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2307
diff
changeset
|
1187 | os.symlink(macPythonExe, starter) |
f83826045e51
Change install.py for Mac again.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2307
diff
changeset
|
1188 | else: |
10994
e37149c2e4f9
Modified the mac App Bundle creation of the install script slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10983
diff
changeset
|
1189 | starter = "python{0}.{1}".format(sys.version_info.major, sys.version_info.minor) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1190 | |
9377 | 1191 | wname = os.path.join(directories["exe"], "eric7_ide") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1192 | |
4374
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1193 | # determine entry for DYLD_FRAMEWORK_PATH |
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1194 | dyldLine = "" |
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1195 | try: |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
1196 | from PyQt6.QtCore import QLibraryInfo # noqa: I101, I102 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1197 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1198 | qtLibraryDir = QLibraryInfo.path(QLibraryInfo.LibraryPath.LibrariesPath) |
4374
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1199 | except ImportError: |
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1200 | qtLibraryDir = "" |
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1201 | if qtLibraryDir: |
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1202 | dyldLine = "DYLD_FRAMEWORK_PATH={0}\n".format(qtLibraryDir) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1203 | |
4374
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1204 | # determine entry for PATH |
627e3d0b4ba1
Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4307
diff
changeset
|
1205 | pathLine = "" |
1390
f4a7915db1e6
Fixed the Mac part of the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1389
diff
changeset
|
1206 | path = os.getenv("PATH", "") |
f4a7915db1e6
Fixed the Mac part of the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1389
diff
changeset
|
1207 | if path: |
f4a7915db1e6
Fixed the Mac part of the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1389
diff
changeset
|
1208 | pybin = os.path.join(sys.exec_prefix, "bin") |
f4a7915db1e6
Fixed the Mac part of the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1389
diff
changeset
|
1209 | pathlist = path.split(os.pathsep) |
4911
652cb0520e9a
Improved the Mac app bundle creation function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4889
diff
changeset
|
1210 | pathlist_n = [pybin] |
652cb0520e9a
Improved the Mac app bundle creation function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4889
diff
changeset
|
1211 | for path_ in pathlist: |
652cb0520e9a
Improved the Mac app bundle creation function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4889
diff
changeset
|
1212 | if path_ and path_ not in pathlist_n: |
652cb0520e9a
Improved the Mac app bundle creation function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4889
diff
changeset
|
1213 | pathlist_n.append(path_) |
652cb0520e9a
Improved the Mac app bundle creation function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4889
diff
changeset
|
1214 | pathLine = "PATH={0}\n".format(os.pathsep.join(pathlist_n)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1215 | |
4911
652cb0520e9a
Improved the Mac app bundle creation function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4889
diff
changeset
|
1216 | # create the wrapper script |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1217 | wrapper = ( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1218 | """#!/bin/sh\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1219 | """\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1220 | """{0}""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1221 | """{1}""" |
9402
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
1222 | """exec "{2}" "-m" "eric7" "$@"\n""".format(pathLine, dyldLine, starter) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1223 | ) |
1390
f4a7915db1e6
Fixed the Mac part of the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1389
diff
changeset
|
1224 | copyToFile(wname, wrapper) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1225 | os.chmod(wname, 0o755) # secok |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1226 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1227 | shutilCopy( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1228 | os.path.join(eric7SourceDir, "pixmaps", "eric_2.icns"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1229 | os.path.join(directories["icns"], "eric.icns"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1230 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1231 | |
10716
11cdcc824469
Relocated the Version information into a top level '__version__.py' module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10679
diff
changeset
|
1232 | if os.path.exists(os.path.join("eric", "eric7", "__version__.py")): |
6664
50c9c1c9cf30
install.py: extended and corrected the macOS application bundle generation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6663
diff
changeset
|
1233 | # Installing from archive |
10716
11cdcc824469
Relocated the Version information into a top level '__version__.py' module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10679
diff
changeset
|
1234 | from eric.eric7.__version__ import CopyrightShort, Version # noqa: I101, I102 |
11cdcc824469
Relocated the Version information into a top level '__version__.py' module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10679
diff
changeset
|
1235 | elif os.path.exists(os.path.join("eric7", "__version__.py")): |
6664
50c9c1c9cf30
install.py: extended and corrected the macOS application bundle generation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6663
diff
changeset
|
1236 | # Installing from source tree |
10716
11cdcc824469
Relocated the Version information into a top level '__version__.py' module.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10679
diff
changeset
|
1237 | from eric7.__version__ import CopyrightShort, Version # noqa: I101 |
6664
50c9c1c9cf30
install.py: extended and corrected the macOS application bundle generation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6663
diff
changeset
|
1238 | else: |
50c9c1c9cf30
install.py: extended and corrected the macOS application bundle generation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6663
diff
changeset
|
1239 | Version = "Unknown" |
10439
21c28b0f9e41
Updated copyright for 2024.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10420
diff
changeset
|
1240 | CopyrightShort = "(c) 2002 - 2024 Detlev Offenbach" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1241 | |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
1242 | copyToFile( |
7141
a479c75c6643
install.py: fixed an issue causing installation to fail in certain situations on macOS.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7121
diff
changeset
|
1243 | os.path.join(directories["contents"], "Info.plist"), |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1244 | """<?xml version="1.0" encoding="UTF-8"?>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1245 | """<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1246 | """ "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1247 | """<plist version="1.0">\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1248 | """<dict>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1249 | """ <key>CFBundleExecutable</key>\n""" |
9377 | 1250 | """ <string>eric7_ide</string>\n""" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1251 | """ <key>CFBundleIconFile</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1252 | """ <string>eric.icns</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1253 | """ <key>CFBundleInfoDictionaryVersion</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1254 | """ <string>{1}</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1255 | """ <key>CFBundleName</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1256 | """ <string>{0}</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1257 | """ <key>CFBundleDisplayName</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1258 | """ <string>{0}</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1259 | """ <key>CFBundlePackageType</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1260 | """ <string>APPL</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1261 | """ <key>CFBundleSignature</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1262 | """ <string>ERIC-IDE</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1263 | """ <key>CFBundleVersion</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1264 | """ <string>{1}</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1265 | """ <key>CFBundleGetInfoString</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1266 | """ <string>{1}, {2}</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1267 | """ <key>CFBundleIdentifier</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1268 | """ <string>org.python-projects.eric-ide</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1269 | """ <key>NSRequiresAquaSystemAppearance</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1270 | """ <string>false</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1271 | """ <key>LSEnvironment</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1272 | """ <dict>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1273 | """ <key>LANG</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1274 | """ <string>en_US.UTF-8</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1275 | """ <key>LC_ALL</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1276 | """ <string>en_US.UTF-8</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1277 | """ <key>LC_CTYPE</key>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1278 | """ <string>en_US.UTF-8</string>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1279 | """ </dict>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1280 | """</dict>\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1281 | """</plist>\n""".format( |
6664
50c9c1c9cf30
install.py: extended and corrected the macOS application bundle generation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6663
diff
changeset
|
1282 | macAppBundleName.replace(".app", ""), |
50c9c1c9cf30
install.py: extended and corrected the macOS application bundle generation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6663
diff
changeset
|
1283 | Version.split(None, 1)[0], |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1284 | CopyrightShort, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1285 | ), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1286 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1287 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1288 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1289 | def createInstallConfig(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1290 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1291 | Create the installation config dictionary. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1292 | """ |
3948
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
1293 | global modDir, platBinDir, cfg, apisDir, installApis |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1294 | |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
1295 | ericdir = os.path.join(modDir, "eric7") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1296 | cfg = { |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1297 | "ericDir": ericdir, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1298 | "ericPixDir": os.path.join(ericdir, "pixmaps"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1299 | "ericIconDir": os.path.join(ericdir, "icons"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1300 | "ericDTDDir": os.path.join(ericdir, "DTDs"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1301 | "ericCSSDir": os.path.join(ericdir, "CSSs"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1302 | "ericStylesDir": os.path.join(ericdir, "Styles"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1303 | "ericThemesDir": os.path.join(ericdir, "Themes"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1304 | "ericDocDir": os.path.join(ericdir, "Documentation"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1305 | "ericExamplesDir": os.path.join(ericdir, "Examples"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1306 | "ericTranslationsDir": os.path.join(ericdir, "i18n"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1307 | "ericTemplatesDir": os.path.join(ericdir, "DesignerTemplates"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1308 | "ericCodeTemplatesDir": os.path.join(ericdir, "CodeTemplates"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1309 | "ericOthersDir": ericdir, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1310 | "bindir": platBinDir, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1311 | "mdir": modDir, |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1312 | } |
3948
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
1313 | if installApis: |
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
1314 | if apisDir: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1315 | cfg["apidir"] = apisDir |
3948
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
1316 | else: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1317 | cfg["apidir"] = os.path.join(ericdir, "api") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1318 | else: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1319 | cfg["apidir"] = "" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1320 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1321 | |
8820
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1322 | configLength = 16 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1323 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
1324 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1325 | def createConfig(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1326 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1327 | Create a config file with the respective config entries. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1328 | """ |
6942
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
1329 | global cfg, macAppBundlePath, configName |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1330 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1331 | apis = [] |
3948
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
1332 | if installApis: |
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
1333 | for progLanguage in progLanguages: |
6960
1d4e02425869
install.py: fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6956
diff
changeset
|
1334 | for apiName in sorted( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1335 | glob.glob(os.path.join(eric7SourceDir, "APIs", progLanguage, "*.api")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1336 | ): |
40
c2e5472b112c
Changed some code to adjust eric5 to Python3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
21
diff
changeset
|
1337 | apis.append(os.path.basename(apiName)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1338 | |
8260
2161475d9639
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8258
diff
changeset
|
1339 | macConfig = ( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1340 | ( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1341 | """ 'macAppBundlePath': r'{0}',\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1342 | """ 'macAppBundleName': r'{1}',\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1343 | ).format(macAppBundlePath, macAppBundleName) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1344 | if sys.platform == "darwin" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1345 | else "" |
8260
2161475d9639
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8258
diff
changeset
|
1346 | ) |
3036
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1347 | config = ( |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1348 | """# -*- coding: utf-8 -*-\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1349 | """#\n""" |
7960
e8fc383322f7
Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
1350 | """# This module contains the configuration of the individual eric""" |
3036
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1351 | """ installation\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1352 | """#\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1353 | """\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1354 | """_pkg_config = {{\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1355 | """ 'ericDir': r'{0}',\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1356 | """ 'ericPixDir': r'{1}',\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1357 | """ 'ericIconDir': r'{2}',\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1358 | """ 'ericDTDDir': r'{3}',\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1359 | """ 'ericCSSDir': r'{4}',\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1360 | """ 'ericStylesDir': r'{5}',\n""" |
8820
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1361 | """ 'ericThemesDir': r'{6}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1362 | """ 'ericDocDir': r'{7}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1363 | """ 'ericExamplesDir': r'{8}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1364 | """ 'ericTranslationsDir': r'{9}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1365 | """ 'ericTemplatesDir': r'{10}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1366 | """ 'ericCodeTemplatesDir': r'{11}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1367 | """ 'ericOthersDir': r'{12}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1368 | """ 'bindir': r'{13}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1369 | """ 'mdir': r'{14}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1370 | """ 'apidir': r'{15}',\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1371 | """ 'apis': {16},\n""" |
149f941d072e
Finished implementing a manager for color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8776
diff
changeset
|
1372 | """{17}""" |
3036
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1373 | """}}\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1374 | """\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1375 | """def getConfig(name):\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1376 | """ '''\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1377 | """ Module function to get a configuration value.\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1378 | """\n""" |
5628
3a1bef0560b1
Corrected some left overs of a failed installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5597
diff
changeset
|
1379 | """ @param name name of the configuration value""" |
3a1bef0560b1
Corrected some left overs of a failed installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5597
diff
changeset
|
1380 | """ @type str\n""" |
3a1bef0560b1
Corrected some left overs of a failed installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5597
diff
changeset
|
1381 | """ @exception AttributeError raised to indicate an invalid""" |
3a1bef0560b1
Corrected some left overs of a failed installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5597
diff
changeset
|
1382 | """ config entry\n""" |
3036
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1383 | """ '''\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1384 | """ try:\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1385 | """ return _pkg_config[name]\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1386 | """ except KeyError:\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1387 | """ pass\n""" |
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1388 | """\n""" |
5628
3a1bef0560b1
Corrected some left overs of a failed installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5597
diff
changeset
|
1389 | """ raise AttributeError(\n""" |
3a1bef0560b1
Corrected some left overs of a failed installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5597
diff
changeset
|
1390 | """ '"{{0}}" is not a valid configuration value'""" |
3a1bef0560b1
Corrected some left overs of a failed installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5597
diff
changeset
|
1391 | """.format(name))\n""" |
3507
b09e10d4f343
Changed the install script to accept a '-n' option to set the name of the directory where the Mac application bundle should be created in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3468
diff
changeset
|
1392 | ).format( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1393 | cfg["ericDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1394 | cfg["ericPixDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1395 | cfg["ericIconDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1396 | cfg["ericDTDDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1397 | cfg["ericCSSDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1398 | cfg["ericStylesDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1399 | cfg["ericThemesDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1400 | cfg["ericDocDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1401 | cfg["ericExamplesDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1402 | cfg["ericTranslationsDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1403 | cfg["ericTemplatesDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1404 | cfg["ericCodeTemplatesDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1405 | cfg["ericOthersDir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1406 | cfg["bindir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1407 | cfg["mdir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1408 | cfg["apidir"], |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1409 | sorted(apis), |
7804
1cbc27e34ec6
Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7799
diff
changeset
|
1410 | macConfig, |
3507
b09e10d4f343
Changed the install script to accept a '-n' option to set the name of the directory where the Mac application bundle should be created in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3468
diff
changeset
|
1411 | ) |
6942
2602857055c5
Major restructuring of the source tree to get prepared for a setup.py based installation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6939
diff
changeset
|
1412 | copyToFile(configName, config) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1413 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
1414 | |
7804
1cbc27e34ec6
Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7799
diff
changeset
|
1415 | def createInstallInfo(): |
1cbc27e34ec6
Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7799
diff
changeset
|
1416 | """ |
7960
e8fc383322f7
Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
1417 | Record information about the way eric was installed. |
7804
1cbc27e34ec6
Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7799
diff
changeset
|
1418 | """ |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1419 | global createInstallInfoFile, installInfo, installCwd, cfg |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1420 | |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1421 | if createInstallInfoFile: |
10192
f457742dd3d6
Modified the datetime.datetime methods to include the 'tz' argument.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10177
diff
changeset
|
1422 | installDateTime = datetime.datetime.now(tz=datetime.timezone.utc) |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1423 | try: |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1424 | installInfo["sudo"] = os.getuid() == 0 |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1425 | except AttributeError: |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1426 | installInfo["sudo"] = False |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1427 | installInfo["user"] = getpass.getuser() |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1428 | installInfo["exe"] = sys.executable |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1429 | installInfo["argv"] = " ".join(shlex.quote(a) for a in sys.argv[:]) |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1430 | installInfo["install_cwd"] = installCwd |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1431 | installInfo["eric"] = cfg["ericDir"] |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1432 | installInfo["virtualenv"] = installInfo["eric"].startswith( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1433 | os.path.expanduser("~") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1434 | ) |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1435 | installInfo["installed"] = True |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1436 | installInfo["installed_on"] = installDateTime.strftime("%Y-%m-%d %H:%M:%S") |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1437 | installInfo["guessed"] = False |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1438 | installInfo["edited"] = False |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1439 | installInfo["pip"] = False |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1440 | installInfo["remarks"] = "" |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1441 | installInfo["install_cwd_edited"] = False |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1442 | installInfo["exe_edited"] = False |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1443 | installInfo["argv_edited"] = False |
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
1444 | installInfo["eric_edited"] = False |
7804
1cbc27e34ec6
Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7799
diff
changeset
|
1445 | |
7823
9a4e93471a06
install.py: fixed a code style issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7821
diff
changeset
|
1446 | |
8258
82b608e352ec
Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8254
diff
changeset
|
1447 | def pipInstall(packageName, message, force=True): |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1448 | """ |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1449 | Install the given package via pip. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1450 | |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1451 | @param packageName name of the package to be installed |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1452 | @type str |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1453 | @param message message to be shown to the user |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1454 | @type str |
8258
82b608e352ec
Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8254
diff
changeset
|
1455 | @param force flag indicating to perform the installation |
82b608e352ec
Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8254
diff
changeset
|
1456 | without asking the user |
82b608e352ec
Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8254
diff
changeset
|
1457 | @type bool |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1458 | @return flag indicating a successful installation |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1459 | @rtype bool |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1460 | """ |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1461 | global yes2All, proxy |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1462 | |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1463 | ok = False |
8258
82b608e352ec
Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8254
diff
changeset
|
1464 | if yes2All or force: |
7333 | 1465 | answer = "y" |
1466 | else: | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1467 | print( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1468 | "{0}\nShall '{1}' be installed using pip? (Y/n)".format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1469 | message, packageName |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1470 | ), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1471 | end=" ", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1472 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1473 | answer = input() # secok |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1474 | if answer in ("", "Y", "y"): |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1475 | args = [ |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1476 | sys.executable, |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1477 | "-m", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1478 | "pip", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1479 | "install", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1480 | "--prefer-binary", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1481 | "--upgrade", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1482 | ] |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1483 | if proxy: |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1484 | args.append(f"--proxy={proxy}") |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1485 | args.append(packageName) |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1486 | exitCode = subprocess.run(args).returncode # secok |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1487 | ok = exitCode == 0 |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1488 | |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1489 | return ok |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1490 | |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1491 | |
7453
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1492 | def isPipOutdated(): |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1493 | """ |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1494 | Check, if pip is outdated. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1495 | |
7453
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1496 | @return flag indicating an outdated pip |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1497 | @rtype bool |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1498 | """ |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1499 | global proxy |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1500 | |
7453
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1501 | try: |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1502 | args = [ |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1503 | sys.executable, |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1504 | "-m", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1505 | "pip", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1506 | "list", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1507 | "--outdated", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1508 | "--format=json", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1509 | ] |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1510 | if proxy: |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1511 | args.append(f"--proxy={proxy}") |
9278
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1512 | pipOut = ( |
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1513 | subprocess.run( # secok |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1514 | args, |
9278
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1515 | check=True, |
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1516 | capture_output=True, |
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1517 | text=True, |
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1518 | ) |
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1519 | .stdout.strip() |
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1520 | .splitlines()[0] |
36448ca469c2
Simplified some code iaw. recommendations of the extended style checker and reformatted the code with black.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9261
diff
changeset
|
1521 | ) |
9261
66cc5e304450
Corrected another issue related to pip outputting additional data after the JSON line for 'pip list'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9231
diff
changeset
|
1522 | # only the first line contains the JSON data |
7453
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1523 | except (OSError, subprocess.CalledProcessError): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1524 | pipOut = "[]" # default empty list |
7453
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1525 | try: |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1526 | jsonList = json.loads(pipOut) |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1527 | except Exception: |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1528 | jsonList = [] |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1529 | for package in jsonList: |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1530 | if isinstance(package, dict) and package["name"] == "pip": |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1531 | print( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1532 | "'pip' is outdated (installed {0}, available {1})".format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1533 | package["version"], package["latest_version"] |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1534 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1535 | ) |
7453
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1536 | return True |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1537 | |
7453
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1538 | return False |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1539 | |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1540 | |
7448
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1541 | def updatePip(): |
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1542 | """ |
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1543 | Update the installed pip package. |
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1544 | """ |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1545 | global yes2All, proxy |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1546 | |
7448
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1547 | if yes2All: |
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1548 | answer = "y" |
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1549 | else: |
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1550 | print("Shall 'pip' be updated (recommended)? (Y/n)", end=" ") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1551 | answer = input() # secok |
7448
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1552 | if answer in ("", "Y", "y"): |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1553 | args = [ |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1554 | sys.executable, |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1555 | "-m", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1556 | "pip", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1557 | "install", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1558 | "--upgrade", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1559 | ] |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1560 | if proxy: |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1561 | args.append(f"--proxy={proxy}") |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1562 | args.append("pip") |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
1563 | subprocess.run(args) # secok |
7448
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1564 | |
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1565 | |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1566 | def versionToStr(version): |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1567 | """ |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1568 | Function to convert a version number into a version string. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1569 | |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1570 | @param version version number to convert |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1571 | @type int |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1572 | @return version string |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1573 | @rtype str |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1574 | """ |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1575 | parts = [] |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1576 | while version: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1577 | parts.append(version & 0xFF) |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1578 | version >>= 8 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1579 | return ".".join(str(p) for p in reversed(parts)) |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1580 | |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1581 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
1582 | def doDependancyChecks(): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1583 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1584 | Perform some dependency checks. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1585 | """ |
10983
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1586 | global pywin32_installed, verbose |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1587 | |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1588 | requiredVersions = { |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1589 | "pyqt6": 0x60200, # v6.2.0 |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1590 | "pyqt6-charts": 0x60200, # v6.2.0 |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1591 | "pyqt6-webengine": 0x60200, # v6.2.0 |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1592 | "pyqt6-qscintilla": 0x20D00, # v2.13.0 |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1593 | "sip": 0x60100, # v6.1.0 |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1594 | } |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1595 | |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1596 | try: |
10264
f06151820839
Corrected the recent change to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10261
diff
changeset
|
1597 | isSudo = os.getuid() == 0 |
8261
0c2aa0ad149f
install script: little change for macOS installations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8260
diff
changeset
|
1598 | # disregard sudo installs on macOS |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1599 | except AttributeError: |
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1600 | isSudo = False |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1601 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1602 | print("Checking dependencies") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1603 | |
7448
29b54296cf8c
install script: added option to update pip before testing the version of the prerequisite tools.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
1604 | # update pip first even if we don't need to install anything |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1605 | if not isSudo and isPipOutdated(): |
7453
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1606 | updatePip() |
54431a52b7f2
install.py: refined the pip update process
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7448
diff
changeset
|
1607 | print("\n") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1608 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1609 | # perform dependency checks |
11022
95c889f18a21
Dropped support for Python 3.8 because that version is EOL.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10998
diff
changeset
|
1610 | if sys.version_info < (3, 9, 0) or sys.version_info >= (3, 14, 0): |
95c889f18a21
Dropped support for Python 3.8 because that version is EOL.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10998
diff
changeset
|
1611 | print("Sorry, you must have Python 3.9.0 or higher, but less 3.14.0.") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1612 | print("Yours is {0}.".format(".".join(str(v) for v in sys.version_info[:3]))) |
390
daa7c6ae6248
Change install script to always keep it open on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
386
diff
changeset
|
1613 | exit(5) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1614 | |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1615 | if ( |
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1616 | importlib.util.find_spec("xml") is None |
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1617 | or importlib.util.find_spec("xml.etree") is None |
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1618 | ): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1619 | print("Your Python installation is missing the XML module.") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1620 | print("Please install it and try again.") |
1525
1c7bd9144f43
Updated the install script to check for the presence of the xml.etree package, which is sometimes included in a separate installation package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1509
diff
changeset
|
1621 | exit(5) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1622 | |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1623 | print("PyQt & Qt") |
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1624 | print("---------") |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1625 | try: |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
1626 | from PyQt6.QtCore import qVersion # noqa: I101, I102 |
8656
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
1627 | except ImportError as err: |
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
1628 | msg = "'PyQt6' could not be detected.{0}".format( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1629 | "\nError: {0}".format(err) if verbose else "" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1630 | ) |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1631 | installed = not isSudo and pipInstall( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1632 | "PyQt6>={0}".format(versionToStr(requiredVersions["pyqt6"])), msg |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1633 | ) |
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1634 | if installed: |
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1635 | # try to import it again |
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1636 | try: |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
1637 | from PyQt6.QtCore import qVersion # noqa: I101, I102 |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1638 | except ImportError as msg: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1639 | print("Sorry, please install PyQt6.") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1640 | print("Error: {0}".format(msg)) |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1641 | exit(1) |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1642 | else: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1643 | print("Sorry, please install PyQt6.") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1644 | print("Error: {0}".format(msg)) |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1645 | exit(1) |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
1646 | print("Found PyQt6") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1647 | |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1648 | pyuic = "pyuic6" |
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1649 | if importlib.util.find_spec("PyQt6.uic") is None: |
4800
9b30c587513c
Added a check for pyuic to the install script to prevent errors later on in the installation, if it is not installed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4673
diff
changeset
|
1650 | print("Sorry, {0} is not installed.".format(pyuic)) |
9b30c587513c
Added a check for pyuic to the install script to prevent errors later on in the installation, if it is not installed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4673
diff
changeset
|
1651 | exit(1) |
9b30c587513c
Added a check for pyuic to the install script to prevent errors later on in the installation, if it is not installed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4673
diff
changeset
|
1652 | print("Found {0}".format(pyuic)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1653 | |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1654 | if importlib.util.find_spec("PyQt6.QtWebEngineWidgets") is None: |
8634
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
1655 | if isSudo: |
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
1656 | print("Optional 'PyQt6-WebEngine' could not be detected.") |
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
1657 | else: |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1658 | msg = "Optional 'PyQt6-WebEngine' could not be detected." |
8634
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
1659 | pipInstall( |
8739
55e07d9608f0
Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8721
diff
changeset
|
1660 | "PyQt6-WebEngine>={0}".format( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1661 | versionToStr(requiredVersions["pyqt6-webengine"]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1662 | ), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1663 | msg, |
8634
2bbfaad44cbd
Activated some code related to Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8615
diff
changeset
|
1664 | ) |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1665 | print("Found PyQt6-WebEngine") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1666 | |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1667 | if importlib.util.find_spec("PyQt6.QtCharts") is None: |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1668 | if isSudo: |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
1669 | print("Optional 'PyQt6-Charts' could not be detected.") |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1670 | else: |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1671 | msg = "Optional 'PyQt6-Charts' could not be detected." |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1672 | pipInstall( |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1673 | "PyQt6-Charts>={0}".format( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1674 | versionToStr(requiredVersions["pyqt6-charts"]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1675 | ), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1676 | msg, |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1677 | ) |
8343
242d5dae2937
Corrected some place to import QtCharts instead of QtChart.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8339
diff
changeset
|
1678 | print("Found PyQt6-Charts") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1679 | |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1680 | if importlib.util.find_spec("PyQt6.Qsci") is None: |
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1681 | msg = "'PyQt6-QScintilla' could not be detected." |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1682 | installed = not isSudo and pipInstall( |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1683 | "PyQt6-QScintilla>={0}".format( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1684 | versionToStr(requiredVersions["pyqt6-qscintilla"]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1685 | ), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1686 | msg, |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1687 | ) |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1688 | message = None if installed else "PyQt6-QScintilla could not be installed." |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1689 | if message: |
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1690 | print("Sorry, please install QScintilla2 and") |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
1691 | print("its PyQt6 wrapper.") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1692 | print("Error: {0}".format(message)) |
6211
4f0e08c95ca9
install script: extended the install script by code to install PyQt5 and/or QScintilla via pip.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6208
diff
changeset
|
1693 | exit(1) |
8339
75908476226e
Prepared the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
1694 | print("Found PyQt6-QScintilla") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1695 | |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1696 | pyqt6BaseModulesList = [ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1697 | "PyQt6.QtGui", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1698 | "PyQt6.QtNetwork", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1699 | "PyQt6.QtPrintSupport", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1700 | "PyQt6.QtSql", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1701 | "PyQt6.QtSvg", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1702 | "PyQt6.QtSvgWidgets", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1703 | "PyQt6.QtWidgets", |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1704 | ] |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1705 | requiredModulesList = { |
8128
8f012c58f27e
Changed setup.py and the install script to include the dependency to PyYAML and toml packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8127
diff
changeset
|
1706 | # key is pip project name |
8f012c58f27e
Changed setup.py and the install script to include the dependency to PyYAML and toml packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8127
diff
changeset
|
1707 | # value is tuple of package name, pip install constraint |
9107
8e9525a780ae
Syntax Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9066
diff
changeset
|
1708 | "tomlkit": ("tomlkit", ""), |
8258
82b608e352ec
Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8254
diff
changeset
|
1709 | "asttokens": ("asttokens", ""), |
82b608e352ec
Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8254
diff
changeset
|
1710 | "EditorConfig": ("editorconfig", ""), |
82b608e352ec
Third Party packages
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8254
diff
changeset
|
1711 | "Pygments": ("pygments", ""), |
8593
1d66b6af60ed
Jedi: integrated the Assistant Jedi plugin as a fixed part of eric.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8566
diff
changeset
|
1712 | "parso": ("parso", ""), |
1d66b6af60ed
Jedi: integrated the Assistant Jedi plugin as a fixed part of eric.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8566
diff
changeset
|
1713 | "jedi": ("jedi", ""), |
8977
663521af48b2
Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8966
diff
changeset
|
1714 | "packaging": ("packaging", ""), |
9117
c6afba2049cf
CycloneDX Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9108
diff
changeset
|
1715 | "cyclonedx-python-lib": ("cyclonedx", ""), |
c6afba2049cf
CycloneDX Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9108
diff
changeset
|
1716 | "cyclonedx-bom": ("cyclonedx_py", ""), |
9175
21e2be5f0b41
Changed code to use the 'trove-classifiers' package instead of a local text file copy or a download from PyPI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9143
diff
changeset
|
1717 | "trove-classifiers": ("trove_classifiers", ""), |
9214
bd28e56047d7
Code Formatting
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1718 | "black": ("black", ">=22.6.0"), |
9453
e5065dde905d
Code Formatting
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9448
diff
changeset
|
1719 | "isort": ("isort", ">=5.10.0"), |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1720 | "coverage": ("coverage", ">=6.5.0"), |
9744
92fbd6bdba84
Changed code converting a version string into a version tuple to use the 'semver' package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9732
diff
changeset
|
1721 | "semver": ("semver", ""), |
10177
27a6e35c64ed
Changed the included 'pipdeptree' to an external dependency.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10162
diff
changeset
|
1722 | "pipdeptree": ("pipdeptree", ""), |
10679 | 1723 | "watchdog": ("watchdog", ">=3.0.0"), |
10828 | 1724 | "psutil": ("psutil", ""), |
10998
6d7bddfde5fe
Added the 'requests' package to the list of dependencies.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10994
diff
changeset
|
1725 | "requests": ("requests", ""), |
8128
8f012c58f27e
Changed setup.py and the install script to include the dependency to PyYAML and toml packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8127
diff
changeset
|
1726 | } |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1727 | optionalModulesList = { |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1728 | # key is pip project name |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1729 | # value is tuple of package name, pip install constraint |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1730 | "docutils": ("docutils", ""), |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1731 | "Markdown": ("markdown", ""), |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1732 | "pyyaml": ("yaml", ""), |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1733 | "chardet": ("chardet", ""), |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1734 | "pyenchant": ("enchant", ""), |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1735 | "wheel": ("wheel", ""), |
10341
3fdffd9cc21d
Syntax Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10334
diff
changeset
|
1736 | "esprima": ("esprima", ""), |
10854
30c45bd597e6
Started implementing a dialog to manage FIDO2 security keys.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10828
diff
changeset
|
1737 | "fido2": ("fido2", ""), |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1738 | } |
9356
803a7a85b071
Changed the install script to only install the qt6-applications package if requested explicitly (--with-tools).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9347
diff
changeset
|
1739 | if withPyqt6Tools: |
8548
c87eb20797b7
Activated support for the 'qt6-applications' project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8522
diff
changeset
|
1740 | optionalModulesList["qt6-applications"] = ("qt6_applications", "") |
10868
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1741 | optionalWinModulesList = { |
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1742 | # key is pip project name |
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1743 | # value is tuple of package name, pip install constraint |
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1744 | "pywin32": ("win32com", ">=1.0"), |
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1745 | "command-runner": ("command_runner", ""), |
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1746 | } |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1747 | |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1748 | # check mandatory PyQt6 modules |
3681
3a79355b9ca5
Fixed a bugs in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3678
diff
changeset
|
1749 | modulesOK = True |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1750 | for pyqt6BaseModule in sorted(pyqt6BaseModulesList): |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1751 | name = pyqt6BaseModule.split(".")[1] |
2312
976dcb82c3e9
Extended the dependancy check of the install script because some distributions have Qt4 (or Qt5) cut into a bunch of little pieces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2308
diff
changeset
|
1752 | try: |
9485
0f3620304d7a
Changed code to use 'iimportlib.import_module()' instead of '__import__()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
1753 | importlib.import_module(pyqt6BaseModule) |
2312
976dcb82c3e9
Extended the dependancy check of the install script because some distributions have Qt4 (or Qt5) cut into a bunch of little pieces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2308
diff
changeset
|
1754 | print("Found", name) |
8656
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
1755 | except ImportError as err: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1756 | print("Sorry, please install {0}.".format(name)) |
8656
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
1757 | if verbose: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1758 | print("Error: {0}".format(err)) |
2312
976dcb82c3e9
Extended the dependancy check of the install script because some distributions have Qt4 (or Qt5) cut into a bunch of little pieces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2308
diff
changeset
|
1759 | modulesOK = False |
976dcb82c3e9
Extended the dependancy check of the install script because some distributions have Qt4 (or Qt5) cut into a bunch of little pieces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2308
diff
changeset
|
1760 | if not modulesOK: |
976dcb82c3e9
Extended the dependancy check of the install script because some distributions have Qt4 (or Qt5) cut into a bunch of little pieces.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2308
diff
changeset
|
1761 | exit(1) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1762 | |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1763 | # check required modules |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1764 | print("\nRequired Packages") |
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1765 | print("-----------------") |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1766 | requiredMissing = False |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1767 | for requiredPackage in sorted(requiredModulesList): |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1768 | try: |
9485
0f3620304d7a
Changed code to use 'iimportlib.import_module()' instead of '__import__()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
1769 | importlib.import_module(requiredModulesList[requiredPackage][0]) |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1770 | print("Found", requiredPackage) |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1771 | except ImportError as err: |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1772 | if isSudo: |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1773 | print("Required '{0}' could not be detected.".format(requiredPackage)) |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1774 | requiredMissing = True |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1775 | else: |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1776 | msg = "Required '{0}' could not be detected.{1}".format( |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1777 | requiredPackage, "\nError: {0}".format(err) if verbose else "" |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1778 | ) |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1779 | pipInstall( |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1780 | requiredPackage + requiredModulesList[requiredPackage][1], |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1781 | msg, |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1782 | force=True, |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1783 | ) |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1784 | if requiredMissing: |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1785 | print("Some required packages are missing and could not be installed.") |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1786 | print("Install them manually with:") |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1787 | print(" {0} install-dependencies.py --required".format(sys.executable)) |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1788 | |
7745
43888e12e481
install.py: added code section to check for and install optional packages (like pyqt5-tools).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7740
diff
changeset
|
1789 | # check optional modules |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1790 | print("\nOptional Packages") |
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
1791 | print("-----------------") |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1792 | optionalMissing = False |
10868
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1793 | optModulesDict = copy.deepcopy(optionalModulesList) |
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1794 | if sys.platform.startswith(("win", "cygwin")): |
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1795 | optModulesDict.update(optionalWinModulesList) |
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1796 | for optPackage in sorted(optModulesDict): |
7745
43888e12e481
install.py: added code section to check for and install optional packages (like pyqt5-tools).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7740
diff
changeset
|
1797 | try: |
10868
ca5cd7faaf5e
Changed the install scripts and the eric7_fido2.py[w] scripts because these scripts need admin rights on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10864
diff
changeset
|
1798 | importlib.import_module(optModulesDict[optPackage][0]) |
7745
43888e12e481
install.py: added code section to check for and install optional packages (like pyqt5-tools).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7740
diff
changeset
|
1799 | print("Found", optPackage) |
8656
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
1800 | except ImportError as err: |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1801 | if isSudo: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1802 | print("Optional '{0}' could not be detected.".format(optPackage)) |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1803 | optionalMissing = True |
7812
44004f273a7b
install script: changed code to not ask to installe prerequisites if it is run as root user (= UID 0)
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7809
diff
changeset
|
1804 | else: |
8656
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
1805 | msg = "Optional '{0}' could not be detected.{1}".format( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1806 | optPackage, "\nError: {0}".format(err) if verbose else "" |
8656
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
1807 | ) |
10983
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1808 | ok = pipInstall(optPackage + optModulesDict[optPackage][1], msg) |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1809 | if optPackage == "pywin32" and ok: |
8b9913066b8c
Fixed the install script logic with respect to installation of pywin32 because that package does some magic when python.exe is started.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10959
diff
changeset
|
1810 | pywin32_installed = True |
9314
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1811 | if optionalMissing: |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1812 | print("Some optional packages are missing and could not be installed.") |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1813 | print("Install them manually with:") |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1814 | print(" {0} install-dependencies.py --optional".format(sys.executable)) |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1815 | |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1816 | if requiredMissing and optionalMissing: |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1817 | print("Alternatively you may install all of them with:") |
7ba79b00ea96
install scripts
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9278
diff
changeset
|
1818 | print(" {0} install-dependencies.py --all".format(sys.executable)) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1819 | |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1820 | # determine the platform dependent block list |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1821 | if sys.platform.startswith(("win", "cygwin")): |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1822 | PlatformBlockLists = PlatformsBlockLists["windows"] |
1914
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
1823 | elif sys.platform.startswith("linux"): |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1824 | PlatformBlockLists = PlatformsBlockLists["linux"] |
10334 | 1825 | elif sys.platform.startswith("freebsd"): |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1826 | PlatformBlockLists = PlatformsBlockLists["freebsd"] |
1914
fa4d57a6c3a9
Added platform specific blacklists due to recent PyQt4 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1770
diff
changeset
|
1827 | else: |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1828 | PlatformBlockLists = PlatformsBlockLists["mac"] |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1829 | |
8386
41a27cbdb5c1
install.py: modified the version display slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8366
diff
changeset
|
1830 | print("\nVersion Information") |
41a27cbdb5c1
install.py: modified the version display slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8366
diff
changeset
|
1831 | print("-------------------") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1832 | |
8754
e7d63a5a2ae9
Corrected the last change a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8753
diff
changeset
|
1833 | print("Python: {0:d}.{1:d}.{2:d}".format(*sys.version_info[:3])) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1834 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1835 | # check version of Qt |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1836 | # =================== |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1837 | qtMajor = int(qVersion().split(".")[0]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1838 | qtMinor = int(qVersion().split(".")[1]) |
8386
41a27cbdb5c1
install.py: modified the version display slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8366
diff
changeset
|
1839 | print("Qt6: {0}".format(qVersion().strip())) |
10788
c14f37a9aa74
Corrected a message in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10781
diff
changeset
|
1840 | if qtMajor == 6 and qtMinor < 2: |
c14f37a9aa74
Corrected a message in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10781
diff
changeset
|
1841 | print("Sorry, you must have Qt version 6.2.0 or better.") |
390
daa7c6ae6248
Change install script to always keep it open on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
386
diff
changeset
|
1842 | exit(2) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1843 | |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
1844 | # check version of sip |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1845 | # ==================== |
8243
cc717c2ae956
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8240
diff
changeset
|
1846 | with contextlib.suppress(ImportError, AttributeError): |
6364
6a496f0886ad
Prepared the "import sip" statements for PyQt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6360
diff
changeset
|
1847 | try: |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
1848 | from PyQt6 import sip # noqa: I101, I102 |
6364
6a496f0886ad
Prepared the "import sip" statements for PyQt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6360
diff
changeset
|
1849 | except ImportError: |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
1850 | import sip # noqa: I101, I102 |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1851 | print("sip:", sip.SIP_VERSION_STR.strip()) |
4889
10cec9d5aa91
Fixed an issue in the install script caused by the new PyQt naming scheme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4830
diff
changeset
|
1852 | # always assume, that snapshots or dev versions are new enough |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1853 | if "snapshot" not in sip.SIP_VERSION_STR and "dev" not in sip.SIP_VERSION_STR: |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1854 | if sip.SIP_VERSION < requiredVersions["sip"]: |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1855 | print( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1856 | "Sorry, you must have sip {0} or higher or" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1857 | " a recent development release.".format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1858 | versionToStr(requiredVersions["sip"]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1859 | ) |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1860 | ) |
3628
deb5973080a9
Added code to prevent possible segfaults when closing down.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
1861 | exit(3) |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1862 | # check for blocklisted versions |
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1863 | for vers in BlockLists["sip"] + PlatformBlockLists["sip"]: |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1864 | if vers == sip.SIP_VERSION: |
2992
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
1865 | print( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1866 | "Sorry, sip version {0} is not compatible with eric.".format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1867 | versionToStr(vers) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1868 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1869 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1870 | print("Please install another version.") |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
1871 | exit(3) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1872 | |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1873 | # check version of PyQt6 |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1874 | # ====================== |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
1875 | from PyQt6.QtCore import PYQT_VERSION, PYQT_VERSION_STR # noqa: I101, I102 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1876 | |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1877 | print("PyQt6:", PYQT_VERSION_STR.strip()) |
4889
10cec9d5aa91
Fixed an issue in the install script caused by the new PyQt naming scheme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4830
diff
changeset
|
1878 | # always assume, that snapshots or dev versions are new enough |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1879 | if "snapshot" not in PYQT_VERSION_STR and "dev" not in PYQT_VERSION_STR: |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1880 | if PYQT_VERSION < requiredVersions["pyqt6"]: |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1881 | print( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1882 | "Sorry, you must have PyQt {0} or better or" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1883 | " a recent development release.".format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1884 | versionToStr(requiredVersions["pyqt6"]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1885 | ) |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1886 | ) |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
1887 | exit(4) |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1888 | # check for blocklisted versions |
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1889 | for vers in BlockLists["PyQt6"] + PlatformBlockLists["PyQt6"]: |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1890 | if vers == PYQT_VERSION: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1891 | print( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1892 | "Sorry, PyQt version {0} is not compatible with eric.".format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1893 | versionToStr(vers) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1894 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1895 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1896 | print("Please install another version.") |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
1897 | exit(4) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1898 | |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
1899 | # check version of QScintilla |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1900 | # =========================== |
10046
35b27af462ef
Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10042
diff
changeset
|
1901 | from PyQt6.Qsci import ( # noqa: I101, I102 |
35b27af462ef
Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10042
diff
changeset
|
1902 | QSCINTILLA_VERSION, |
35b27af462ef
Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10042
diff
changeset
|
1903 | QSCINTILLA_VERSION_STR, |
35b27af462ef
Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10042
diff
changeset
|
1904 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1905 | |
8386
41a27cbdb5c1
install.py: modified the version display slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8366
diff
changeset
|
1906 | print("PyQt6-QScintilla:", QSCINTILLA_VERSION_STR.strip()) |
4889
10cec9d5aa91
Fixed an issue in the install script caused by the new PyQt naming scheme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4830
diff
changeset
|
1907 | # always assume, that snapshots or dev versions are new enough |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1908 | if "snapshot" not in QSCINTILLA_VERSION_STR and "dev" not in QSCINTILLA_VERSION_STR: |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1909 | if QSCINTILLA_VERSION < requiredVersions["pyqt6-qscintilla"]: |
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1910 | print( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1911 | "Sorry, you must have PyQt6-QScintilla {0} or higher or" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1912 | " a recent development release.".format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1913 | versionToStr(requiredVersions["pyqt6-qscintilla"]) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1914 | ) |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1915 | ) |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
1916 | exit(5) |
10503
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1917 | # check for blocklisted versions |
6a37b6ac3928
Renamed some modules/variables/settings to get rid (mostly) of inappropriate words.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10496
diff
changeset
|
1918 | for vers in BlockLists["QScintilla2"] + PlatformBlockLists["QScintilla2"]: |
8440
f71f33c0d47a
Streamline the install script a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8430
diff
changeset
|
1919 | if vers == QSCINTILLA_VERSION: |
2992
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
1920 | print( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1921 | "Sorry, QScintilla2 version {0} is not compatible with" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1922 | " eric.".format(versionToStr(vers)) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1923 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1924 | print("Please install another version.") |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
1925 | exit(5) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1926 | |
7329
72f3c9fdefeb
Added some code to show the version info for PyQtChart and PyQtWebEngine, if this is available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7302
diff
changeset
|
1927 | # print version info for additional modules |
8243
cc717c2ae956
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8240
diff
changeset
|
1928 | with contextlib.suppress(NameError, AttributeError): |
10331
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1929 | from PyQt6.QtCharts import PYQT_CHART_VERSION_STR # noqa: I101, I102 |
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1930 | |
c1a2ff7e3575
Modernized some code and corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10300
diff
changeset
|
1931 | print("PyQt6-Charts:", PYQT_CHART_VERSION_STR) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1932 | |
8243
cc717c2ae956
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8240
diff
changeset
|
1933 | with contextlib.suppress(ImportError, AttributeError): |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
1934 | from PyQt6 import QtWebEngineCore # noqa: I101, I102 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1935 | |
8553
10d31e5ce9e5
First batch of changes for QtWebEngine as of Qt 6.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8548
diff
changeset
|
1936 | print("PyQt6-WebEngine:", QtWebEngineCore.PYQT_WEBENGINE_VERSION_STR) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1937 | |
8388
f864abd11a5b
install.py: beautified the output a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8387
diff
changeset
|
1938 | print() |
12
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
1939 | print("All dependencies ok.") |
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
1940 | print() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1941 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
1942 | |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1943 | def prepareInfoFile(fileName): |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1944 | """ |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1945 | Function to prepare an Info.py file when installing from source. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1946 | |
10420
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
1947 | @param fileName name of the Python file containing the info |
5ac83a87954d
Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
1948 | @type str |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1949 | """ |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1950 | if not fileName: |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1951 | return |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1952 | |
8240
93b8a353c4bf
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8214
diff
changeset
|
1953 | with contextlib.suppress(OSError): |
4307
6a8ec996a49c
Little enhancement of the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4239
diff
changeset
|
1954 | os.rename(fileName, fileName + ".orig") |
8522
4f263b89a293
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8501
diff
changeset
|
1955 | localHg = ( |
9420
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
1956 | os.path.join(sysconfig.get_path("scripts"), "hg.exe") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1957 | if sys.platform.startswith(("win", "cygwin")) |
9420
92810aebc909
Changed the code to use sysconfig.get_path("scripts") wherever possible.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9402
diff
changeset
|
1958 | else os.path.join(sysconfig.get_path("scripts"), "hg") |
8522
4f263b89a293
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8501
diff
changeset
|
1959 | ) |
8475
f1f7646e8e24
Updated the install script to use a environment specific mercurial if that is available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8458
diff
changeset
|
1960 | for hg in (localHg, "hg"): |
f1f7646e8e24
Updated the install script to use a environment specific mercurial if that is available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8458
diff
changeset
|
1961 | with contextlib.suppress(OSError, subprocess.CalledProcessError): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1962 | hgOut = subprocess.run( # secok |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1963 | [hg, "identify", "-i"], check=True, capture_output=True, text=True |
8966
c6f67dbc6ee7
Changed calls to subprocess.call() and subprocess.check_output() to use subprocess.run().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8918
diff
changeset
|
1964 | ).stdout |
8475
f1f7646e8e24
Updated the install script to use a environment specific mercurial if that is available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8458
diff
changeset
|
1965 | if hgOut: |
f1f7646e8e24
Updated the install script to use a environment specific mercurial if that is available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8458
diff
changeset
|
1966 | break |
f1f7646e8e24
Updated the install script to use a environment specific mercurial if that is available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8458
diff
changeset
|
1967 | else: |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1968 | hgOut = "" |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1969 | if hgOut: |
4239
4883661fc427
Little improvement to the recent install.py change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4238
diff
changeset
|
1970 | hgOut = hgOut.strip() |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1971 | if hgOut.endswith("+"): |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1972 | hgOut = hgOut[:-1] |
7785
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
1973 | with open(fileName + ".orig", "r", encoding="utf-8") as f: |
9978016560ec
Changed code to use context manager 'open()' for file operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7775
diff
changeset
|
1974 | text = f.read() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1975 | text = text.replace("@@REVISION@@", hgOut).replace( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1976 | "@@VERSION@@", "rev_" + hgOut |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
1977 | ) |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1978 | copyToFile(fileName, text) |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1979 | else: |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1980 | shutil.copy(fileName + ".orig", fileName) |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1981 | |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
1982 | |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1983 | def getWinregEntry(name, path): |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1984 | """ |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1985 | Function to get an entry from the Windows Registry. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1986 | |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1987 | @param name variable name |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1988 | @type str |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1989 | @param path registry path of the variable |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1990 | @type str |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1991 | @return value of requested registry variable |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10403
diff
changeset
|
1992 | @rtype Any |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1993 | """ |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1994 | try: |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
1995 | import winreg # noqa: I101, I103 |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
1996 | except ImportError: |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
1997 | return None |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
1998 | |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
1999 | try: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2000 | registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path, 0, winreg.KEY_READ) |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2001 | value, _ = winreg.QueryValueEx(registryKey, name) |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2002 | winreg.CloseKey(registryKey) |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2003 | return value |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2004 | except WindowsError: |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2005 | return None |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2006 | |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2007 | |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2008 | def createWindowsShortcut(linkPath, targetPath, iconPath): |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2009 | """ |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2010 | Create Windows shortcut. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2011 | |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2012 | @param linkPath path of the shortcut file |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2013 | @type str |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2014 | @param targetPath path the shortcut shall point to |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2015 | @type str |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2016 | @param iconPath path of the icon file |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2017 | @type str |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2018 | """ |
10886
e46fcabe7a3f
Added code to the install script to work around some weirdness of the pywin32 package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10868
diff
changeset
|
2019 | # replicate stuff done in pywin32.pth - needed only here |
e46fcabe7a3f
Added code to the install script to work around some weirdness of the pywin32 package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10868
diff
changeset
|
2020 | import pywin32_bootstrap # noqa |
e46fcabe7a3f
Added code to the install script to work around some weirdness of the pywin32 package.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10868
diff
changeset
|
2021 | |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
2022 | from pywintypes import com_error # noqa: I102 |
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
2023 | from win32com.client import Dispatch # noqa: I102 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2024 | |
8243
cc717c2ae956
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8240
diff
changeset
|
2025 | with contextlib.suppress(com_error): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2026 | shell = Dispatch("WScript.Shell") |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2027 | shortcut = shell.CreateShortCut(linkPath) |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2028 | shortcut.Targetpath = targetPath |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2029 | shortcut.WorkingDirectory = os.path.dirname(targetPath) |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2030 | shortcut.IconLocation = iconPath |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2031 | shortcut.save() |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2032 | |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2033 | |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2034 | def windowsDesktopNames(clean=False): |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2035 | """ |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2036 | Function to generate the link names for the Windows Desktop. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2037 | |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2038 | @param clean flag indicating to get the desktop names for a cleanup operation |
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2039 | @type bool |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2040 | @return list of desktop link names |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2041 | @rtype list of str |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2042 | """ |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2043 | return [e[0] for e in windowsDesktopEntries(clean=clean)] |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2044 | |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2045 | |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2046 | def windowsDesktopEntries(clean=False): |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2047 | """ |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2048 | Function to generate data for the Windows Desktop links. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2049 | |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2050 | @param clean flag indicating to get the desktop entries for a cleanup operation |
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2051 | @type bool |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2052 | @return list of tuples containing the desktop link name, |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2053 | the link target and the icon target |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2054 | @rtype list of tuples of (str, str, str) |
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2055 | """ |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7185
diff
changeset
|
2056 | global cfg |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2057 | |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2058 | majorVersion, minorVersion = sys.version_info[:2] |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2059 | entriesTemplates = [ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2060 | ( |
9377 | 2061 | "eric7 IDE (Python {0}.{1}).lnk", |
2062 | os.path.join(cfg["bindir"], "eric7_ide.cmd"), | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2063 | os.path.join(cfg["ericPixDir"], "eric7.ico"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2064 | ), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2065 | ( |
10518 | 2066 | "eric7 MicroPython (Python {0}.{1}).lnk", |
2067 | os.path.join(cfg["bindir"], "eric7_mpy.cmd"), | |
2068 | os.path.join(cfg["ericPixDir"], "ericMPy48.ico"), | |
2069 | ), | |
2070 | ( | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2071 | "eric7 Browser (Python {0}.{1}).lnk", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2072 | os.path.join(cfg["bindir"], "eric7_browser.cmd"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2073 | os.path.join(cfg["ericPixDir"], "ericWeb48.ico"), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2074 | ), |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2075 | ] |
9402
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2076 | |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2077 | if clean: |
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2078 | # clean obsolete entries as well |
9402
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2079 | entriesTemplates.extend( |
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2080 | [ |
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2081 | ( |
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2082 | "eric7 (Python {0}.{1}).lnk", |
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2083 | os.path.join(cfg["bindir"], "eric7_ide.cmd"), |
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2084 | os.path.join(cfg["ericPixDir"], "eric7.ico"), |
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2085 | ), |
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2086 | ] |
f5d9aa5c62db
Reformatted the code with the black tool.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9401
diff
changeset
|
2087 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2088 | |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2089 | return [ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2090 | (e[0].format(majorVersion, minorVersion), e[1], e[2]) for e in entriesTemplates |
6510
d8fd663f86ef
install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6509
diff
changeset
|
2091 | ] |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2092 | |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2093 | |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2094 | def windowsProgramsEntry(): |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2095 | """ |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2096 | Function to generate the name of the Start Menu top entry. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2097 | |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2098 | @return name of the Start Menu top entry |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2099 | @rtype str |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2100 | """ |
7203
2079ccbfa335
install, uninstall scripts: re-added the removal of the obsolete eric6_webbrowser stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7192
diff
changeset
|
2101 | majorVersion, minorVersion = sys.version_info[:2] |
9380
3d662dda80e8
Fixed some issues installing eric7 on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9378
diff
changeset
|
2102 | return "eric7 (Python {0}.{1})".format(majorVersion, minorVersion) |
6509
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2103 | |
884182bfd25c
install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6500
diff
changeset
|
2104 | |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2105 | def createArgumentParser(): |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2106 | """ |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2107 | Function to create an argument parser. |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2108 | |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2109 | @return created argument parser object |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2110 | @rtype argparse.ArgumentParser |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2111 | """ |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2112 | parser = argparse.ArgumentParser( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2113 | description="Install eric7 from the source code tree.", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2114 | epilog="The file given to the -f option must be valid Python code defining a" |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2115 | " dictionary called 'cfg' with the keys 'ericDir', 'ericPixDir', ericIconDir'," |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2116 | " 'ericDTDDir', 'ericCSSDir', 'ericStylesDir', 'ericThemesDir', ericDocDir'," |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2117 | " ericExamplesDir', ericTranslationsDir', 'ericTemplatesDir'," |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2118 | " 'ericCodeTemplatesDir', ericOthersDir','bindir', 'mdir' and 'apidir." |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2119 | " These define the directories for the installation of the various parts of" |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2120 | " eric.", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2121 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2122 | |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2123 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2124 | "-a", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2125 | metavar="dir", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2126 | default=apisDir if apisDir else None, |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2127 | help="directory where the API files will be installed ({0})".format( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2128 | "default: {0}".format(apisDir) if apisDir else "no default value" |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2129 | ), |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2130 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2131 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2132 | "--no-apis", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2133 | action="store_true", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2134 | help="don't install API files", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2135 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2136 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2137 | "-b", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2138 | metavar="dir", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2139 | default=platBinDir, |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2140 | help="directory where the binaries will be installed (default: {0})".format( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2141 | platBinDir |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2142 | ), |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2143 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2144 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2145 | "-d", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2146 | metavar="dir", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2147 | default=modDir, |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2148 | help="directory where eric Python files will be installed" |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2149 | " (default: {0})".format(modDir), |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2150 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2151 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2152 | "-f", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2153 | metavar="file", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2154 | help="configuration file naming the various installation paths", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2155 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2156 | if not sys.platform.startswith(("win", "cygwin")): |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2157 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2158 | "-i", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2159 | metavar="dir", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2160 | default=distDir, |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2161 | help="temporary install prefix (default: {0})".format(distDir), |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2162 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2163 | if sys.platform == "darwin": |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2164 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2165 | "-m", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2166 | metavar="name", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2167 | default=macAppBundleName, |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2168 | help="name of the Mac app bundle (default: {0})".format(macAppBundleName), |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2169 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2170 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2171 | "-n", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2172 | metavar="path", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2173 | default=macAppBundlePath, |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2174 | help="path of the directory the Mac app bundle will be created in" |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2175 | " (default: {0})".format(macAppBundlePath), |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2176 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2177 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2178 | "-p", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2179 | metavar="python", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2180 | default=macPythonExe, |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2181 | help="path of the python executable (default: {0})".format(macPythonExe), |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2182 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2183 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2184 | "-c", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2185 | action="store_false", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2186 | help="don't cleanup old installation first", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2187 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2188 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2189 | "-v", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2190 | "--verbose", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2191 | action="store_true", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2192 | help="print some more information", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2193 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2194 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2195 | "-x", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2196 | action="store_false", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2197 | help="don't perform dependency checks (use on your own risk)", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2198 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2199 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2200 | "-z", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2201 | action="store_false", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2202 | help="don't compile the installed python files", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2203 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2204 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2205 | "--yes", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2206 | action="store_true", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2207 | help="answer 'yes' to all questions", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2208 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2209 | if sys.platform.startswith(("win", "cygwin")): |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2210 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2211 | "--clean-desktop", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2212 | action="store_true", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2213 | help="delete desktop links before installation", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2214 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2215 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2216 | "--no-info", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2217 | action="store_true", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2218 | help="don't create the install info file", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2219 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2220 | parser.add_argument( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2221 | "--with-tools", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2222 | action="store_true", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2223 | help="install the 'qt6-applications' package", |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2224 | ) |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2225 | parser.add_argument( |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2226 | "--proxy", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2227 | default=None, |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2228 | metavar="url", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2229 | help="HTTP proxy url will be used with pip (default: no proxy used)", |
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2230 | ) |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2231 | |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2232 | return parser |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2233 | |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2234 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2235 | def main(argv): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2236 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2237 | The main function of the script. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2238 | |
6594
7ecac3b1c7aa
install: second attempt to cope with tricks done by pywin32 at interpreter startup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6593
diff
changeset
|
2239 | @param argv list of command line arguments |
7ecac3b1c7aa
install: second attempt to cope with tricks done by pywin32 at interpreter startup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6593
diff
changeset
|
2240 | @type list of str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2241 | """ |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2242 | global modDir, doCleanup, doCompile, distDir, cfg, apisDir |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2243 | global sourceDir, eric7SourceDir, configName, platBinDir |
3507
b09e10d4f343
Changed the install script to accept a '-n' option to set the name of the directory where the Mac application bundle should be created in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3468
diff
changeset
|
2244 | global macAppBundlePath, macAppBundleName, macPythonExe |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2245 | global installApis, doCleanDesktopLinks, yes2All, proxy |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
2246 | global createInstallInfoFile, installCwd |
9356
803a7a85b071
Changed the install script to only install the qt6-applications package if requested explicitly (--with-tools).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9347
diff
changeset
|
2247 | global withPyqt6Tools |
8656
8fbaa183c41e
Added the --verbose (-v) option to the install script to show a bit more output.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8654
diff
changeset
|
2248 | global verbose |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2249 | |
11022
95c889f18a21
Dropped support for Python 3.8 because that version is EOL.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10998
diff
changeset
|
2250 | if sys.version_info < (3, 9, 0) or sys.version_info > (3, 99, 99): |
95c889f18a21
Dropped support for Python 3.8 because that version is EOL.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10998
diff
changeset
|
2251 | print("Sorry, eric requires at least Python 3.9 for running.") |
2690
8ca13f15e1f2
Added a check to the install script to guard against an execution with a Python2 interpreter.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2634
diff
changeset
|
2252 | exit(5) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2253 | |
7813
5d0dbec7b815
Main Window: added code to update the saved install information after an update.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7812
diff
changeset
|
2254 | installCwd = os.getcwd() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2255 | |
1662
dadf3f4ee800
Fixed an issue in the install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1658
diff
changeset
|
2256 | if os.path.dirname(argv[0]): |
1965
96f5a76e1845
Fixed some PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1914
diff
changeset
|
2257 | os.chdir(os.path.dirname(argv[0])) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2258 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2259 | initGlobals() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2260 | |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2261 | parser = createArgumentParser() |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2262 | args = parser.parse_args() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2263 | |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2264 | apisDir = args.a |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2265 | platBinDir = args.b |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2266 | modDir = args.d |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2267 | depChecks = args.x |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2268 | doCleanup = args.c |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2269 | doCompile = args.z |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2270 | installApis = not args.no_apis |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2271 | yes2All = args.yes |
10801
5859861e7a1f
Extended the install scripts to allow the configuration of a proxy URL for the pip command (see issue (see issue 563).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10788
diff
changeset
|
2272 | proxy = args.proxy |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2273 | withPyqt6Tools = args.with_tools |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2274 | createInstallInfoFile = not args.no_info |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2275 | verbose = args.verbose |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2276 | if sys.platform == "darwin": |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2277 | macAppBundleName = args.m |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2278 | macAppBundlePath = args.n |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2279 | macPythonExe = args.p |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2280 | if sys.platform.startswith(("win", "cygwin")): |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2281 | doCleanDesktopLinks = args.clean_desktop |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2282 | else: |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2283 | if args.i: |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2284 | distDir = os.path.normpath(args.i) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2285 | if args.f: |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2286 | with open(args.f) as f: |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2287 | try: |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2288 | exec(compile(f.read(), args.f, "exec"), globals()) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2289 | # secok |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2290 | if len(cfg) != configLength: |
9679
22314ef6d754
Changed the install script to output a descriptive message when an invalid configuration file is given using the -f option.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9674
diff
changeset
|
2291 | print( |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2292 | "The configuration dictionary in '{0}' is" |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2293 | " incorrect. Aborting".format(args.f) |
9679
22314ef6d754
Changed the install script to output a descriptive message when an invalid configuration file is given using the -f option.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9674
diff
changeset
|
2294 | ) |
10300
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2295 | exit(6) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2296 | except Exception as exc: |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2297 | print( |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2298 | "The configuration file '{0}' is not valid Python source." |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2299 | " It will be ignored. Installation will be performed with" |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2300 | " defaults.".format(args.f) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2301 | ) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2302 | print("ERROR: {0}".format(str(exc))) |
60e8f2175b3b
Changed the install and uninstall scripts to use 'argparse' instead of 'getopt'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10264
diff
changeset
|
2303 | cfg = {} |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2304 | |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2305 | infoName = "" |
622
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
2306 | installFromSource = not os.path.isdir(sourceDir) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2307 | |
6641
42de1c3e8777
install: moved the dependencies check earlier in the installiation order.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6640
diff
changeset
|
2308 | # check dependencies |
42de1c3e8777
install: moved the dependencies check earlier in the installiation order.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6640
diff
changeset
|
2309 | if depChecks: |
42de1c3e8777
install: moved the dependencies check earlier in the installiation order.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6640
diff
changeset
|
2310 | doDependancyChecks() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2311 | |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
2312 | if installFromSource: |
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
2313 | sourceDir = os.path.abspath("..") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2314 | |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
2315 | eric7SourceDir = ( |
9231
d92a18dffa5e
Slight modificytion to the install script to handle cleanup a bit better.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
2316 | os.path.join(sourceDir, "src", "eric7") |
d92a18dffa5e
Slight modificytion to the install script to handle cleanup a bit better.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
2317 | if os.path.exists(os.path.join(sourceDir, "src", "eric7")) |
d92a18dffa5e
Slight modificytion to the install script to handle cleanup a bit better.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
2318 | else os.path.join(sourceDir, "eric7") |
9209
b99e7fd55fd3
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9175
diff
changeset
|
2319 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2320 | |
6638
df711aa509d3
install: moved the source cleanup routine to avoid deleting saved Info.py and eric6config.py files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6637
diff
changeset
|
2321 | # cleanup source if installing from source |
df711aa509d3
install: moved the source cleanup routine to avoid deleting saved Info.py and eric6config.py files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6637
diff
changeset
|
2322 | if installFromSource: |
9694
90a7081e2837
Updated the various scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9690
diff
changeset
|
2323 | print("Cleaning up source ...", end="", flush=True) |
9231
d92a18dffa5e
Slight modificytion to the install script to handle cleanup a bit better.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
2324 | cleanupSource(sourceDir) |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2325 | print(" Done") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2326 | |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
2327 | configName = os.path.join(eric7SourceDir, "eric7config.py") |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2328 | if os.path.exists(os.path.join(sourceDir, ".hg")): |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2329 | # we are installing from source with repo |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
2330 | infoName = os.path.join(eric7SourceDir, "UI", "Info.py") |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2331 | prepareInfoFile(infoName) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2332 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2333 | if len(cfg) == 0: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2334 | createInstallConfig() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2335 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2336 | # get rid of development config file, if it exists |
8243
cc717c2ae956
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8240
diff
changeset
|
2337 | with contextlib.suppress(OSError): |
622
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
2338 | if installFromSource: |
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
2339 | os.rename(configName, configName + ".orig") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2340 | configNameC = configName + "c" |
626
41e79c291eff
Fixed another bug in the modified install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
625
diff
changeset
|
2341 | if os.path.exists(configNameC): |
41e79c291eff
Fixed another bug in the modified install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
625
diff
changeset
|
2342 | os.remove(configNameC) |
622
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
2343 | os.remove(configName) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2344 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2345 | # cleanup old installation |
9694
90a7081e2837
Updated the various scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9690
diff
changeset
|
2346 | print("Cleaning up old installation ...", end="", flush=True) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2347 | try: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2348 | if doCleanup: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2349 | if distDir: |
10403
ea3320d5e8e9
Changed code using "shutil.rmtree()" more readable by adding "ignore_errors=" where this parameter is non-default.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
2350 | shutil.rmtree(distDir, ignore_errors=True) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2351 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2352 | cleanUp() |
7836
2f0d208b8137
Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7835
diff
changeset
|
2353 | except OSError as msg: |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2354 | sys.stderr.write("\nError: {0}\nTry install as root.\n".format(msg)) |
2421
d3bf4def72d7
Correct the last change.
"Detlev Offenbach <detlev@die-offenbachs.de>"
parents:
2420
diff
changeset
|
2355 | exit(7) |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2356 | print(" Done") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2357 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2358 | # Create a config file and delete the default one |
9694
90a7081e2837
Updated the various scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9690
diff
changeset
|
2359 | print("Creating configuration file ...", end="", flush=True) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2360 | createConfig() |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2361 | print(" Done") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2362 | |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2363 | # Create an install info file |
9694
90a7081e2837
Updated the various scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9690
diff
changeset
|
2364 | print("Creating an install info file ...", end="", flush=True) |
7804
1cbc27e34ec6
Implementing code to record and/or guess some information about the installation process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7799
diff
changeset
|
2365 | createInstallInfo() |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2366 | print(" Done") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2367 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2368 | if doCompile: |
9694
90a7081e2837
Updated the various scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9690
diff
changeset
|
2369 | print("Compiling source files ...", end="", flush=True) |
5180
9eba139a2756
Changed RegEx to be independent from Python version.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
5145
diff
changeset
|
2370 | skipRe = re.compile(r"DebugClients[\\/]Python[\\/]") |
2680
110ac646a3a0
Fixes for TabNanny and some code cleanup. Source doku regenerated.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2677
diff
changeset
|
2371 | sys.stdout = io.StringIO() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2372 | if distDir: |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
2373 | compileall.compile_dir( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
2374 | eric7SourceDir, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2375 | ddir=os.path.join(distDir, modDir, cfg["ericDir"]), |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4915
diff
changeset
|
2376 | rx=skipRe, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2377 | quiet=True, |
9732
3985549d7d36
Changed the install script to do parallel source code compilation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9727
diff
changeset
|
2378 | workers=0, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2379 | ) |
2992
dbdf27746da5
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2969
diff
changeset
|
2380 | py_compile.compile( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2381 | configName, dfile=os.path.join(distDir, modDir, "eric7config.py") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2382 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2383 | else: |
3022
57179e4cdadd
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
2384 | compileall.compile_dir( |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8310
diff
changeset
|
2385 | eric7SourceDir, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2386 | ddir=os.path.join(modDir, cfg["ericDir"]), |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4915
diff
changeset
|
2387 | rx=skipRe, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2388 | quiet=True, |
9732
3985549d7d36
Changed the install script to do parallel source code compilation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9727
diff
changeset
|
2389 | workers=0, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2390 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2391 | py_compile.compile(configName, dfile=os.path.join(modDir, "eric7config.py")) |
2680
110ac646a3a0
Fixes for TabNanny and some code cleanup. Source doku regenerated.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2677
diff
changeset
|
2392 | sys.stdout = sys.__stdout__ |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2393 | print(" Done") |
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2394 | |
9694
90a7081e2837
Updated the various scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9690
diff
changeset
|
2395 | print("Installing eric ...", end="", flush=True) |
2383
e999256385bd
Extended the installation routine by the creation of a desktop file for the eric5 web browser.
"Detlev Offenbach <detlev@die-offenbachs.de>"
parents:
2312
diff
changeset
|
2396 | res = installEric() |
9690
2dc33116df50
Debug Client - Python
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9680
diff
changeset
|
2397 | print(" Done") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2398 | |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
2399 | if createInstallInfoFile: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2400 | with open( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2401 | os.path.join(cfg["ericDir"], installInfoName), "w" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2402 | ) as installInfoFile: |
7921
0d429bd82699
install.py: added the '--no-info' flag to supress the generation of the install info file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7900
diff
changeset
|
2403 | json.dump(installInfo, installInfoFile, indent=2) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2404 | |
622
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
2405 | # do some cleanup |
8240
93b8a353c4bf
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8214
diff
changeset
|
2406 | with contextlib.suppress(OSError): |
622
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
2407 | if installFromSource: |
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
2408 | os.remove(configName) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2409 | configNameC = configName + "c" |
626
41e79c291eff
Fixed another bug in the modified install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
625
diff
changeset
|
2410 | if os.path.exists(configNameC): |
41e79c291eff
Fixed another bug in the modified install script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
625
diff
changeset
|
2411 | os.remove(configNameC) |
622
54c2a58acef4
Modified install script such, that it allows an installation from source as well. The situation will be determined automatically.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
620
diff
changeset
|
2412 | os.rename(configName + ".orig", configName) |
8240
93b8a353c4bf
Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8214
diff
changeset
|
2413 | with contextlib.suppress(OSError): |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2414 | if installFromSource and infoName: |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2415 | os.remove(infoName) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2416 | infoNameC = infoName + "c" |
4238
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2417 | if os.path.exists(infoNameC): |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2418 | os.remove(infoNameC) |
53bd830433dc
Changed the install script to include the Mercurial revision number when install from the sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4178
diff
changeset
|
2419 | os.rename(infoName + ".orig", infoName) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2420 | |
12
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
2421 | print("\nInstallation complete.") |
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
2422 | print() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2423 | |
2383
e999256385bd
Extended the installation routine by the creation of a desktop file for the eric5 web browser.
"Detlev Offenbach <detlev@die-offenbachs.de>"
parents:
2312
diff
changeset
|
2424 | exit(res) |
8988
ffa38e0415df
Added a script to install all of eric's dependencies.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8977
diff
changeset
|
2425 | |
ffa38e0415df
Added a script to install all of eric's dependencies.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8977
diff
changeset
|
2426 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2427 | if __name__ == "__main__": |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2428 | try: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2429 | main(sys.argv) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2430 | except SystemExit: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2431 | raise |
4563
881340f4bd0c
Fixed a few coding style issue related to 'blind except:' statements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4561
diff
changeset
|
2432 | except Exception: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2433 | print( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2434 | """An internal error occured. Please report all the output""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2435 | """ of the program,\nincluding the following traceback, to""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2436 | """ eric-bugs@eric-ide.python-projects.org.\n""" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9218
diff
changeset
|
2437 | ) |
565
21191e634b47
Added checks for blacklisted versions of sip, PyQt4 and QScintilla2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
564
diff
changeset
|
2438 | raise |
4566
a2e8f3c420ec
Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4563
diff
changeset
|
2439 | |
a2e8f3c420ec
Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4563
diff
changeset
|
2440 | # |
10042
ca636e8d80fd
Applied the new "noqa:" to the install.py script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9986
diff
changeset
|
2441 | # eflag: noqa = M801 |