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 |
305 global cfg, platBinDir |
306 |
306 |
307 if sys.version_info[0] == 2: |
307 if sys.version_info[0] == 2: |
308 f = codecs.open(src, "r", "utf-8") |
308 f = codecs.open(src, "r", "utf-8") |
309 else: |
309 else: |
310 f = open(src, "r", encoding="utf-8") |
310 f = open(src, "r", encoding="utf-8") |
311 text = f.read() |
311 text = f.read() |
312 f.close() |
312 f.close() |
313 |
313 |
314 text = text.replace("@BINDIR@", cfg['bindir']) |
314 text = text.replace("@BINDIR@", platBinDir) |
315 text = text.replace("@MARKER@", marker) |
315 text = text.replace("@MARKER@", marker) |
316 if marker: |
316 if marker: |
317 t_marker = " ({0})".format(PythonTextMarkers[marker]) |
317 t_marker = " ({0})".format(PythonTextMarkers[marker]) |
318 else: |
318 else: |
319 t_marker = "" |
319 t_marker = "" |