DO
This commit is contained in:
parent
d2469e310c
commit
8b51462cfd
53 changed files with 11954 additions and 121 deletions
|
|
@ -11,25 +11,56 @@ else:
|
|||
|
||||
|
||||
file_xml.close()
|
||||
if "template1" in param:
|
||||
|
||||
# " "
|
||||
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)
|
||||
file_inc2 = open(directory_to_process + "/event/promotion_template1.inc", 'r')
|
||||
file_inc2_content = file_inc2.read()
|
||||
file_inc_img = open(directory_to_process + "../image/event/image_template", 'r')
|
||||
file_inc2_img_content = file_inc_img.read()
|
||||
|
||||
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]
|
||||
# replace key.
|
||||
|
||||
tmp2 = content_data[ end_text:-1]
|
||||
#print("tmp1=" + tmp1)
|
||||
#print("tmp2=" + tmp2)
|
||||
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() + '"')
|
||||
|
||||
|
||||
content_data = tmp1 + tmp2
|
||||
file_inc_event_click = open(directory_to_process + "/event/promotion_onclick.inc", 'r')
|
||||
file_inc_event_click_content = file_inc_event_click.read()
|
||||
|
||||
file_xml3 = open(directory_to_process + "/event/page_recommend_backToSchool.xml", 'w')
|
||||
file_xml3.write( content_data)
|
||||
file_xml3.close()
|
||||
file_inc2_content = file_inc2_content.replace("###EventOnClick", file_inc_event_click_content)
|
||||
|
||||
|
||||
print(file_inc2_content)
|
||||
|
||||
#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_xml3_out = open(directory_to_process + "/event/out_put_file.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()
|
||||
|
||||
|
||||
|
|
|
|||
1
xml/event/out_put_file.txt
Normal file
1
xml/event/out_put_file.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
/event/promotion_pepsi.xml
|
||||
1
xml/event/promotion_onclick.inc
Normal file
1
xml/event/promotion_onclick.inc
Normal file
|
|
@ -0,0 +1 @@
|
|||
Open "ROOT/taobin_project/xml/page_catalog_group_pepsi_pro.xml"
|
||||
8984
xml/event/promotion_pepsi.xml
Normal file
8984
xml/event/promotion_pepsi.xml
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -5,9 +5,7 @@
|
|||
<Filename>
|
||||
eval(
|
||||
If show_eng = "true" Then
|
||||
|
||||
Var return = ###normal_eng
|
||||
|
||||
Else
|
||||
Var return = ###normal_thai
|
||||
EndIf
|
||||
|
|
@ -16,9 +14,7 @@
|
|||
<FilenamePress>
|
||||
eval(
|
||||
If show_eng = "true" Then
|
||||
|
||||
Var return = ###press_eng
|
||||
|
||||
Var return = ###press_eng
|
||||
Else
|
||||
Var return = ###press_thai
|
||||
EndIf
|
||||
|
|
@ -27,9 +23,7 @@
|
|||
<FilenameDisable>
|
||||
eval(
|
||||
If show_eng = "true" Then
|
||||
|
||||
Var return = ###disable_eng
|
||||
|
||||
Else
|
||||
Var return = ###disable_thai
|
||||
EndIf
|
||||
|
|
|
|||
|
|
@ -2,37 +2,19 @@
|
|||
; zone promote
|
||||
If OpenFromPageBoard = 1 Then
|
||||
|
||||
If SongkranEnable = 1 Then
|
||||
OpenInst 2 "ROOT/taobin_project/xml/page_catalog_group_recommend3.xml"
|
||||
If PepsiProEnable = 1 Then
|
||||
OpenInst 2 "ROOT/taobin_project/xml/event/promotion_pepsi.xml"
|
||||
Var OpenFromPageBoard = 0
|
||||
Else
|
||||
If OreoForFreeEnable = 1 Then
|
||||
OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/xml/event/page_recommend_backToSchool.xml"
|
||||
Var OpenFromPageBoard = 0
|
||||
EndIf
|
||||
|
||||
If OreoDueEnable = 1 Then
|
||||
OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/xml/event/page_recommend_oreo_buy2_save_more.xml"
|
||||
Var OpenFromPageBoard = 0
|
||||
EndIf
|
||||
|
||||
If OpenFromPageBoard = 1 Then
|
||||
OpenInst 2 "ROOT/taobin_project/xml/page_catalog_group_recommend.xml"
|
||||
EndIf
|
||||
|
||||
OpenInst 2 "ROOT/taobin_project/xml/page_catalog_group_recommend.xml"
|
||||
|
||||
EndIf
|
||||
Else
|
||||
|
||||
If SongkranEnable = 1 Then
|
||||
Open "ROOT/taobin_project/xml/page_catalog_group_recommend3.xml"
|
||||
If PepsiProEnable = 1 Then
|
||||
Open "ROOT/taobin_project/xml/event/promotion_pepsi.xml"
|
||||
Else
|
||||
If OreoForFreeEnable = 1 Then
|
||||
Open "/mnt/sdcard/coffeevending/taobin_project/xml/event/page_recommend_backToSchool.xml"
|
||||
EndIf
|
||||
|
||||
If OreoDueEnable = 1 Then
|
||||
Open "/mnt/sdcard/coffeevending/taobin_project/xml/event/page_recommend_oreo_buy2_save_more.xml"
|
||||
EndIf
|
||||
|
||||
|
||||
Open "ROOT/taobin_project/xml/page_catalog_group_recommend.xml"
|
||||
EndIf
|
||||
|
|
|
|||
|
|
@ -1,63 +1,58 @@
|
|||
|
||||
|
||||
Var PromotionIDOreoBuyTwoSaveMore = 0
|
||||
Var BackToSchoolForFreeEnable = 0
|
||||
|
||||
;DEBUGVAR SystemDateMonthInt
|
||||
;DEBUGVAR SystemDateDayInt
|
||||
|
||||
Var OreoForFreeEnable = 0
|
||||
; Reset flag away.
|
||||
Var OreoDueEnable = 0
|
||||
Var OreoForFreeEnable = 0
|
||||
Var SoundBackToSchoolEnable = 0
|
||||
Var PromotionIDOreoBuyTwoSaveMore = 0
|
||||
Var BackToSchoolForFreeEnable = 0
|
||||
|
||||
If SystemDateMonthInt = 5 Then
|
||||
If SystemDateDayInt = 6 Then
|
||||
Var OreoDueEnable = 1
|
||||
EndIf
|
||||
If SystemDateDayInt = 7 Then
|
||||
Var OreoDueEnable = 1
|
||||
EndIf
|
||||
Var SoundBackToSchoolType = 0
|
||||
; End
|
||||
|
||||
|
||||
|
||||
Var PepsiProEnable = 0
|
||||
|
||||
If SystemDateMonthInt = 6 Then
|
||||
If SystemDateDayInt = 12 Then
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
If SystemDateDayInt = 13 Then
|
||||
Var OreoDueEnable = 1
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
If SystemDateDayInt = 14 Then
|
||||
Var OreoDueEnable = 1
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
If SystemDateDayInt = 15 Then
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
If SystemDateDayInt = 16 Then
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
|
||||
|
||||
If SystemDateDayInt = 19 Then
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
If SystemDateDayInt = 20 Then
|
||||
Var OreoDueEnable = 1
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
If SystemDateDayInt = 21 Then
|
||||
Var OreoDueEnable = 1
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
|
||||
|
||||
If SystemDateDayInt = 27 Then
|
||||
Var OreoDueEnable = 1
|
||||
If SystemDateDayInt = 22 Then
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
If SystemDateDayInt = 28 Then
|
||||
Var OreoDueEnable = 1
|
||||
If SystemDateDayInt = 23 Then
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
|
||||
EndIf
|
||||
|
||||
If SystemDateMonthInt = 5 Then
|
||||
If SystemDateDayInt > 7 Then
|
||||
If SystemDateDayInt < 13 Then
|
||||
Var OreoForFreeEnable = 1
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
If SystemDateDayInt > 14 Then
|
||||
If SystemDateDayInt < 20 Then
|
||||
Var OreoForFreeEnable = 1
|
||||
EndIf
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
|
||||
|
||||
If BoxID = 200001 Then
|
||||
Var OreoDueEnable = 0
|
||||
Var OreoForFreeEnable = 0
|
||||
|
|
@ -68,25 +63,17 @@ If BoxID = 200000 Then
|
|||
Var OreoForFreeEnable = 0
|
||||
EndIf
|
||||
|
||||
|
||||
Var OreoForFreeLimit = ""
|
||||
READ_FILE "/mnt/sdcard/oreo_for_free_limit" OreoForFreeLimit
|
||||
If BoxID = 172053 Then
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
If BoxID = 172644 Then
|
||||
Var PepsiProEnable = 1
|
||||
EndIf
|
||||
|
||||
|
||||
Var SoundBackToSchoolEnable = 1
|
||||
|
||||
DEBUGVAR OreoForFreeLimit
|
||||
DEBUGVAR PepsiProEnable
|
||||
DEBUGVAR OreoDueEnable
|
||||
DEBUGVAR OreoForFreeEnable
|
||||
|
||||
; Init default
|
||||
If SoundBackToSchoolType = "" Then
|
||||
Var SoundBackToSchoolType = 1
|
||||
EndIf
|
||||
If SoundBackToSchoolType = 1 Then
|
||||
Var SoundBackToSchoolType = 2
|
||||
Else
|
||||
Var SoundBackToSchoolType = 1
|
||||
EndIf
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue