--- lise/Extensions/liseScript.py 2004/04/14 16:37:27 1.1 +++ lise/Extensions/liseScript.py 2004/04/23 16:25:09 1.2 @@ -3,11 +3,15 @@ import os def liseScript(mainobj, idclicked="0"): """ liseScript """ + pictid = int(idclicked) - 1 if pictid < 0: pictid = 0 session = mainobj.REQUEST.SESSION + pagelist = mainobj.pagelist + pagelistlen = len(pagelist) + openchaplist = session.get("openchaplist", []) newopenchaplist = 0 if len(openchaplist) < 1: @@ -23,6 +27,8 @@ def liseScript(mainobj, idclicked="0"): pagelist = mainobj.pagelist filelist = mainobj.filenames + filelistlen = len(filelist) +# baseurl = mainobj.baseurl filelistindex = 0; # fetch the current picture @@ -33,16 +39,22 @@ def liseScript(mainobj, idclicked="0"): else: if IsInt(pagelist[pictid].pictindex): filelistindex = int(pagelist[pictid].pictindex) - pictfile = filelist[filelistindex] + if filelistindex < filelistlen: + pictfile = filelist[filelistindex] + else: + pictfile = 'this_is the_no_fucking_picture_error_from_script_1' else: - pictfile = 'this_is the_no_fucking_picture_error' + pictfile = 'this_is the_no_fucking_picture_error_from_script_2' else: if IsInt(pagelist[pictid].pictindex): filelistindex = int(pagelist[pictid].pictindex) - pictfile = filelist[filelistindex] + if filelistindex < filelistlen: + pictfile = filelist[filelistindex] + else: + pictfile = 'this_is the_no_fucking_picture_error_from_script_3' else: - pictfile = 'this_is the_no_fucking_picture_error' - mainobj.currpict = pictfile + pictfile = 'this_is the_no_fucking_picture_error_from_script_4' + mainobj.currpict = '' thelength = len(pagelist) counter = 0