520 lines
No EOL
20 KiB
Python
520 lines
No EOL
20 KiB
Python
if "v2" in param:
|
|
print("V2 ignore")
|
|
else:
|
|
|
|
#print("params=" + param)
|
|
#print( "dir= " + directory_to_process + "/page_catalog_group_recommend.xml");
|
|
file_recommend = open(directory_to_process + "/page_catalog_group_recommend.xml", 'r')
|
|
content_recommend = file_recommend.read()
|
|
|
|
file_recommend_double_pro = open(directory_to_process + "/page_catalog_group_recommend_double_pro.xml", "r")
|
|
content_recommend_double_pro = file_recommend_double_pro.read()
|
|
|
|
file_recommend_triple_pro = open(directory_to_process + "/page_catalog_group_recommend_triple_pro.xml", "r")
|
|
content_recommend_triple_pro = file_recommend_triple_pro.read()
|
|
#print(file_xml.read())
|
|
# ; include-file=dummy_layout.inc
|
|
# file_inc = open(directory_to_process + "/dummy_layout.inc", 'r')
|
|
# file_inc_content = file_inc.read()
|
|
|
|
|
|
file_recommend.close()
|
|
file_recommend_double_pro.close()
|
|
if "template1" in param:
|
|
|
|
file_inc1 = open(directory_to_process + "/event/promotion_template1.inc", 'r')
|
|
file_inc1_content = file_inc1.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_template1", 'r')
|
|
file_inc1_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc1_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc1_content = file_inc1_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/promotion_onclick1.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc1_content = file_inc1_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
#print(file_inc2_content)
|
|
|
|
#print( file_inc_content)
|
|
file_inc = open(directory_to_process + "/dummy_layout.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc1_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp2 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp2=" + tmp2)
|
|
|
|
content_data = tmp1 + tmp2
|
|
|
|
file_xml3_out = open(directory_to_process + "/event/out_put_file1.txt", 'r')
|
|
file_xml3_out_content = file_xml3_out.read()
|
|
file_xml3_out_content = file_xml3_out_content.strip()
|
|
file_xml3_out_content = file_xml3_out_content.replace("\r", "")
|
|
file_xml3_out_content = file_xml3_out_content.replace("\n", "")
|
|
|
|
file_xml3 = open(directory_to_process + file_xml3_out_content, 'w')
|
|
file_xml3.write( content_data)
|
|
file_xml3.close()
|
|
|
|
if "template2" in param:
|
|
|
|
file_inc2 = open(directory_to_process + "/event/promotion_template2.inc", 'r')
|
|
file_inc2_content = file_inc2.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_template2", 'r')
|
|
file_inc2_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc2_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc2_content = file_inc2_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/promotion_onclick2.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc2_content = file_inc2_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
#print(file_inc2_content)
|
|
|
|
#print( file_inc_content)
|
|
file_inc = open(directory_to_process + "/dummy_layout.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc2_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp2 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp2=" + tmp2)
|
|
|
|
content_data = tmp1 + tmp2
|
|
|
|
file_xml3_out = open(directory_to_process + "/event/out_put_file2.txt", 'r')
|
|
file_xml3_out_content = file_xml3_out.read()
|
|
file_xml3_out_content = file_xml3_out_content.strip()
|
|
file_xml3_out_content = file_xml3_out_content.replace("\r", "")
|
|
file_xml3_out_content = file_xml3_out_content.replace("\n", "")
|
|
|
|
file_xml3 = open(directory_to_process + file_xml3_out_content, 'w')
|
|
file_xml3.write( content_data)
|
|
file_xml3.close()
|
|
|
|
if "template3" in param:
|
|
file_inc3 = open(directory_to_process + "/event/promotion_template3.inc", 'r')
|
|
file_inc3_content = file_inc3.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_template3", 'r')
|
|
file_inc3_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc3_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
#print("Kenta420:", key_val)
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc3_content = file_inc3_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/promotion_onclick3.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc3_content = file_inc3_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
#print(file_inc3_content)
|
|
|
|
#print( file_inc_content)
|
|
file_inc = open(directory_to_process + "/dummy_layout.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc3_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp3 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp3=" + tmp3)
|
|
|
|
content_data = tmp1 + tmp3
|
|
|
|
file_xml3_out = open(directory_to_process + "/event/out_put_file3.txt", 'r')
|
|
file_xml3_out_content = file_xml3_out.read()
|
|
file_xml3_out_content = file_xml3_out_content.strip()
|
|
file_xml3_out_content = file_xml3_out_content.replace("\r", "")
|
|
file_xml3_out_content = file_xml3_out_content.replace("\n", "")
|
|
|
|
file_xml3 = open(directory_to_process + file_xml3_out_content, 'w')
|
|
file_xml3.write( content_data)
|
|
file_xml3.close()
|
|
|
|
if "template4" in param:
|
|
file_inc4 = open(directory_to_process + "/event/promotion_template4.inc", 'r')
|
|
file_inc4_content = file_inc4.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_template4", 'r')
|
|
file_inc4_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc4_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
#print("Kenta420:", key_val)
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc4_content = file_inc4_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/promotion_onclick4.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc4_content = file_inc4_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
#print(file_inc4_content)
|
|
|
|
#print( file_inc_content)
|
|
file_inc = open(directory_to_process + "/dummy_layout.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc4_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp3 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp3=" + tmp3)
|
|
|
|
content_data = tmp1 + tmp3
|
|
|
|
file_xml4_out = open(directory_to_process + "/event/out_put_file4.txt", 'r')
|
|
file_xml4_out_content = file_xml4_out.read()
|
|
file_xml4_out_content = file_xml4_out_content.strip()
|
|
file_xml4_out_content = file_xml4_out_content.replace("\r", "")
|
|
file_xml4_out_content = file_xml4_out_content.replace("\n", "")
|
|
|
|
file_xml4 = open(directory_to_process + file_xml4_out_content, 'w')
|
|
file_xml4.write( content_data)
|
|
file_xml4.close()
|
|
|
|
if "double_template1" in param:
|
|
file_inc_double1 = open(directory_to_process + "/event/double_promotion_template1.inc", 'r')
|
|
file_inc_double1_content = file_inc_double1.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_double_template1", 'r')
|
|
file_inc_double1_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc_double1_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
#print("Kenta420:", key_val)
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc_double1_content = file_inc_double1_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/double_promotion_onclick1.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc_double1_content = file_inc_double1_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
# print(file_inc_double1_content)
|
|
|
|
# print( file_inc_content)
|
|
|
|
file_inc = open(directory_to_process + "/dummy_layout_double_pro.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend_double_pro.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc_double1_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp3 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp3=" + tmp3)
|
|
|
|
content_data = tmp1 + tmp3
|
|
|
|
file_xml_double1_out = open(directory_to_process + "/event/out_put_file_double_pro1.txt", 'r')
|
|
file_xml_double1_out_content = file_xml_double1_out.read()
|
|
file_xml_double1_out_content = file_xml_double1_out_content.strip()
|
|
file_xml_double1_out_content = file_xml_double1_out_content.replace("\r", "")
|
|
file_xml_double1_out_content = file_xml_double1_out_content.replace("\n", "")
|
|
|
|
file_xml_double1 = open(directory_to_process + file_xml_double1_out_content, 'w')
|
|
file_xml_double1.write( content_data)
|
|
file_xml_double1.close()
|
|
|
|
if "double_template2" in param:
|
|
file_inc_double2 = open(directory_to_process + "/event/double_promotion_template2.inc", 'r')
|
|
file_inc_double2_content = file_inc_double2.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_double_template2", 'r')
|
|
file_inc_double2_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc_double2_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
#print("Kenta420:", key_val)
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc_double2_content = file_inc_double2_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/double_promotion_onclick2.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc_double2_content = file_inc_double2_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
# print(file_inc_double2_content)
|
|
|
|
# print( file_inc_content)
|
|
|
|
file_inc = open(directory_to_process + "/dummy_layout_double_pro.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend_double_pro.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc_double2_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp3 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp3=" + tmp3)
|
|
|
|
content_data = tmp1 + tmp3
|
|
|
|
file_xml_double2_out = open(directory_to_process + "/event/out_put_file_double_pro2.txt", 'r')
|
|
file_xml_double2_out_content = file_xml_double2_out.read()
|
|
file_xml_double2_out_content = file_xml_double2_out_content.strip()
|
|
file_xml_double2_out_content = file_xml_double2_out_content.replace("\r", "")
|
|
file_xml_double2_out_content = file_xml_double2_out_content.replace("\n", "")
|
|
|
|
file_xml_double2 = open(directory_to_process + file_xml_double2_out_content, 'w')
|
|
file_xml_double2.write( content_data)
|
|
file_xml_double2.close()
|
|
|
|
if "double_template3" in param:
|
|
file_inc_double3 = open(directory_to_process + "/event/double_promotion_template3.inc", 'r')
|
|
file_inc_double3_content = file_inc_double3.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_double_template3", 'r')
|
|
file_inc_double3_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc_double3_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
#print("Kenta420:", key_val)
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc_double3_content = file_inc_double3_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/double_promotion_onclick3.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc_double3_content = file_inc_double3_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
# print(file_inc_double3_content)
|
|
|
|
# print( file_inc_content)
|
|
|
|
file_inc = open(directory_to_process + "/dummy_layout_double_pro.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend_double_pro.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc_double3_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp3 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp3=" + tmp3)
|
|
|
|
content_data = tmp1 + tmp3
|
|
|
|
file_xml_double3_out = open(directory_to_process + "/event/out_put_file_double_pro3.txt", 'r')
|
|
file_xml_double3_out_content = file_xml_double3_out.read()
|
|
file_xml_double3_out_content = file_xml_double3_out_content.strip()
|
|
file_xml_double3_out_content = file_xml_double3_out_content.replace("\r", "")
|
|
file_xml_double3_out_content = file_xml_double3_out_content.replace("\n", "")
|
|
|
|
file_xml_double3 = open(directory_to_process + file_xml_double3_out_content, 'w')
|
|
file_xml_double3.write( content_data)
|
|
file_xml_double3.close()
|
|
|
|
if "triple_template1" in param:
|
|
file_inc_triple1 = open(directory_to_process + "/event/triple_promotion_template1.inc", 'r')
|
|
file_inc_triple1_content = file_inc_triple1.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_triple_template1", 'r')
|
|
file_inc_triple1_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc_triple1_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
#print("Kenta420:", key_val)
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc_triple1_content = file_inc_triple1_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/triple_promotion_onclick1.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc_triple1_content = file_inc_triple1_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
# print(file_inc_triple1_content)
|
|
|
|
# print( file_inc_content)
|
|
|
|
file_inc = open(directory_to_process + "/dummy_layout_triple_pro.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend_triple_pro.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc_triple1_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp3 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp3=" + tmp3)
|
|
|
|
content_data = tmp1 + tmp3
|
|
|
|
file_xml_triple1_out = open(directory_to_process + "/event/out_put_file_triple_pro1.txt", 'r')
|
|
file_xml_triple1_out_content = file_xml_triple1_out.read()
|
|
file_xml_triple1_out_content = file_xml_triple1_out_content.strip()
|
|
file_xml_triple1_out_content = file_xml_triple1_out_content.replace("\r", "")
|
|
file_xml_triple1_out_content = file_xml_triple1_out_content.replace("\n", "")
|
|
|
|
file_xml_triple1 = open(directory_to_process + file_xml_triple1_out_content, 'w')
|
|
file_xml_triple1.write( content_data)
|
|
file_xml_triple1.close()
|
|
if "triple_template2" in param:
|
|
file_inc_triple2 = open(directory_to_process + "/event/triple_promotion_template2.inc", 'r')
|
|
file_inc_triple2_content = file_inc_triple2.read()
|
|
file_inc_img = open(directory_to_process + "../image/event/image_triple_template2", 'r')
|
|
file_inc_triple2_img_content = file_inc_img.read()
|
|
|
|
# replace key.
|
|
|
|
sp_key = file_inc_triple2_img_content.split("\n")
|
|
#print("sp_key = " + str(len( sp_key)))
|
|
for sp_line in sp_key:
|
|
sp_line = sp_line.strip()
|
|
key_val = sp_line.split("=")
|
|
#print("Kenta420:", key_val)
|
|
if len( key_val) == 2:
|
|
#print("k = " + key_val[0] + " val=" + key_val[1])
|
|
file_inc_triple2_content = file_inc_triple2_content.replace( "###" + key_val[0], '"' + key_val[1].strip() + '"')
|
|
|
|
|
|
file_inc_event_click = open(directory_to_process + "/event/triple_promotion_onclick1.inc", 'r')
|
|
file_inc_event_click_content = file_inc_event_click.read()
|
|
|
|
file_inc_triple2_content = file_inc_triple2_content.replace("###EventOnClick", file_inc_event_click_content)
|
|
|
|
|
|
# print(file_inc_triple2_content)
|
|
|
|
# print( file_inc_content)
|
|
|
|
file_inc = open(directory_to_process + "/dummy_layout_triple_pro.inc", 'r')
|
|
file_inc_content = file_inc.read()
|
|
|
|
content_data_was_repack = content_recommend_triple_pro.replace(";dummy_layout.inc", file_inc_content)
|
|
content_data = content_data_was_repack.replace(";BigLogoLayout", file_inc_triple2_content)
|
|
|
|
begin_text = content_data.index(";TAGESP")
|
|
end_text = content_data.index(";TAGESP", begin_text + 7)
|
|
#print("sub text = " + str(begin_text) + " end = " + str(end_text))
|
|
tmp1 = content_data[: begin_text - 7]
|
|
|
|
tmp3 = content_data[ end_text:-1]
|
|
#print("tmp1=" + tmp1)
|
|
#print("tmp3=" + tmp3)
|
|
|
|
content_data = tmp1 + tmp3
|
|
|
|
file_xml_triple2_out = open(directory_to_process + "/event/out_put_file_triple_pro2.txt", 'r')
|
|
file_xml_triple2_out_content = file_xml_triple2_out.read()
|
|
file_xml_triple2_out_content = file_xml_triple2_out_content.strip()
|
|
file_xml_triple2_out_content = file_xml_triple2_out_content.replace("\r", "")
|
|
file_xml_triple2_out_content = file_xml_triple2_out_content.replace("\n", "")
|
|
|
|
file_xml_triple2 = open(directory_to_process + file_xml_triple2_out_content, 'w')
|
|
file_xml_triple2.write( content_data)
|
|
file_xml_triple2.close() |