66 lines
2.3 KiB
Python
66 lines
2.3 KiB
Python
print( "dir= " + directory_to_process + "/page_catalog_group_recommend.xml");
|
|
file_xml = open(directory_to_process + "/page_catalog_group_recommend.xml", 'r')
|
|
file_content_main = file_xml.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_inc2 = open(directory_to_process + "/big_logo.inc", 'r')
|
|
file_inc2_content = file_inc2.read()
|
|
#print( file_inc_content)
|
|
content_data_was_repack = file_content_main.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_xml.close()
|
|
|
|
|
|
file_inc2 = open(directory_to_process + "/event/big_logo_back_to_school.inc", 'r')
|
|
file_inc2_content = file_inc2.read()
|
|
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 = open(directory_to_process + "/event/page_recommend_backToSchool.xml", 'w')
|
|
file_xml3.write( content_data)
|
|
file_xml3.close()
|
|
|
|
#############################################
|
|
file_inc2 = open(directory_to_process + "/event/big_logo_oreo_buy2_save_movel.inc", 'r')
|
|
file_inc2_content = file_inc2.read()
|
|
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 = open(directory_to_process + "/event/page_recommend_oreo_buy2_save_more.xml", 'w')
|
|
file_xml3.write( content_data)
|
|
file_xml3.close()
|
|
|