scripts/create_windows_links.py

branch
without_py2_and_pyqt4
changeset 7192
a22eee00b052
parent 6942
2602857055c5
child 7229
53054eb5b15a
--- a/scripts/create_windows_links.py	Sat Aug 31 12:29:57 2019 +0200
+++ b/scripts/create_windows_links.py	Sat Aug 31 12:58:11 2019 +0200
@@ -16,14 +16,6 @@
 
 from eric6config import getConfig
 
-# Define file name markers for Python variants
-PythonMarkers = {
-    2: "_py2",
-    3: "_py3",
-}
-
-includePythonVariant = False
-
 
 def main(argv):
     """
@@ -32,11 +24,6 @@
     @param argv list of command line arguments
     @type list of str
     """
-    global includePythonVariant
-    
-    if "-y" in argv:
-        includePythonVariant = True
-    
     regPath = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" + \
               "\\User Shell Folders"
     
@@ -78,12 +65,9 @@
     @rtype any
     """
     try:
-        import _winreg as winreg
+        import winreg
     except ImportError:
-        try:
-            import winreg
-        except ImportError:
-            return None
+        return None
     
     try:
         registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path, 0,
@@ -139,33 +123,15 @@
         the link target and the icon target
     @rtype list of tuples of (str, str, str)
     """
-    global includePythonVariant
-    
-    if includePythonVariant:
-        marker = PythonMarkers[sys.version_info.major]
-    else:
-        marker = ""
-    
     majorVersion, minorVersion = sys.version_info[:2]
     entriesTemplates = [
         ("eric6 (Python {0}.{1}).lnk",
-         os.path.join(getConfig("bindir"), "eric6" + marker + ".cmd"),
+         os.path.join(getConfig("bindir"), "eric6.cmd"),
          os.path.join(getConfig("ericPixDir"), "eric6.ico")),
+        ("eric6 Browser (Python {0}.{1}).lnk",
+         os.path.join(getConfig("bindir"), "eric6_browser.cmd"),
+         os.path.join(getConfig("ericPixDir"), "ericWeb48.ico")),
     ]
-    if sys.version_info.major == 2:
-        entriesTemplates.append((
-            "eric6 Browser (Python {0}.{1}).lnk",
-            os.path.join(getConfig("bindir"),
-                         "eric6_webbrowser" + marker + ".cmd"),
-            os.path.join(getConfig("ericPixDir"), "ericWeb48.ico")
-        ))
-    else:
-        entriesTemplates.append((
-            "eric6 Browser (Python {0}.{1}).lnk",
-            os.path.join(getConfig("bindir"),
-                         "eric6_browser" + marker + ".cmd"),
-            os.path.join(getConfig("ericPixDir"), "ericWeb48.ico")
-        ))
     
     return [
         (e[0].format(majorVersion, minorVersion), e[1], e[2])

eric ide

mercurial