eric7/eric7_post_install.py

branch
eric7
changeset 8660
1848e8e4b380
parent 8634
2bbfaad44cbd
child 8881
54e42bc2437a
--- a/eric7/eric7_post_install.py	Sat Oct 02 15:35:19 2021 +0200
+++ b/eric7/eric7_post_install.py	Sun Oct 03 13:06:20 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 ["eric7.desktop", "eric7_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