Code: Alles auswählen
#=======================================================spezielle site 12.00===============================================================================================
#da hier so viele dokumente waren, haben wir beschlossen, eine site zu generieren, welche interaktiv ist
if file_list[i][:5]=='12.00':
if len(file_list[i])>9:
checker2=1
out_file=open('temp_data\\'+back_check(0,check_list),'a')
else:
out_file=open('temp_data\\'+file_list[i],'w')
out_file.write('some text')
for line in in_file:
if end_of_mitula.search(line):
break
if checker2<1:
if titel.search(line):
match_one=re.search('some text(.*)some text',line)
if match_one:
out_file.write(text_title_12(match_one.group(1)))
if subtitle.search(line):
match_two=re.search('some text(.*)some text',line)
if match_two:
if checker>=1:
out_file.write('some text')
out_file.write(text_subtitle_12(match_two.group(1)))
checker+=1
if element.search(line):
match_table_link=re.search('some text(.*)some text',line)
match_table_nolink=re.search('some text(.*)some text',line)
if match_table_link:
out_file.write('some text'+match_table_link.group(1)+'some text')
elif match_table_nolink:
out_file.write('some text'+match_table_nolink.group(1)+'some text')
#==========================================================================================================================================================================
else:
if len(file_list[i])>9:
checker2=1
out_file=open('temp_data\\'+back_check(0,check_list),'a')
else:
out_file=open('temp_data\\'+file_list[i],'w')
out_file.write('some text')
for line in in_file:
if checker2<1:
if titel.search(line):
match_one=re.search('some text(.*)some text',line)
if match_one:
out_file.write(text_title_no(match_one.group(1)))
if subtitle.search(line):
match_two=re.search('some text(.*)some text',line)
if match_two:
if checker>=1:
out_file.write('some text')
out_file.write(text_subtitle_no(match_two.group(1)))
checker+=1
if element.search(line):
match_table_link=re.search('some text(.*)some text',line)
match_table_nolink=re.search('some text(.*)some text',line)
if match_table_link:
out_file.write('some text'+match_table_link.group(1)+'some text')
elif match_table_nolink:
out_file.write('some text'+match_table_nolink.group(1)+'some text')
#========================================== dieser teil ist fuer die progress-leiste==========================
if 440/len(file_list)>1:
tempi=440/len(file_list)
canwin.create_polygon(progress,372,progress+tempi,372,progress+tempi,388,progress,388,fill='orange')
canwin.create_polygon(130,350,570,350,570,369,130,369,fill='#E2E2E2')
canwin.create_text(130,360,text=file_list[i],anchor=W)
progress+=tempi
root.update()
elif 440*i/len(file_list)>=leckerli:
canwin.create_line(progress,372,progress,388,fill='orange')
canwin.create_polygon(130,350,570,350,570,369,130,369,fill='#E2E2E2')
canwin.create_text(130,360,text=file_list[i],anchor=W)
progress+=1
leckerli+=1
root.update()
#==============================================================================================================
if i==len(file_list)-1: #hier ist der schluss des html dokumentes (/body\n/html usw)
out_file.write('some text')
elif i<len(file_list)-1 and file_list[i+1][5:9]!='Page':
out_file.write('some text')
in_file.close()
out_file.close()
i+=1
del file_list,i
if progress<568: #zur sicherheit, damit die leiste voll wird
canwin.create_polygon(progress,372,568,372,568,388,progress,388,fill='orange')
tkMessageBox.showinfo('Fertig','some text')
sys.exit()
except IndexError:
tkMessageBox.showerror('Fehler','some text')
browser()
bt_exit=Button(root,text=' Beenden ',command=quit)
bt_exit.pack(padx=5,pady=10,side=RIGHT)
bt_help=Button(root,text=' Hilfe ',command=helpi)
bt_help.pack(padx=5,pady=10,side=RIGHT)
bt_exe=Button(root,text=' Bearbeiten ',command=prozessli)
bt_exe.pack(padx=5,pady=10,side=RIGHT)
bt_browse=Button(root,text=' Browse ',command=browser)
bt_browse.pack(padx=5,pady=10,side=RIGHT)
root.mainloop()