eric7/eric7_post_install.py

branch
eric7
changeset 8660
1848e8e4b380
parent 8634
2bbfaad44cbd
child 8881
54e42bc2437a
equal deleted inserted replaced
8659:0e58d3367e92 8660:1848e8e4b380
155 155
156 for metaDir in ["icons", "appdata", "metainfo"]: 156 for metaDir in ["icons", "appdata", "metainfo"]:
157 copyMetaFilesTree(os.path.join(srcDir, metaDir), 157 copyMetaFilesTree(os.path.join(srcDir, metaDir),
158 os.path.join(dstDir, metaDir)) 158 os.path.join(dstDir, metaDir))
159 159
160 copyMetaFile(os.path.join(srcDir, "icons", "eric48_icon.png"),
161 os.path.join(dstDir, "icons", "hicolor", "48x48", "apps"),
162 "eric.png")
163 copyMetaFile(os.path.join(srcDir, "icons", "ericWeb48_icon.png"),
164 os.path.join(dstDir, "icons", "hicolor", "48x48", "apps"),
165 "ericWeb.png")
166
160 for desktop in ["eric7.desktop", "eric7_browser.desktop"]: 167 for desktop in ["eric7.desktop", "eric7_browser.desktop"]:
161 copyDesktopFile( 168 copyDesktopFile(
162 os.path.join(srcDir, "applications", desktop), 169 os.path.join(srcDir, "applications", desktop),
163 os.path.join(dstDir, "applications", desktop), 170 os.path.join(dstDir, "applications", desktop),
164 scriptsDir 171 scriptsDir
188 195
189 if os.path.isdir(srcname): 196 if os.path.isdir(srcname):
190 copyMetaFilesTree(srcname, dstname) 197 copyMetaFilesTree(srcname, dstname)
191 198
192 199
200 def copyMetaFile(srcname, dstpath, dstname):
201 """
202 Function to copy a file to its destination.
203
204 @param srcname name of the source file
205 @type str
206 @param dstpath name of the destination path
207 @type str
208 @param dstname name of the destination file (without path)
209 @type str
210 """
211 if not os.path.isdir(dstpath):
212 os.makedirs(dstpath)
213 dstname = os.path.join(dstpath, dstname)
214 shutil.copy2(srcname, dstname)
215 os.chmod(dstname, 0o644)
216
217
193 def copyDesktopFile(src, dst, scriptsdir): 218 def copyDesktopFile(src, dst, scriptsdir):
194 """ 219 """
195 Modify a desktop file and write it to its destination. 220 Modify a desktop file and write it to its destination.
196 221
197 @param src source file name (string) 222 @param src source file name (string)

eric ide

mercurial