300 |
300 |
301 @param src source file name (string) |
301 @param src source file name (string) |
302 @param dst destination file name (string) |
302 @param dst destination file name (string) |
303 @param marker marker to be used (string) |
303 @param marker marker to be used (string) |
304 """ |
304 """ |
|
305 global cfg |
|
306 |
305 if sys.version_info[0] == 2: |
307 if sys.version_info[0] == 2: |
306 f = codecs.open(src, "r", "utf-8") |
308 f = codecs.open(src, "r", "utf-8") |
307 else: |
309 else: |
308 f = open(src, "r", encoding="utf-8") |
310 f = open(src, "r", encoding="utf-8") |
309 text = f.read() |
311 text = f.read() |
310 f.close() |
312 f.close() |
311 |
313 |
|
314 text = text.replace("@BINDIR@", cfg['bindir']) |
312 text = text.replace("@MARKER@", marker) |
315 text = text.replace("@MARKER@", marker) |
313 if marker: |
316 if marker: |
314 t_marker = " ({0})".format(PythonTextMarkers[marker]) |
317 t_marker = " ({0})".format(PythonTextMarkers[marker]) |
315 else: |
318 else: |
316 t_marker = "" |
319 t_marker = "" |
961 "/usr/share/applications/eric6_browser" + marker + |
964 "/usr/share/applications/eric6_browser" + marker + |
962 ".desktop", |
965 ".desktop", |
963 marker) |
966 marker) |
964 elif os.getuid() >= 1000: |
967 elif os.getuid() >= 1000: |
965 # it is assumed, that user ids start at 1000 |
968 # it is assumed, that user ids start at 1000 |
966 localPath = os.path.join(os.path.expanduser("~"), ".local") |
969 localPath = os.path.join(os.path.expanduser("~"), |
|
970 ".local", "share") |
967 # create directories first |
971 # create directories first |
968 for directory in [os.path.join(localPath, name) |
972 for directory in [os.path.join(localPath, name) |
969 for name in ("pixmaps", "applications", |
973 for name in ("pixmaps", "applications", |
970 "metainfo", "appdata")]: |
974 "metainfo", "appdata")]: |
971 if not os.path.isdir(directory): |
975 if not os.path.isdir(directory): |