install.py

branch
6_0_x
changeset 4055
53ca171d8f01
parent 4034
bcee35dbbce0
child 4173
10336d4d1488
equal deleted inserted replaced
4053:f6c63f2b5a1c 4055:53ca171d8f01
89 89
90 # Define file name markers for Python variants 90 # Define file name markers for Python variants
91 PythonMarkers = { 91 PythonMarkers = {
92 2: "_py2", 92 2: "_py2",
93 3: "_py3", 93 3: "_py3",
94 }
95 # Define a mapping of markers to full text
96 PythonTextMarkers = {
97 "_py2": "Python 2",
98 "_py3": "Python 3",
94 } 99 }
95 100
96 101
97 def exit(rcode=0): 102 def exit(rcode=0):
98 """ 103 """
276 f = open(src, "r", encoding="utf-8") 281 f = open(src, "r", encoding="utf-8")
277 text = f.read() 282 text = f.read()
278 f.close() 283 f.close()
279 284
280 text = text.replace("@MARKER@", marker) 285 text = text.replace("@MARKER@", marker)
286 if marker:
287 t_marker = " ({0})".format(PythonTextMarkers[marker])
288 else:
289 t_marker = ""
290 text = text.replace("@PY_MARKER@", t_marker)
281 291
282 if sys.version_info[0] == 2: 292 if sys.version_info[0] == 2:
283 f = codecs.open(dst, "w", "utf-8") 293 f = codecs.open(dst, "w", "utf-8")
284 else: 294 else:
285 f = open(dst, "w", encoding="utf-8") 295 f = open(dst, "w", encoding="utf-8")

eric ide

mercurial