eric6/eric6_post_install.py

changeset 8661
1dc0a266d5f5
parent 8243
cc717c2ae956
--- a/eric6/eric6_post_install.py	Fri Oct 01 17:08:37 2021 +0200
+++ b/eric6/eric6_post_install.py	Sun Oct 03 13:04:53 2021 +0200
@@ -157,6 +157,13 @@
         copyMetaFilesTree(os.path.join(srcDir, metaDir),
                           os.path.join(dstDir, metaDir))
     
+    copyMetaFile(os.path.join(srcDir, "icons", "eric48_icon.png"),
+                 os.path.join(dstDir, "icons", "hicolor", "48x48", "apps"),
+                 "eric.png")
+    copyMetaFile(os.path.join(srcDir, "icons", "ericWeb48_icon.png"),
+                 os.path.join(dstDir, "icons", "hicolor", "48x48", "apps"),
+                 "ericWeb.png")
+    
     for desktop in ["eric6.desktop", "eric6_browser.desktop"]:
         copyDesktopFile(
             os.path.join(srcDir, "applications", desktop),
@@ -190,6 +197,24 @@
             copyMetaFilesTree(srcname, dstname)
 
 
+def copyMetaFile(srcname, dstpath, dstname):
+    """
+    Function to copy a file to its destination.
+    
+    @param srcname name of the source file
+    @type str
+    @param dstpath name of the destination path
+    @type str
+    @param dstname name of the destination file (without path)
+    @type str
+    """
+    if not os.path.isdir(dstpath):
+        os.makedirs(dstpath)
+    dstname = os.path.join(dstpath, dstname)
+    shutil.copy2(srcname, dstname)
+    os.chmod(dstname, 0o644)
+
+
 def copyDesktopFile(src, dst, scriptsdir):
     """
     Modify a desktop file and write it to its destination.

eric ide

mercurial